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 ); }
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); }