public object Clone() { CSymbolPro re = new CSymbolPro(); re.mSymbolName = mSymbolName; re.mSymbolTypeName = mSymbolTypeName; re.mTickVal = mTickVal; re.mTickSize = mTickSize; re.mContractSize = mContractSize; re.mMinVol = mMinVol; re.mMaxVol = mMaxVol; re.mStepVol = mStepVol; return(re); }
public void addNewSymbol(CSymbolPro symbol) { TreeNode curSelNode = treeView1.SelectedNode; string nodeName = curSelNode.Text; if (curSelNode != null) { symbol.mSymbolTypeName = nodeName; curSelNode.Nodes.Add(symbol.mSymbolName); curSelNode.ExpandAll(); mSymbolList.Add(symbol); } }
private void button1_Click(object sender, EventArgs e) { CSymbolPro s = new CSymbolPro(); s.mContractSize = double.Parse(textBox4_contractSize.Text.Trim()); s.mMaxVol = double.Parse(textBox6_maxVol.Text.Trim()); s.mMinVol = double.Parse(textBox5_minVol.Text.Trim()); s.mStepVol = double.Parse(textBox7_minStepVol.Text.Trim()); s.mSymbolName = textBox1_symbolName.Text.Trim(); s.mTickSize = double.Parse(textBox2_tickSize.Text.Trim()); s.mTickVal = double.Parse(textBox3_tickValue.Text.Trim()); mParent.addNewSymbol(s); Close(); }
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) { if (e.Node.Parent != null) { if (mSymbolList.Exists(i => i.mSymbolName == e.Node.Text)) { CSymbolPro sp = mSymbolList.First(i => i.mSymbolName == e.Node.Text); textBox1_symbolName.Text = sp.mSymbolName; textBox2_tickSize.Text = sp.mTickSize.ToString(); textBox3_tickValue.Text = sp.mTickVal.ToString(); textBox4_contractSize.Text = sp.mContractSize.ToString(); textBox5_minVol.Text = sp.mMinVol.ToString(); textBox6_maxVol.Text = sp.mMaxVol.ToString(); textBox7_minStepVol.Text = sp.mStepVol.ToString(); } } }
private void button1_saveSymbolPro_Click(object sender, EventArgs e) { if (treeView1.SelectedNode.Parent != null) { if (mSymbolList.Exists(i => i.mSymbolName == textBox1_symbolName.Text)) { CSymbolPro sp = mSymbolList.First(i => i.mSymbolName == textBox1_symbolName.Text); sp.mContractSize = double.Parse(textBox4_contractSize.Text.Trim()); sp.mMaxVol = double.Parse(textBox6_maxVol.Text.Trim()); sp.mMinVol = double.Parse(textBox5_minVol.Text.Trim()); sp.mStepVol = double.Parse(textBox7_minStepVol.Text.Trim()); sp.mSymbolName = textBox1_symbolName.Text.Trim(); sp.mTickSize = double.Parse(textBox2_tickSize.Text.Trim()); sp.mTickVal = double.Parse(textBox3_tickValue.Text.Trim()); } saveSymbol(); MessageBox.Show("保存成功"); } }