Exemple #1
0
        private void ComboBoxPlate_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.ComboBoxVariety.Items.Clear();
            this.ComboBoxVariety.Items.Add("所有的股票");

            foreach (var item in GlobalStockManager.ToArrayVarietyByPlate((string)this.ComboBoxPlate.Items[this.ComboBoxPlate.SelectedIndex]))
            {
                this.ComboBoxVariety.Items.Add(item);
            }

            this.ComboBoxVariety.SelectedIndex = 0;
        }
Exemple #2
0
        public void GlobalSetting_LoadedGlobalSetting(object sender, EventArgs e)
        {
            this.ComboBoxPlate.Items.Clear();

            foreach (var item in GlobalStockManager.ToArrayPlate())
            {
                this.ComboBoxPlate.Items.Add(item);
            }

            if (this.ComboBoxPlate.Items.Count > 1)
            {
                this.ComboBoxPlate.SelectedIndex = 0;
            }
        }
Exemple #3
0
        private void ButtonGetStock_Click(object sender, EventArgs e)
        {
            this.CheckedListBox.Items.Clear();

            if (RadioButtonALL.Checked == true)
            {
                foreach (var item in GlobalStockManager.ToArray())
                {
                    foreach (var item2 in item.ToArray())
                    {
                        string strStockCode = Demo.Stock.X.U50.Common.U50StockInfo.GetStockInfo(item.StockPlate, item.StockVariety, item2.StockName, item2.StockSymbol);
                        this.CheckedListBox.Items.Add(strStockCode);
                    }
                }
            }
            else if (RadioButtonSelect.Checked == true)
            {
                if (this.ComboBoxVariety.Text == "所有的股票")
                {
                    foreach (string item in GlobalStockManager.ToArrayVarietyByPlate(this.ComboBoxPlate.Text))
                    {
                        StockManager stockManager = GlobalStockManager.GetStockManagerByPlateAndVariety(this.ComboBoxPlate.Text, item);
                        if (stockManager == null)
                        {
                            continue;
                        }

                        foreach (var item2 in stockManager.ToArray())
                        {
                            string strStockCode = Demo.Stock.X.U50.Common.U50StockInfo.GetStockInfo(this.ComboBoxPlate.Text, item, item2.StockName, item2.StockSymbol);
                            this.CheckedListBox.Items.Add(strStockCode);
                        }
                    }
                }
                else
                {
                    StockManager stockManager = GlobalStockManager.GetStockManagerByPlateAndVariety(this.ComboBoxPlate.Text, this.ComboBoxVariety.Text);
                    if (stockManager == null)
                    {
                        return;
                    }

                    foreach (var item2 in stockManager.ToArray())
                    {
                        string strStockCode = Demo.Stock.X.U50.Common.U50StockInfo.GetStockInfo(this.ComboBoxPlate.Text, this.ComboBoxVariety.Text, item2.StockName, item2.StockSymbol);
                        this.CheckedListBox.Items.Add(strStockCode);
                    }
                }
            }
        }
Exemple #4
0
        private void InitOptionFormInfo()
        {
            this.SuspendLayout();
            {
                m_TreeNodeSetting.Nodes.Add(m_TreeNodeSettingSub);

                m_SettingControl         = new OptionAControl();
                m_SettingControl.Dock    = DockStyle.Fill;
                m_SettingControl.Visible = false;

                this.m_AllOptionControlInfo.Add(m_TreeNodeSetting, m_SettingControl);
                this.m_AllOptionControlInfo.Add(m_TreeNodeSettingSub, m_SettingControl);

                this.Panel.Controls.Add(m_SettingControl);

                m_SettingControl.CheckBoxPopupInfo.Checked = GlobalSetting.IsPopStartupInfo;
                m_SettingControl.NumericUpDownKLine.Value  = (decimal)GlobalSetting.ShowKLineLength;
                m_SettingControl.TrackBarKLine.Value       = (int)GlobalSetting.ShowKLineLength;
                m_SettingControl.SetConfigFile            += new EventHandlerNone(SettingControl_SetConfigFile);

                this.TreeView.Nodes.Add(m_TreeNodeSetting);
                //-------------------------------------

                PlateInfo[] plateInfos = GlobalSetting.PlateInfos;
                for (int iIndex = 0; iIndex < plateInfos.Length; iIndex++)
                {
                    PlateInfo plateInfo = plateInfos[iIndex];

                    TreeNode newTreeNodePlate     = new TreeNode(plateInfo.Name);
                    TreeNode newTreeNodePlateSub  = new TreeNode("常规");
                    TreeNode newTreeNodePlateSub2 = new TreeNode("所有股票");

                    newTreeNodePlate.Nodes.Add(newTreeNodePlateSub);
                    newTreeNodePlate.Nodes.Add(newTreeNodePlateSub2);

                    OptionBControl optionBControl = new OptionBControl {
                        Dock = DockStyle.Fill, Visible = false
                    };

                    this.m_AllOptionControlInfo.Add(newTreeNodePlate, optionBControl);
                    this.m_AllOptionControlInfo.Add(newTreeNodePlateSub, optionBControl);

                    this.Panel.Controls.Add(optionBControl);

                    OptionFControl optionFControl = new OptionFControl {
                        Dock = DockStyle.Fill, Visible = false
                    };

                    this.m_AllOptionControlInfo.Add(newTreeNodePlateSub2, optionFControl);

                    this.Panel.Controls.Add(optionFControl);

                    //
                    for (int iIndex2 = 0; iIndex2 < plateInfo.VarietyInfos.Length; iIndex2++)
                    {
                        VarietyInfo varietyInfo = plateInfo.VarietyInfos[iIndex2];

                        TreeNode newTreeNodePlateSub3 = new TreeNode(varietyInfo.Name);
                        newTreeNodePlate.Nodes.Add(newTreeNodePlateSub3);

                        OptionCControl optionCControlSub3 = new OptionCControl {
                            Dock = DockStyle.Fill, Visible = false
                        };

                        this.m_AllOptionControlInfo.Add(newTreeNodePlateSub3, optionCControlSub3);

                        this.Panel.Controls.Add(optionCControlSub3);

                        for (int iIndex3 = 0; iIndex3 < varietyInfo.FileInfos.Length; iIndex3++)
                        {
                            Demo.Stock.X.Common.FileInfo fileInfo = varietyInfo.FileInfos[iIndex3];

                            StockManager stockManager = GlobalStockManager.GetStockManagerByPlateAndVariety(plateInfo.Name, varietyInfo.Name);
                            StockInfo    stockInfo    = stockManager.GetStockDataByStockCode(fileInfo.StockName + "[" + fileInfo.StockSymbol + "]");

                            ListViewItem listViewItem = new ListViewItem(stockInfo.StockName, 0);
                            listViewItem.SubItems.Add(stockInfo.StockSymbol);
                            listViewItem.SubItems.Add(stockInfo.Periodicity.ToString());
                            listViewItem.SubItems.Add(stockInfo.FirstDate.ToShortDateString());
                            listViewItem.SubItems.Add(stockInfo.LastDate.ToShortDateString());
                            listViewItem.SubItems.Add(stockInfo.FirstTime.ToLongTimeString());
                            listViewItem.SubItems.Add(stockInfo.LastTime.ToLongTimeString());
                            listViewItem.SubItems.Add(stockInfo.StartTime.ToShortTimeString());
                            listViewItem.SubItems.Add(stockInfo.EndTime.ToShortTimeString());
                            listViewItem.SubItems.Add(stockInfo.CollectionDate.ToShortDateString());

                            optionCControlSub3.ListViewStockInfo.Items.Add(listViewItem);
                        }
                    }

                    this.TreeView.Nodes.Add(newTreeNodePlate);
                }
                //----------------------------------------------

                // 搜索结果
                m_TreeNodeSearch.Nodes.Add(m_TreeNodeSearchSub);

                m_SearchControl         = new OptionDControl();
                m_SearchControl.Dock    = DockStyle.Fill;
                m_SearchControl.Visible = false;

                this.m_AllOptionControlInfo.Add(m_TreeNodeSearch, m_SearchControl);
                this.m_AllOptionControlInfo.Add(m_TreeNodeSearchSub, m_SearchControl);

                this.Panel.Controls.Add(m_SearchControl);

                this.TreeView.Nodes.Add(m_TreeNodeSearch);
                //----------------------------------------------

                this.TreeView.SelectedNode = m_TreeNodeSettingSub;
            }
            this.ResumeLayout(false);
        }
Exemple #5
0
        private void ReloadOptionFormInfo()
        {
            this.SuspendLayout();
            {
                m_AllOptionControlInfo.Clear();
                m_CurrentOptionControl = null;

                List <Control> controlList = new List <Control>();
                foreach (Control control in this.Panel.Controls)
                {
                    if (control != m_SettingControl && control != m_SearchControl)
                    {
                        controlList.Add(control);
                    }
                }

                foreach (Control control in controlList)
                {
                    this.Panel.Controls.Remove(control);
                }

                this.TreeView.Nodes.Clear();

                this.m_AllOptionControlInfo.Add(m_TreeNodeSetting, m_SettingControl);
                this.m_AllOptionControlInfo.Add(m_TreeNodeSettingSub, m_SettingControl);

                this.TreeView.Nodes.Add(m_TreeNodeSetting);

                PlateInfo[] plateInfos = GlobalSetting.PlateInfos;
                for (int iIndex = 0; iIndex < plateInfos.Length; iIndex++)
                {
                    PlateInfo plateInfo = plateInfos[iIndex];

                    TreeNode newTreeNodePlate     = new TreeNode(plateInfo.Name);
                    TreeNode newTreeNodePlateSub  = new TreeNode("常规");
                    TreeNode newTreeNodePlateSub2 = new TreeNode("所有股票");

                    newTreeNodePlate.Nodes.Add(newTreeNodePlateSub);
                    newTreeNodePlate.Nodes.Add(newTreeNodePlateSub2);

                    OptionBControl optionBControl = new OptionBControl {
                        Dock = DockStyle.Fill, Visible = false
                    };

                    this.m_AllOptionControlInfo.Add(newTreeNodePlate, optionBControl);
                    this.m_AllOptionControlInfo.Add(newTreeNodePlateSub, optionBControl);

                    this.Panel.Controls.Add(optionBControl);

                    OptionFControl optionFControl = new OptionFControl {
                        Dock = DockStyle.Fill, Visible = false
                    };

                    this.m_AllOptionControlInfo.Add(newTreeNodePlateSub2, optionFControl);

                    this.Panel.Controls.Add(optionFControl);

                    for (int iIndex2 = 0; iIndex2 < plateInfo.VarietyInfos.Length; iIndex2++)
                    {
                        VarietyInfo varietyInfo = plateInfo.VarietyInfos[iIndex2];

                        TreeNode newTreeNodePlateSub3 = new TreeNode(varietyInfo.Name);
                        newTreeNodePlate.Nodes.Add(newTreeNodePlateSub3);

                        OptionCControl optionCControlSub3 = new OptionCControl {
                            Dock = DockStyle.Fill, Visible = false
                        };

                        this.m_AllOptionControlInfo.Add(newTreeNodePlateSub3, optionCControlSub3);

                        this.Panel.Controls.Add(optionCControlSub3);

                        for (int iIndex3 = 0; iIndex3 < varietyInfo.FileInfos.Length; iIndex3++)
                        {
                            Demo.Stock.X.Common.FileInfo fileInfo = varietyInfo.FileInfos[iIndex3];

                            StockManager stockManager = GlobalStockManager.GetStockManagerByPlateAndVariety(plateInfo.Name, varietyInfo.Name);
                            StockInfo    stockInfo    = stockManager.GetStockDataByStockCode(GlobalSetting.GetStockCode(fileInfo.StockName, fileInfo.StockSymbol));
                            if (stockInfo == null)
                            {
                                continue;
                            }

                            ListViewItem listViewItem = new ListViewItem(stockInfo.StockName, 0);
                            listViewItem.SubItems.Add(stockInfo.StockSymbol);
                            listViewItem.SubItems.Add(stockInfo.Periodicity.ToString());
                            listViewItem.SubItems.Add(stockInfo.FirstDate.ToShortDateString());
                            listViewItem.SubItems.Add(stockInfo.LastDate.ToShortDateString());
                            listViewItem.SubItems.Add(stockInfo.FirstTime.ToLongTimeString());
                            listViewItem.SubItems.Add(stockInfo.LastTime.ToLongTimeString());
                            listViewItem.SubItems.Add(stockInfo.StartTime.ToShortTimeString());
                            listViewItem.SubItems.Add(stockInfo.EndTime.ToShortTimeString());
                            listViewItem.SubItems.Add(stockInfo.CollectionDate.ToShortDateString());

                            optionCControlSub3.ListViewStockInfo.Items.Add(listViewItem);
                        }
                    }

                    this.TreeView.Nodes.Add(newTreeNodePlate);
                }

                // 搜索结果
                this.m_AllOptionControlInfo.Add(m_TreeNodeSearch, m_SearchControl);
                this.m_AllOptionControlInfo.Add(m_TreeNodeSearchSub, m_SearchControl);

                m_TreeNodeSearch.Nodes.Clear();
                m_TreeNodeSearch.Nodes.Add(m_TreeNodeSearchSub);

                this.TreeView.Nodes.Add(m_TreeNodeSearch);

                this.TreeView.SelectedNode = m_TreeNodeSetting;
            }
            this.ResumeLayout(false);
        }