Example #1
0
        protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines)
        {
            base.ApplicationStartup(container, pipelines);
            string SystemLocation = File.ReadAllText(string.Format(@"{0}\{1}", System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "system.imp"));

            container.Register <IImperaturMarket>(ImperaturContainer.BuildImperaturContainer(SystemLocation));
        }
Example #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            ImperaturData oNewSystem      = null;
            bool          CreateNewSystem = ShowSystemLoad();

            ImperaturContainer.SystemNotificationEvent += ImperaturContainer_SystemNotificationEvent;
            oWaitLoadingSystem = new dialog.WaitDialog();
            oWaitLoadingSystem.Show();
            oWaitLoadingSystem.Refresh();
            if (CreateNewSystem)
            {
                oWaitLoadingSystem.SetSystemNotificationText("Creating the new system...");
                oWaitLoadingSystem.Refresh();
                oNewSystem = CreateNewImperaturMarket(oNewSystem);
            }

            if (oNewSystem != null)
            {
                oWaitLoadingSystem.SetSystemNotificationText("Loading the Imperatur Market system...");
                oWaitLoadingSystem.Refresh();
                m_Ic = (ImperaturMarket)ImperaturContainer.BuildImperaturContainer(oNewSystem);
            }
            else
            {
                oWaitLoadingSystem.SetSystemNotificationText("Loading the Imperatur Market system...");
                oWaitLoadingSystem.Refresh();
                m_Ic = (ImperaturMarket)ImperaturContainer.BuildImperaturContainer(SystemLocation);
            }
            oWaitLoadingSystem.SetSystemNotificationText("Loading is done, opening the system for you");
            oWaitLoadingSystem.Refresh();
            m_Ic.SystemNotificationEvent += M_Ic_SystemNotificationEvent;
            oWaitLoadingSystem.Close();
            //this far we save the systemlocation to the clients application folder for easy access
            //SystemLocationCacheFile
            SaveSystemLocationToCache(oNewSystem);

            this.toolStripStatusLabel_system.Text =
                string.Format("{0} | {1} | {2}", m_Ic.GetSystemData().SystemDirectory, m_Ic.GetSystemData().SystemCurrency, m_Ic.SystemExchangeStatus.ToString());

            if (m_Ic.SystemExchangeStatus.ToString() == "Closed")
            {
                toolStripStatusLabel_system.BackColor = Color.IndianRed;
            }
            else
            {
                toolStripStatusLabel_system.BackColor = this.BackColor;
            }

            //add the controls to the different areas
            m_oAccountTab      = new AccountTab(m_Ic.GetAccountHandler(), m_Ic.GetTradeHandler(), m_Ic.OrderQueue);
            m_oAccountTab.Dock = DockStyle.Fill;
            tabPage_account.Controls.Add(m_oAccountTab);
            m_Ic.QuoteUpdateEvent += M_Ic_QuoteUpdateEvent;
            this.checkBox_automaticTrading.Checked = m_Ic.GetSystemData().IsAutomaticMaintained;
        }
Example #3
0
 public ImperaturServiceCore(string SystemLocation)
 {
     m_oImperaturCore = (ImperaturMarket)ImperaturContainer.BuildImperaturContainer(SystemLocation);
 }