Ejemplo n.º 1
0
		public override void Save(SettingsStorage storage)
		{
			base.Save(storage);

			storage.SetValue("PositionsPanel", PositionsPanel.Save());
			storage.SetValue("AlertSettings", AlertBtn.Save());
		}
		/// <summary>
		/// Save settings.
		/// </summary>
		/// <param name="settings">Settings storage.</param>
		public override void Save(SettingsStorage settings)
		{
			base.Save(settings);

			settings.SetValue("ShortSma", ShortSma.Save());
			settings.SetValue("LongSma", LongSma.Save());
		}
		/// <summary>
		/// Сохранить настройки.
		/// </summary>
		/// <param name="storage">Хранилище настроек.</param>
		public override void Save(SettingsStorage storage)
		{
			base.Save(storage);

			storage.SetValue("Address", Address.To<string>());
			storage.SetValue("CustomDateFormat", CustomDateFormat);
		}
Ejemplo n.º 4
0
		/// <summary>
		/// Сохранить настройки.
		/// </summary>
		/// <param name="storage">Хранилище настроек.</param>
		public void Save(SettingsStorage storage)
		{
			storage.SetValue("Rules", Rules);
			storage.SetValue("AlertType", AlertType.To<string>());
			storage.SetValue("Caption", Caption);
			storage.SetValue("Message", Message);
		}
Ejemplo n.º 5
0
		void IPersistable.Save(SettingsStorage storage)
		{
			storage.SetValue(nameof(Address), Address.To<string>());
			storage.SetValue(nameof(Login), Login);
			storage.SetValue(nameof(Password), Password);
			storage.SetValue(nameof(Type), Type.To<string>());
		}
Ejemplo n.º 6
0
		/// <summary>
		/// Сохранить настройки.
		/// </summary>
		/// <param name="settings">Хранилище настроек.</param>
		public override void Save(SettingsStorage settings)
		{
			base.Save(settings);

			settings.SetValue("line1", _line1.Save());
			settings.SetValue("line2", _line2.Save());
		}
		/// <summary>
		/// Сохранить настройки.
		/// </summary>
		/// <param name="storage">Хранилище настроек.</param>
		public override void Save(SettingsStorage storage)
		{
			base.Save(storage);

			storage.SetValue("Login", Login);
			storage.SetValue("Password", Password);
		}
		/// <summary>
		/// Save settings.
		/// </summary>
		/// <param name="storage">Settings storage.</param>
		public override void Save(SettingsStorage storage)
		{
			base.Save(storage);

			storage.SetValue("Key", Key);
			storage.SetValue("Secret", Secret);
		}
Ejemplo n.º 9
0
		public override void Save(SettingsStorage storage)
		{
			base.Save(storage);

			storage.SetValue("SubscribeNews", SubscribeNews);
			storage.SetValue("NewsGrid", NewsGrid.Save());
			storage.SetValue("AlertSettings", AlertBtn.Save());
		}
Ejemplo n.º 10
0
		/// <summary>
		/// Сохранить настройки.
		/// </summary>
		/// <param name="storage">Хранилище настроек.</param>
		public override void Save(SettingsStorage storage)
		{
			base.Save(storage);

			if (Security != null)
				storage.SetValue("Security", Security.Id);

			if (Portfolio != null)
				storage.SetValue("Portfolio", Portfolio.Name);
		}
Ejemplo n.º 11
0
		/// <summary>
		/// Save settings.
		/// </summary>
		/// <param name="storage">Settings storage.</param>
		public void Save(SettingsStorage storage)
		{
			if (_alertSchema == null)
				return;

			storage.SetValue("AlertSchema", _alertSchema.Save());
		}
Ejemplo n.º 12
0
		public override void Save(SettingsStorage storage)
		{
			var values = InnerPortfolios
				.Select(p => new KeyValuePair<string, decimal>(p.Key.Name, p.Value))
				.ToArray();

			storage.SetValue("InnerPortfolios", values);
		}
Ejemplo n.º 13
0
 /// <summary>
 /// Save settings.
 /// </summary>
 /// <param name="storage">Storage.</param>
 public void Save(SettingsStorage storage)
 {
     storage.SetValue(nameof(CalculateNegative), CalculateNegative);
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Save settings.
 /// </summary>
 /// <param name="storage">Settings storage.</param>
 public void Save(SettingsStorage storage)
 {
     storage.SetValue(_propKey, Property.ToStorage(false));
     storage.SetValue(nameof(ExtraField), ExtraField);
 }
Ejemplo n.º 15
0
        void IPersistable.Save(SettingsStorage storage)
        {
            storage.SetValue(nameof(TemplateTxtDepth), TemplateTxtDepth);
            storage.SetValue(nameof(TemplateTxtTick), TemplateTxtTick);
            storage.SetValue(nameof(TemplateTxtCandle), TemplateTxtCandle);
            storage.SetValue(nameof(TemplateTxtLevel1), TemplateTxtLevel1);
            storage.SetValue(nameof(TemplateTxtOptions), TemplateTxtOptions);
            storage.SetValue(nameof(TemplateTxtOrderLog), TemplateTxtOrderLog);
            storage.SetValue(nameof(TemplateTxtTransaction), TemplateTxtTransaction);
            storage.SetValue(nameof(TemplateTxtSecurity), TemplateTxtSecurity);
            storage.SetValue(nameof(TemplateTxtNews), TemplateTxtNews);
            storage.SetValue(nameof(TemplateTxtBoard), TemplateTxtBoard);
            storage.SetValue(nameof(TemplateTxtIndicator), TemplateTxtIndicator);
            storage.SetValue(nameof(TemplateTxtPositionChange), TemplateTxtPositionChange);

            storage.SetValue(nameof(DoNotShowAgain), DoNotShowAgain);
        }
Ejemplo n.º 16
0
 /// <summary>
 /// Save settings.
 /// </summary>
 /// <param name="storage">Settings storage.</param>
 public void Save(SettingsStorage storage)
 {
     storage.SetValue(nameof(Account), Account);
     storage.SetValue(nameof(AccountName), AccountName);
     storage.SetValue(nameof(Name), Name);
     storage.SetValue(nameof(Address), Address);
     storage.SetValue(nameof(Country), Country);
     storage.SetValue(nameof(City), City);
     storage.SetValue(nameof(Bic), Bic);
     storage.SetValue(nameof(Swift), Swift);
     storage.SetValue(nameof(Iban), Iban);
     storage.SetValue(nameof(PostalCode), PostalCode);
     storage.SetValue(nameof(Currency), Currency);
 }
Ejemplo n.º 17
0
		/// <summary>
		/// Save settings.
		/// </summary>
		/// <param name="storage">Settings storage.</param>
		public void Save(SettingsStorage storage)
		{
			storage.SetValue("ErrorsGrid", ErrorsGrid.Save());
			storage.SetValue("Layout", DockSite.SaveLayout(true));
		}
Ejemplo n.º 18
0
            void IPersistable.Save(SettingsStorage storage)
            {
                storage.SetValue("Year", Year);
                storage.SetValue("Trader", Trader);

                if (From != null)
                    storage.SetValue("From", From);

                if (To != null)
                    storage.SetValue("To", To);

                storage.SetValue("Security1", Security1);
                storage.SetValue("Security2", Security2);
                storage.SetValue("Security3", Security3);
                storage.SetValue("Security4", Security4);
                storage.SetValue("TimeFrame", TimeFrame);
            }
Ejemplo n.º 19
0
        /// <summary>
        /// Save settings.
        /// </summary>
        /// <param name="storage">Storage.</param>
        public override void Save(SettingsStorage storage)
        {
            base.Save(storage);

            storage.SetValue(nameof(Slippage), Slippage);
        }
Ejemplo n.º 20
0
        /// <summary>
        /// Save settings.
        /// </summary>
        /// <param name="storage">Storage.</param>
        public override void Save(SettingsStorage storage)
        {
            base.Save(storage);

            storage.SetValue(nameof(Commission), Commission);
        }
Ejemplo n.º 21
0
        /// <summary>
        /// Save settings.
        /// </summary>
        /// <param name="storage">Storage.</param>
        public override void Save(SettingsStorage storage)
        {
            base.Save(storage);

            storage.SetValue(nameof(Position), Position);
        }
Ejemplo n.º 22
0
 /// <summary>
 /// Save settings.
 /// </summary>
 /// <param name="storage">Settings storage.</param>
 public virtual void Save(SettingsStorage storage)
 {
     storage.SetValue(nameof(Path), Path);
 }
Ejemplo n.º 23
0
 /// <summary>
 /// Save settings.
 /// </summary>
 /// <param name="storage">Settings storage.</param>
 public void Save(SettingsStorage storage)
 {
     storage.SetValue("IsObjectTracking", IsObjectTracking);
     storage.SetValue("ThrowOnRemoveDeleted", ThrowOnRemoveDeleted);
     storage.SetValue("IsTraceObjects", IsTraceObjects);
 }
Ejemplo n.º 24
0
 void IPersistable.Save(SettingsStorage storage)
 {
     storage.SetValue("CodePanel", CodePanel.Save());
 }
Ejemplo n.º 25
0
 void IPersistable.Save(SettingsStorage storage)
 {
     storage.SetValue("DiagramEditor", DiagramEditor.Save());
     storage.SetValue("Layout", DockSite.SaveLayout(true));
 }
Ejemplo n.º 26
0
		public override void Save(SettingsStorage storage)
		{
			storage.SetValue("GridSettings", TradesGrid.Save());
			storage.SetValue("Securities", _securityIds.ToArray());
			storage.SetValue("AlertSettings", AlertBtn.Save());
			storage.SetValue("VolumeFilter", VolumeFilter.Value);
		}
Ejemplo n.º 27
0
		void IPersistable.Save(SettingsStorage storage)
		{
			storage.SetValue("DataType", DataType.GetTypeName(false));
			storage.SetValue("ExecutionType", ExecutionType.To<string>());
			storage.SetValue("Fields", _fields.Select(f => f.Save()).ToArray());
			storage.SetValue("Settings", _settings.Save());
		}
Ejemplo n.º 28
0
        /// <summary>
        /// Save settings.
        /// </summary>
        /// <param name="storage">Storage.</param>
        public override void Save(SettingsStorage storage)
        {
            base.Save(storage);

            storage.SetValue(nameof(Volume), Volume);
        }
			void IPersistable.Save(SettingsStorage storage)
			{
				storage.SetValue("ValueFile", ValueFile);
				storage.SetValue("ValueStockSharp", ValueStockSharp);
			}
Ejemplo n.º 30
0
 /// <summary>
 /// Save settings.
 /// </summary>
 /// <param name="storage">Storage.</param>
 public virtual void Save(SettingsStorage storage)
 {
     storage.SetValue(nameof(Action), Action.To <string>());
 }
Ejemplo n.º 31
0
 /// <summary>
 /// Save settings.
 /// </summary>
 /// <param name="settings">Settings storage.</param>
 public override void Save(SettingsStorage settings)
 {
     base.Save(settings);
     settings.SetValue("Deviation", Deviation);
 }
Ejemplo n.º 32
0
 /// <summary>
 /// Save settings.
 /// </summary>
 /// <param name="settings">Settings storage.</param>
 public override void Save(SettingsStorage settings)
 {
     base.Save(settings);
     settings.SetValue(nameof(SqrtPeriod), SqrtPeriod);
 }
Ejemplo n.º 33
0
        /// <inheritdoc />
        public override void Save(SettingsStorage storage)
        {
            base.Save(storage);

            storage.SetValue(nameof(MarketEmulator), Settings.Save());
        }
Ejemplo n.º 34
0
		/// <summary>
		/// Save settings.
		/// </summary>
		/// <param name="storage">Settings storage.</param>
		public override void Save(SettingsStorage storage)
		{
			storage.SetValue(nameof(HeartbeatInterval), HeartbeatInterval);
			storage.SetValue(nameof(SupportedMessages), SupportedMessages.Select(t => t.To<string>()).ToArray());
			storage.SetValue(nameof(AssociatedBoardCode), AssociatedBoardCode);

			base.Save(storage);
		}
Ejemplo n.º 35
0
 void IPersistable.Save(SettingsStorage storage)
 {
     storage.SetValue("Layout", DockSite.SaveLayout());
     storage.SetValue("Parameters", _parameters.Select(p => p.Save()).ToArray());
 }
Ejemplo n.º 36
0
		public override void Save(SettingsStorage storage)
		{
			if (Strategy != null)
			{
				storage.SetValue("StrategyContainerId", Strategy.Id);
				storage.SetValue("StrategyInfoId", StrategyInfo.Id);

				if (Strategy.Security != null)
					storage.SetValue("security", _strategy.Security.Id);

				if (Strategy.Portfolio != null)
					storage.SetValue("portfolio", _strategy.Portfolio.Name);

				Strategy.Save(storage);
			}
			else if (_storage != null)
			{
				_storage.ForEach(pair => storage.SetValue(pair.Key, pair.Value));
			}

			if (MarketDataSettings != null)
				storage.SetValue("MarketDataSettings", MarketDataSettings.Id.To<string>());

			storage.SetValue("HistoryDaysCount", HistoryDaysCount);
		}
Ejemplo n.º 37
0
		/// <summary>
		/// Save settings.
		/// </summary>
		/// <param name="storage">Settings storage.</param>
		public virtual void Save(SettingsStorage storage)
		{
			storage.SetValue("DateFormat", DateFormat);
			storage.SetValue("TimeFormat", TimeFormat);
		}
Ejemplo n.º 38
0
			public void Save(SettingsStorage storage)
			{
				storage.SetValue("Name", Name);
				storage.SetValue("Type", Type.GetTypeName(false));
				storage.SetValue("IsEnabled", IsEnabled);
				storage.SetValue("From", From);
				storage.SetValue("To", To);
				storage.SetValue("Step", Step);
			}
Ejemplo n.º 39
0
 /// <summary>
 /// Save settings.
 /// </summary>
 /// <param name="storage">Settings storage.</param>
 public virtual void Save(SettingsStorage storage)
 {
     storage.SetValue("DateFormat", DateFormat);
     storage.SetValue("TimeFormat", TimeFormat);
 }
Ejemplo n.º 40
0
 /// <summary>
 /// Сохранить настройки.
 /// </summary>
 /// <param name="storage">Хранилище настроек.</param>
 public void Save(SettingsStorage storage)
 {
     storage.SetValue("LogControl", LogCtrl.Save());
 }
Ejemplo n.º 41
0
		/// <summary>
		/// Сохранить настройки.
		/// </summary>
		/// <param name="storage">Хранилище настроек.</param>
		public void Save(SettingsStorage storage)
		{
			storage.SetValue("TemplateTxtDepth", TemplateTxtDepth);
			storage.SetValue("TemplateTxtTick", TemplateTxtTick);
			storage.SetValue("TemplateTxtCandle", TemplateTxtCandle);
			storage.SetValue("TemplateTxtLevel1", TemplateTxtLevel1);
			storage.SetValue("TemplateTxtOrderLog", TemplateTxtOrderLog);
			storage.SetValue("TemplateTxtTransaction", TemplateTxtTransaction);
			storage.SetValue("TemplateTxtSecurity", TemplateTxtSecurity);
			storage.SetValue("TemplateTxtNews", TemplateTxtNews);
		}
Ejemplo n.º 42
0
 /// <summary>
 /// Save settings.
 /// </summary>
 /// <param name="storage">Settings storage.</param>
 public void Save(SettingsStorage storage)
 {
     storage.SetValue("SecurityCodeLike", SecurityCodeLike.Text);
     storage.SetValue("Filter", Filter.Clone());
 }
Ejemplo n.º 43
0
		private SettingsStorage GetStatistics()
		{
			var statistics = new SettingsStorage();

			foreach (var parameter in StatisticManager.Parameters)
				statistics.SetValue(parameter.Name, parameter.Save());

			return statistics;
		}
Ejemplo n.º 44
0
 /// <summary>
 /// Save settings.
 /// </summary>
 /// <param name="storage">Settings storage.</param>
 public virtual void Save(SettingsStorage storage)
 {
     storage.SetValue("LogLevel", LogLevel.To <string>());
 }
Ejemplo n.º 45
0
		/// <summary>
		/// To save the state of paper trading parameters.
		/// </summary>
		/// <param name="storage">Storage.</param>
		public virtual void Save(SettingsStorage storage)
		{
			storage.SetValue("DepthExpirationTime", DepthExpirationTime);
			storage.SetValue("MatchOnTouch", MatchOnTouch);
			storage.SetValue("Failing", Failing);
			storage.SetValue("Latency", Latency);
			storage.SetValue("IsSupportAtomicReRegister", IsSupportAtomicReRegister);
			storage.SetValue("BufferTime", BufferTime);
			//storage.SetValue("UseCandlesTimeFrame", UseCandlesTimeFrame);
			storage.SetValue("InitialOrderId", InitialOrderId);
			storage.SetValue("InitialTradeId", InitialTradeId);
			storage.SetValue("InitialTransactionId", InitialTransactionId);
			storage.SetValue("SpreadSize", SpreadSize);
			storage.SetValue("MaxDepth", MaxDepth);
			storage.SetValue("VolumeMultiplier", VolumeMultiplier);
			storage.SetValue("PortfolioRecalcInterval", PortfolioRecalcInterval);
			storage.SetValue("ConvertTime", ConvertTime);
			storage.SetValue("PriceLimitOffset", PriceLimitOffset);
			storage.SetValue("IncreaseDepthVolume", IncreaseDepthVolume);

			if (TimeZone != null)
				storage.SetValue("TimeZone", TimeZone.ToSerializedString());
		}
Ejemplo n.º 46
0
 /// <summary>
 /// Save settings.
 /// </summary>
 /// <param name="storage">Settings storage.</param>
 public virtual void Save(SettingsStorage storage)
 {
     storage.SetValue(nameof(Id), Id);
     storage.SetValue(nameof(Name), Name);
 }
		public override void Save(SettingsStorage storage)
		{
			base.Save(storage);

			storage.SetValue("FindedOrderLog", FindedOrderLog.Save());
			storage.SetValue("IsNonSystem", IsNonSystem.IsChecked == true);
		}
Ejemplo n.º 48
0
 /// <summary>
 /// Save settings.
 /// </summary>
 /// <param name="storage">Storage.</param>
 public void Save(SettingsStorage storage)
 {
     storage.SetValue(nameof(Rules), Rules.Select(r => r.SaveEntire(false)).ToArray());
 }
Ejemplo n.º 49
0
		void IPersistable.Save(SettingsStorage storage)
		{
			storage.SetValue("Layout", DockSite.SaveLayout());
			storage.SetValue("Parameters", _parameters.Select(p => p.Save()).ToArray()); 
		}
Ejemplo n.º 50
0
        /// <summary>
        /// Save settings.
        /// </summary>
        /// <param name="storage">Settings storage.</param>
        public override void Save(SettingsStorage storage)
        {
            base.Save(storage);

            storage.SetValue("FileName", FileName);
        }
Ejemplo n.º 51
0
			void IPersistable.Save(SettingsStorage storage)
			{
				storage.SetValue("Path", Path);
				storage.SetValue("ColumnSeparator", ColumnSeparator);
				//storage.SetValue("RowSeparator", RowSeparator);
				storage.SetValue("SkipFromHeader", SkipFromHeader);
				//storage.SetValue("SkipFromFooter", SkipFromFooter);
				storage.SetValue("Format", Format.To<string>());

				if (Drive != null)
					storage.SetValue("Drive", Drive.Path);

				storage.SetValue("TimeZone", TimeZone.Id);
				storage.SetValue("CandleSettings", CandleSettings);
			}
        byte[] ISnapshotSerializer <string, ExecutionMessage> .Serialize(Version version, ExecutionMessage message)
        {
            if (version == null)
            {
                throw new ArgumentNullException(nameof(version));
            }

            if (message == null)
            {
                throw new ArgumentNullException(nameof(message));
            }

            if (message.ExecutionType != ExecutionTypes.Transaction)
            {
                throw new ArgumentOutOfRangeException(nameof(message), message.ExecutionType, LocalizedStrings.Str1695Params.Put(message));
            }

            if (message.TransactionId == 0)
            {
                throw new InvalidOperationException("TransId == 0");
            }

            var snapshot = new TransactionSnapshot
            {
                SecurityId           = message.SecurityId.ToStringId().VerifySize(Sizes.S100),
                PortfolioName        = message.PortfolioName.VerifySize(Sizes.S100),
                LastChangeServerTime = message.ServerTime.To <long>(),
                LastChangeLocalTime  = message.LocalTime.To <long>(),

                //OriginalTransactionId = message.OriginalTransactionId,
                TransactionId = message.TransactionId,

                HasOrderInfo = message.HasOrderInfo,
                HasTradeInfo = message.HasTradeInfo,

                BrokerCode    = message.BrokerCode.VerifySize(Sizes.S100),
                ClientCode    = message.ClientCode.VerifySize(Sizes.S100),
                Comment       = message.Comment.VerifySize(Sizes.S100),
                SystemComment = message.SystemComment.VerifySize(Sizes.S100),
                Currency      = message.Currency == null ? (short?)null : (short)message.Currency.Value,
                DepoName      = message.DepoName.VerifySize(Sizes.S100),
                Error         = (message.Error?.Message).VerifySize(Sizes.S200),
                ExpiryDate    = message.ExpiryDate?.To <long>(),
                //Obsolete1 = message.PortfolioName,
                IsMarketMaker = message.IsMarketMaker == null ? (byte?)null : (byte)(message.IsMarketMaker.Value ? 1 : 0),
                IsMargin      = message.IsMargin == null ? (byte?)null : (byte)(message.IsMargin.Value ? 1 : 0),
                Side          = (byte)message.Side,
                OrderId       = message.OrderId,
                OrderStringId = message.OrderStringId.VerifySize(Sizes.S100),
                OrderBoardId  = message.OrderBoardId.VerifySize(Sizes.S100),
                OrderPrice    = message.OrderPrice,
                OrderVolume   = message.OrderVolume,
                VisibleVolume = message.VisibleVolume,
                OrderType     = message.OrderType == null ? (byte?)null : (byte)message.OrderType.Value,
                OrderState    = message.OrderState == null ? (byte?)null : (byte)message.OrderState.Value,
                OrderStatus   = message.OrderStatus,
                Balance       = message.Balance,
                UserOrderId   = message.UserOrderId.VerifySize(Sizes.S100),
                OriginSide    = message.OriginSide == null ? (byte?)null : (byte)message.OriginSide.Value,
                Latency       = message.Latency?.Ticks,
                PnL           = message.PnL,
                Position      = message.Position,
                Slippage      = message.Slippage,
                Commission    = message.Commission,
                TradePrice    = message.TradePrice,
                TradeVolume   = message.TradeVolume,
                TradeStatus   = message.TradeStatus,
                TradeId       = message.TradeId,
                TradeStringId = message.TradeStringId.VerifySize(Sizes.S100),
                OpenInterest  = message.OpenInterest,
                IsSystem      = message.IsSystem == null ? (byte?)null : (byte)(message.IsSystem.Value ? 1 : 0),
                OrderTif      = message.TimeInForce == null ? (byte?)null : (byte)message.TimeInForce.Value,
                ConditionType = (message.Condition?.GetType().GetTypeName(false)).VerifySize(Sizes.S256),
            };

            var conParams = message.Condition?.Parameters.Where(p => p.Value != null).ToArray() ?? ArrayHelper.Empty <KeyValuePair <string, object> >();

            snapshot.ConditionParamsCount = conParams.Length;

            var paramSize    = (version > SnapshotVersions.V20 ? typeof(TransactionConditionParamV21) : typeof(TransactionConditionParamV20)).SizeOf();
            var snapshotSize = typeof(TransactionSnapshot).SizeOf();

            var result = new List <byte>();

            var buffer = new byte[snapshotSize];

            var ptr = snapshot.StructToPtr();

            Marshal.Copy(ptr, buffer, 0, snapshotSize);
            Marshal.FreeHGlobal(ptr);

            result.AddRange(buffer);

            foreach (var conParam in conParams)
            {
                var paramType = conParam.Value.GetType();

                var paramTypeName = paramType.GetTypeAsString(false);

                dynamic param;

                if (version > SnapshotVersions.V20)
                {
                    param = new TransactionConditionParamV21
                    {
                        ValueTypeLen = paramTypeName.UTF8().Length
                    };
                }
                else
                {
                    param = new TransactionConditionParamV20
                    {
                        ValueType = paramTypeName.VerifySize(Sizes.S256),
                    };
                }

                param.Name = conParam.Key.VerifySize(Sizes.S32);

                byte[] stringValue = null;

                switch (conParam.Value)
                {
                case byte b:
                    param.NumValue = b;
                    break;

                case sbyte sb:
                    param.NumValue = sb;
                    break;

                case int i:
                    param.NumValue = i;
                    break;

                case short s:
                    param.NumValue = s;
                    break;

                case long l:
                    param.NumValue = l;
                    break;

                case uint ui:
                    param.NumValue = ui;
                    break;

                case ushort us:
                    param.NumValue = us;
                    break;

                case ulong ul:
                    param.NumValue = (long)ul;
                    break;

                case DateTimeOffset dto:
                    param.NumValue = dto.To <long>();
                    break;

                case DateTime dt:
                    param.NumValue = dt.To <long>();
                    break;

                case TimeSpan ts:
                    param.NumValue = ts.To <long>();
                    break;

                case float f:
                    param.DecimalValue = (decimal)f;
                    break;

                case double d:
                    param.DecimalValue = (decimal)d;
                    break;

                case decimal dec:
                    param.DecimalValue = dec;
                    break;

                case bool bln:
                    param.BoolValue = bln;
                    break;

                case Enum e:
                    param.NumValue = e.To <long>();
                    break;

                case IRange r:
                {
                    var storage = new SettingsStorage();

                    if (r.HasMinValue)
                    {
                        storage.SetValue(nameof(r.Min), r.Min);
                    }

                    if (r.HasMaxValue)
                    {
                        storage.SetValue(nameof(r.Max), r.Max);
                    }

                    if (storage.Count > 0)
                    {
                        stringValue = new XmlSerializer <SettingsStorage>().Serialize(storage);
                    }

                    break;
                }

                case IPersistable p:
                {
                    var storage = p.Save();

                    if (storage.Count > 0)
                    {
                        stringValue = new XmlSerializer <SettingsStorage>().Serialize(storage);
                    }

                    break;
                }

                default:
                    stringValue = typeof(XmlSerializer <>).MakeGenericType(paramType).CreateInstance <ISerializer>().Serialize(conParam.Value);
                    break;
                }

                if (stringValue != null)
                {
                    param.StringValueLen = stringValue.Length;
                }

                var paramBuff = new byte[paramSize];

                var rowPtr = version > SnapshotVersions.V20 ? ((TransactionConditionParamV21)param).StructToPtr() : ((TransactionConditionParamV20)param).StructToPtr();
                Marshal.Copy(rowPtr, paramBuff, 0, paramSize);
                Marshal.FreeHGlobal(rowPtr);

                result.AddRange(paramBuff);

                if (version > SnapshotVersions.V20)
                {
                    result.AddRange(paramTypeName.UTF8());
                }

                if (stringValue == null)
                {
                    continue;
                }

                result.AddRange(stringValue);
            }

            return(result.ToArray());
        }
Ejemplo n.º 53
0
			void IPersistable.Save(SettingsStorage storage)
			{
				storage.SetValue("Name", Name);
				storage.SetValue("Number", Number);
				storage.SetValue("Values", Values.Select(v => v.Save()).ToArray());
				storage.SetValue("DefaultValue", DefaultValue);
				storage.SetValue("Format", Format);
			}
Ejemplo n.º 54
0
 public void Save(SettingsStorage storage)
 {
     storage.SetValue("EmulationSettings", EmulationSettings.Save());
 }
		public override void Save(SettingsStorage storage)
		{
			storage.SetValue("SecurityPicker", SecurityPicker.Save());
			storage.SetValue("AlertSettings", AlertBtn.Save());
			storage.SetValue("Securities", _securityIds.ToArray());
		}
Ejemplo n.º 56
0
        /// <inheritdoc />
        public override void Save(SettingsStorage storage)
        {
            base.Save(storage);

            storage.SetValue(nameof(OverrideSecurityData), OverrideSecurityData);
        }
Ejemplo n.º 57
0
		/// <summary>
		/// Save settings.
		/// </summary>
		/// <param name="storage">Settings storage.</param>
		public void Save(SettingsStorage storage)
		{
			storage.SetValue("Login", Login);
			storage.SetValue("Password", Password);
			storage.SetValue("AutoLogon", AutoLogon);
		}
Ejemplo n.º 58
0
 /// <summary>
 /// Save settings.
 /// </summary>
 /// <param name="storage">Settings storage.</param>
 public void Save(SettingsStorage storage)
 {
     storage.SetValue(nameof(Periods), Periods.Select(p => p.Save()).ToArray());
     storage.SetValue(nameof(SpecialWorkingDays), SpecialWorkingDays);
     storage.SetValue(nameof(SpecialHolidays), SpecialHolidays);
 }
Ejemplo n.º 59
0
 /// <summary>
 /// Save settings.
 /// </summary>
 /// <param name="settings">Settings storage.</param>
 public override void Save(SettingsStorage settings)
 {
     base.Save(settings);
     settings.SetValue("ReversalAmountType", ReversalAmount.Type);
     settings.SetValue("ReversalAmountValue", ReversalAmount.Value);
 }
Ejemplo n.º 60
0
 /// <summary>
 /// Save settings.
 /// </summary>
 /// <param name="settings">Settings storage.</param>
 public override void Save(SettingsStorage settings)
 {
     base.Save(settings);
     settings.SetValue("Length", Length);
 }