Forex_Strategy_Builder.Instrument_Properties.Clone C# (CSharp) Method

Clone() public method

Clones the Instrument_Properties.
public Clone ( ) : Instrument_Properties
return Instrument_Properties
        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;
        }

Usage Example

        /// <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;
        }
All Usage Examples Of Forex_Strategy_Builder.Instrument_Properties::Clone
Instrument_Properties