Example #1
0
 private string?ValueFromIndex(int index, IReadOnlyDictionary <string, string> properties)
 {
     if (Keys.Count <= index)
     {
         return(null);
     }
     return(ApplicationProperty.ReadValue(Keys[index], properties));
 }
Example #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>());
 }
Example #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);
        }
Example #4
0
 set => SetValue(ApplicationProperty, value);
Example #5
0
 private List <ExchangeSettingsItem> RetrieveParameters(IReadOnlyDictionary <string, string> properties) => _keys.Select(key => new ExchangeSettingsItem(key, ApplicationProperty.ReadValue(key, properties) ?? string.Empty)).ToList();