public ServerMBMain() { InitializeComponent(); _msg.SendToBack(); m_ComMgr = new MBTCOMLib.MbtComMgrClass(); m_ComMgr.SilentMode = true; m_ComMgr.EnableSplash(false); m_OrderClient = m_ComMgr.OrderClient; m_Quotes = m_ComMgr.Quotes; ContextMenu = new ContextMenu(); ContextMenu.MenuItems.Add("Messages", new EventHandler(rightmessage)); // tradelink bindings tl.newProviderName = Providers.MBTrading; tl.newFeatureRequest += new MessageArrayDelegate(tl_newFeatureRequest); tl.newSendOrderRequest += new OrderDelegate(tl_newSendOrderRequest); tl.newRegisterStocks += new DebugDelegate(tl_newRegisterStocks); tl.newOrderCancelRequest += new UIntDelegate(tl_newOrderCancelRequest); tl.newAcctRequest += new StringDelegate(tl_newAcctRequest); tl.newPosList += new PositionArrayDelegate(tl_newPosList); // mb bindings m_ComMgr.OnLogonSucceed += new IMbtComMgrEvents_OnLogonSucceedEventHandler(m_ComMgr_OnLogonSucceed); m_ComMgr.OnLogonDeny += new IMbtComMgrEvents_OnLogonDenyEventHandler(m_ComMgr_OnLogonDeny); m_OrderClient.OnSubmit += new _IMbtOrderClientEvents_OnSubmitEventHandler(m_OrderClient_OnSubmit); m_OrderClient.OnRemove += new _IMbtOrderClientEvents_OnRemoveEventHandler(m_OrderClient_OnRemove); m_OrderClient.OnPositionUpdated += new _IMbtOrderClientEvents_OnPositionUpdatedEventHandler(m_OrderClient_OnPositionUpdated); FormClosing += new FormClosingEventHandler(ServerMBMain_FormClosing); }
private void Initialize() { m_ComMgr = null; m_ComMgr = new MBTCOMLib.MbtComMgrClass(); m_ComMgr.SilentMode = true; m_ComMgr.EnableSplash(false); m_OrderClient = m_ComMgr.OrderClient; m_OrderClient.SilentMode = true; m_Quotes = m_ComMgr.Quotes; AssignEventHandlers(); InstrumentReaders = new InstrumentReaders(receiver, m_OrderClient, m_Quotes); }