Exemplo n.º 1
0
        /// <summary>
        /// Sets the plug-in settings for the current session.
        /// </summary>
        /// <param name="settings">The plug-in settings.</param>
        /// <exception cref="ArgumentNullException"><paramref name="settings"/> is null.</exception>
        public void SetPluginSettings(PluginSettingsRegistry settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            ReadOnlyDictionary <string, PluginSettingsRegistryItem> persistedValues = settings.PersistedValues;
            ReadOnlyDictionary <string, PluginSettingsRegistryItem> sessionValues   = settings.SessionValues;

            if (persistedValues != null)
            {
                foreach (var item in persistedValues)
                {
                    registry.Add(item.Key, item.Value);
                }
            }

            if (sessionValues != null)
            {
                foreach (var item in sessionValues)
                {
                    registry.Add(item.Key, item.Value);
                }
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Sets the plug-in settings for the current session.
 /// </summary>
 /// <param name="settings">The plug-in settings.</param>
 public void SetPluginSettings(PluginSettingsRegistry settings)
 {
     pluginSettings = settings;
 }