Пример #1
0
 private string?ValueFromIndex(int index, IReadOnlyDictionary <string, string> properties)
 {
     if (Keys.Count <= index)
     {
         return(null);
     }
     return(ApplicationProperty.ReadValue(Keys[index], properties));
 }
Пример #2
0
 public List <ExchangeSettings> Load(IReadOnlyDictionary <string, string> properties)
 {
     if (_allExchangeParameters != null && _allExchangeParameters.Count == 0)
     {
         var exchangeParameters = ApplicationProperty.ReadMultipleValues(_exchangeNames, ";", properties).Select(x => new ExchangeSettings(_exchangeName, properties));
         _allExchangeParameters.AddRange(exchangeParameters);
     }
     return(_allExchangeParameters ?? new List <ExchangeSettings>());
 }
Пример #3
0
        public async Task SetApplicationProperty(string property, string value, CancellationToken cancellationToken)
        {
            var applicationProperty = await this.GetItemAsync <ApplicationProperty>(property, cancellationToken);

            if (applicationProperty == null)
            {
                applicationProperty = new ApplicationProperty
                {
                    Property = property,
                };
            }

            applicationProperty.Value = value;

            await this.SaveItemAsync(applicationProperty, cancellationToken);
        }
Пример #4
0
 set => SetValue(ApplicationProperty, value);
Пример #5
0
 private List <ExchangeSettingsItem> RetrieveParameters(IReadOnlyDictionary <string, string> properties) => _keys.Select(key => new ExchangeSettingsItem(key, ApplicationProperty.ReadValue(key, properties) ?? string.Empty)).ToList();