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); } }