Beispiel #1
0
        /// <summary>
        /// Скопировать поля текущего инструмента в <paramref name="destination"/>.
        /// </summary>
        /// <param name="destination">Инструмент, в который необходимо скопировать поля.</param>
        public void CopyTo(Security destination)
        {
            if (destination == null)
            {
                throw new ArgumentNullException("destination");
            }

            destination.Id                   = Id;
            destination.Name                 = Name;
            destination.Type                 = Type;
            destination.Code                 = Code;
            destination.Class                = Class;
            destination.ShortName            = ShortName;
            destination.VolumeStep           = VolumeStep;
            destination.Multiplier           = Multiplier;
            destination.PriceStep            = PriceStep;
            destination.Decimals             = Decimals;
            destination.SettlementDate       = SettlementDate;
            destination.Board                = Board;
            destination.ExpiryDate           = ExpiryDate;
            destination.OptionType           = OptionType;
            destination.Strike               = Strike;
            destination.BinaryOptionType     = BinaryOptionType;
            destination.UnderlyingSecurityId = UnderlyingSecurityId;
            destination.ExternalId           = ExternalId.Clone();
            destination.Currency             = Currency;
            destination.StepPrice            = StepPrice;
            destination.LowPrice             = LowPrice;
            destination.HighPrice            = HighPrice;
            destination.ClosePrice           = ClosePrice;
            destination.OpenPrice            = OpenPrice;
            destination.MinPrice             = MinPrice;
            destination.MaxPrice             = MaxPrice;
            destination.State                = State;
            destination.TheorPrice           = TheorPrice;
            destination.ImpliedVolatility    = ImpliedVolatility;
            destination.HistoricalVolatility = HistoricalVolatility;
            destination.MarginBuy            = MarginBuy;
            destination.MarginSell           = MarginSell;
            destination.OpenInterest         = OpenInterest;
            destination.BidsCount            = BidsCount;
            destination.BidsVolume           = BidsVolume;
            destination.AsksCount            = AsksCount;
            destination.AsksVolume           = AsksVolume;

            //if (destination.ExtensionInfo == null)
            //	destination.ExtensionInfo = new SynchronizedDictionary<object, object>();

            //if (LastTrade != null)
            //{
            //	destination.LastTrade = LastTrade.Clone();
            //	destination.LastTrade.Security = destination;
            //}

            //if (BestBid != null)
            //{
            //	destination.BestBid = BestBid.Clone();
            //	destination.BestBid.Security = destination;
            //}

            //if (BestAsk != null)
            //{
            //	destination.BestAsk = BestAsk.Clone();
            //	destination.BestAsk.Security = destination;
            //}
        }