示例#1
0
        /// <summary>
        /// Saves all feature properties to the storage.
        /// </summary>
        private bool Save(KnownFeature feature)
        {
            if (!_options.ContainsKey(feature))
            {
                return(false);
            }

            if (_deletedOptions.ContainsKey(feature))
            {
                var options = _options[feature];

                foreach (var deleted in _deletedOptions[feature])
                {
                    if (options.ContainsKey(deleted))
                    {
                        options.Remove(deleted);
                    }
                }
            }

            _optionsPersistenceService.SaveOptions(feature, _options[feature]);
            _log.LogMessage($"Options saved: {feature.GetDescription()}", LOG_CATEGORY);

            return(true);
        }
示例#2
0
 /// <summary>
 /// Custom: logs feature message and exception.
 /// </summary>
 public static void LogMessage(this ILog log, KnownFeature feature, string message, Exception ex)
 {
     log.LogMessage(message, ex, feature.GetDescription());
 }
示例#3
0
 /// <summary>
 /// Returns feature friendly name.
 /// </summary>
 /// <param name="feature">Feature.</param>
 /// <returns>Feature name.</returns>
 public string GetFeatureName(KnownFeature feature)
 {
     return(feature.GetDescription());
 }