예제 #1
0
        private void MainStartegyCheckList_treeView_AfterSelect(object sender, TreeViewEventArgs e)
        {
            int i = e.Node.Index;

            iStrategy strategy = app.strategyManager.Get(strategyIndentifiers[i]);

            if (strategy != null)
            {
                StrategyDetail_name_lb.Text       = strategy.Name;
                StrategyDetail_identifier_lb.Text = strategy.Identifier;
                StrategyDetails_gb.Text           = "Detalhes de " + strategy.Name;
                selectedStrategy = i;
                StrategyDetail_active_check.Checked = e.Node.Checked;
                StrategyDetails_gb.Show();
                return;
            }


            StrategyDetail_name_lb.Text       = "";
            StrategyDetail_identifier_lb.Text = "";
            StrategyDetails_gb.Hide();
            selectedStrategy = -1;
        }
예제 #2
0
        public MainForm(AppData app)
        {
            this.app = app;
            InitializeComponent();

            logos = new Dictionary <int, Image>();


            this.MainConfig_RTDDefaultUser_text.Text = ConfigurationManager.AppSettings["RTDDefaultUser"];

            MainStockTab_StockList_listbox.Items.Clear();
            foreach (string item in app.streamerClient.Items)
            {
                MainStockTab_StockList_listbox.Items.Add(item);
            }

            /*   bool RTDStreamAutostart = false;
             * if (ConfigurationManager.AppSettings["RTDStreamAutostart"].Equals("1"))
             *     RTDStreamAutostart = true;
             */
            //RTDStreamAutostart_cb.Checked = RTDStreamAutostart;

            MainStartegyCheckList_treeView.Nodes.Clear();
            strategyIndentifiers = new List <string>();
            int currentSize = 0;

            foreach (iStrategy strategy in app.strategyManager.All)
            {
                MainStartegyCheckList_treeView.Nodes.Add(strategy.Name);
                strategyIndentifiers.Add(strategy.Identifier);
                MainStartegyCheckList_treeView.Nodes[currentSize].Checked = strategy.Active;

                currentSize++;
            }

            StrategyDetails_gb.Hide();
            MainStockDetail_gb.Hide();


            //sobre dados históricos.
            string defaultHDPIdentifier = "";

            if (app.historicalDataManager.Config.AppSettings.Settings["historicalDataProvider"] != null)
            {
                defaultHDPIdentifier = app.historicalDataManager.Config.AppSettings.Settings["historicalDataProvider"].Value;
            }
            foreach (HistoricalDataProvider hdp in app.historicalDataManager.All)
            {
                if (defaultHDPIdentifier.Equals(hdp.Identifier))
                {
                    HDDefaultProvider_cb.SelectedIndex = HDDefaultProvider_cb.Items.Add(hdp.Name);
                }
                else
                {
                    HDDefaultProvider_cb.Items.Add(hdp.Name);
                }
            }

            HistoricalDataAutoUpdate_check.Checked =
                app.historicalDataManager.Config.AppSettings.Settings["historicalDataAutoUpdate"] != null &&
                app.historicalDataManager.Config.AppSettings.Settings["historicalDataAutoUpdate"].Value == "1" ? true : false;
        }