public void Subscribe(int requestId, string symbol, string formula) { MsgSubscribe msgSubscribe = new MsgSubscribe(); msgSubscribe.Data.RequestId = requestId; msgSubscribe.Data.Symbol = symbol; msgSubscribe.Data.Formula = formula; this.SendMessage(msgSubscribe); }
protected Message CreateMessage(int type) { Message message; switch (type) { case 1100: message = new MsgCommand(); break; case 1101: message = new MsgReport(); break; case 1102: message = new MsgOrderCancelReject(); break; case 2001: message = new MsgBrokerInfo(); break; case 1: message = new MsgLogon(); break; case 2: message = new MsgLogonStatus(); break; case 3: message = new MsgHeartbeat(); break; case 10: message = new MsgSubscribe(); break; case 11: message = new MsgUnsubscribe(); break; case 12: message = new MsgProviderError(); break; case 13: message = new MsgSubscriptionStatus(); break; case 1000: message = new MsgTick(); break; case 1001: message = new MsgLevel2(); break; default: message = new MsgUnknown(type); break; } return message; }