• 事件参数 定义 武胜


    public class CTPEventArgs : EventArgs
      {
        public CTPResponseInfo ResponseInfo { get; internal set; }
        public int RequestID { get; internal set; }
    
        public CTPEventArgs(CTPResponseInfo rspInfo, int requestID)
        {
          this.ResponseInfo = rspInfo;
          this.RequestID = requestID;
        }
    
        public CTPEventArgs(CTPResponseInfo rspInfo)
          : this(rspInfo, 0)
        { }
    
        public CTPEventArgs()
          : this(CTPResponseInfo.Empty, 0)
        { }
      }
    
      public class CTPEventArgs<T> : CTPEventArgs
      {
        T value;
    
        public object RequestData { get; internal set; }
    
        public T Value
        {
          get { return this.value; }
          set { this.value = value; }
        }
    
        public CTPEventArgs(T value)
          : base()
        {
          this.value = value;
        }
    
        internal CTPEventArgs(T value, CTPResponseInfo rspInfo)
          : this(value, rspInfo, 0)
        {
    
        }
    
        internal CTPEventArgs(T value, CTPResponseInfo rspInfo, int requestID)
          : base(rspInfo, requestID)
        {
          this.value = value;
        }
      }
    /// <summary>
      /// 返回的数据类型
      /// </summary>
      public class CTPResponseDataTypeAttribute : Attribute
      {
        public Type Type { get; set; }
    
        public CTPResponseDataTypeAttribute(Type value)
        {
          this.Type = value;
        }
      }

    枚举示例

    View Code
    /// <summary>
      /// TFtdcIdCardTypeType是一个证件类型类型
      /// </summary>
      public enum CTPStockIdCardType : byte
      {
        /// <summary>
        /// 组织机构代码
        /// </summary>
    [Description("组织机构代码")]
        EID = (byte)'0',
        /// <summary>
        /// 身份证
        /// </summary>
    [Description("身份证")]
        IDCard = (byte)'1',
        /// <summary>
        /// 军官证
        /// </summary>
    [Description("军官证")]
        OfficerIDCard = (byte)'2',
        /// <summary>
        /// 警官证
        /// </summary>
    [Description("警官证")]
        PoliceIDCard = (byte)'3',
        /// <summary>
        /// 士兵证
        /// </summary>
    [Description("士兵证")]
        SoldierIDCard = (byte)'4',
        /// <summary>
        /// 户口簿
        /// </summary>
    [Description("户口簿")]
        HouseholdRegister = (byte)'5',
        /// <summary>
        /// 护照
        /// </summary>
    [Description("护照")]
        Passport = (byte)'6',
        /// <summary>
        /// 台胞证
        /// </summary>
    [Description("台胞证")]
        TaiwanCompatriotIDCard = (byte)'7',
        /// <summary>
        /// 回乡证
        /// </summary>
    [Description("回乡证")]
        HomeComingCard = (byte)'8',
        /// <summary>
        /// 营业执照号
        /// </summary>
    [Description("营业执照号")]
        LicenseNo = (byte)'9',
        /// <summary>
        /// 其他证件
        /// </summary>
    [Description("其他证件")]
        OtherCard = (byte)'x'
      }

    事件

    View Code
    /// <summary>
        /// 报单录入请求响应
        /// </summary>
        public event EventHandler<CTPEventArgs<CZQThostFtdcInputOrderField>> OrderInsertResponse
        {
          add { AddHandler(CTPStockResponseType.OrderInsertResponse, value); }
          remove { RemoveHandler(CTPStockResponseType.OrderInsertResponse, value); }
        }
  • 相关阅读:
    2018年NGINX最新版高级视频教程
    PHP 高级工程面试题汇总
    2018年最全Go语言教程零基础入门到进阶实战视频
    Mac和window生成ssh和查看ssh key
    33款可用来抓数据的开源爬虫软件工具
    什么是CMS系统
    对于做需求分析时的一些心得
    WPF和Silverlight的关系
    My97日期控件 My97 DatePicker Ver 3.0 正式版(转)
    HTML教程HTML技巧层的高级应用
  • 原文地址:https://www.cnblogs.com/zeroone/p/3036094.html
Copyright © 2020-2023  润新知