Exemplo n.º 1
0
		public PositionEditCommand(BasePosition position)
		{
			if (position == null)
				throw new ArgumentNullException("position");

			Position = position;
		}
Exemplo n.º 2
0
        /// <summary>
        /// To copy fields of the current position to <paramref name="destination" />.
        /// </summary>
        /// <param name="destination">The position in which you should to copy fields.</param>
        public void CopyTo(BasePosition destination)
        {
            if (destination == null)
            {
                throw new ArgumentNullException(nameof(destination));
            }

            destination.CurrentValue    = CurrentValue;
            destination.BeginValue      = BeginValue;
            destination.BlockedValue    = BlockedValue;
            destination.Commission      = Commission;
            destination.VariationMargin = VariationMargin;
            destination.RealizedPnL     = RealizedPnL;
            destination.UnrealizedPnL   = UnrealizedPnL;
            destination.AveragePrice    = AveragePrice;
            destination.CurrentPrice    = CurrentPrice;
            destination.Description     = Description;
            //destination.LastChangeTime = LastChangeTime;
            //destination.LocalTime = LocalTime;
        }
Exemplo n.º 3
0
			public PositionItem(BasePosition position)
			{
				if (position == null)
					throw new ArgumentNullException(nameof(position));

				Position = position;
				Portfolio = position as Portfolio;

				if (Portfolio == null)
				{
					var pos = (Position)position;

					PortfolioName = pos.Portfolio.Name;
					Name = pos.Security.Id;
					DepoName = pos.DepoName;
					LimitType = pos.LimitType;
					Portfolio = pos.Portfolio;
				}
				else
				{
					PortfolioName = Portfolio.Name;
					Name = LocalizedStrings.Str1543;
				}
			}
Exemplo n.º 4
0
		/// <summary>
		/// To copy fields of the current position to <paramref name="destination" />.
		/// </summary>
		/// <param name="destination">The position in which you should to copy fields.</param>
		public void CopyTo(BasePosition destination)
		{
			if (destination == null)
				throw new ArgumentNullException(nameof(destination));

			destination.CurrentValue = CurrentValue;
			destination.BeginValue = BeginValue;
			destination.BlockedValue = BlockedValue;
			destination.Commission = Commission;
			destination.VariationMargin = VariationMargin;
			destination.RealizedPnL = RealizedPnL;
			destination.UnrealizedPnL = UnrealizedPnL;
			destination.AveragePrice = AveragePrice;
			destination.CurrentPrice = CurrentPrice;
			destination.Description = Description;
			destination.LastChangeTime = LastChangeTime;
			destination.LocalTime = LocalTime;
		}