public Instrument_Properties Clone()
{
Instrument_Properties copy = new Instrument_Properties(symbol, instrType);
copy.Symbol = Symbol;
copy.InstrType = InstrType;
copy.Comment = Comment;
copy.Digits = Digits;
copy.LotSize = LotSize;
copy.Spread = Spread;
copy.SwapType = SwapType;
copy.SwapLong = SwapLong;
copy.SwapShort = SwapShort;
copy.CommissionType = CommissionType;
copy.CommissionScope = CommissionScope;
copy.CommissionTime = CommissionTime;
copy.Commission = Commission;
copy.PriceIn = PriceIn;
copy.Slippage = Slippage;
copy.RateToEUR = RateToEUR;
copy.RateToUSD = RateToUSD;
copy.BaseFileName = BaseFileName;
return copy;
}
/// <summary> /// BtnAccept Clicked. /// </summary> void BtnAccept_Click(object sender, EventArgs e) { if (ValidatePropertiesForm()) { SetSelectedInstrument(); if (Instruments.InstrumentList.ContainsKey(instrPropSelectedInstrument.Symbol)) { // The instrument exists. We change it. Instruments.InstrumentList[instrPropSelectedInstrument.Symbol] = instrPropSelectedInstrument.Clone(); } else { // The instrument doesn't exist. We create it. Instruments.InstrumentList.Add(instrPropSelectedInstrument.Symbol, instrPropSelectedInstrument.Clone()); lbxInstruments.Items.Add(instrPropSelectedInstrument.Symbol); bNeedReset = true; } } return; }