Exemplo n.º 1
0
 /// <devdoc>
 /// Raises the ConfigurationChanged event.
 /// </devdoc>
 private void OnConfigurationChanged(object sender, ConfigurationChangedEventArgs args)
 {
     if(ConfigurationChanged != null)
     {
         ConfigurationChanged(sender, args);
     }
 }
Exemplo n.º 2
0
 private void OneConfigurationBuilderConfigurationChanged(object sender, ConfigurationChangedEventArgs e)
 {
     if (ConfigurationChanged != null)
     {
         ConfigurationChanged(this, e);
     }
 }
Exemplo n.º 3
0
 private void OnMetaConfigurationChanged(object sender, ConfigurationChangedEventArgs args)
 {
     LoadMetaConfiguration(args.ConfigurationFile);
     OnConfigurationChanged(sender, args);
 }
Exemplo n.º 4
0
 private void OnExternalConfigurationChanged(object sender, ConfigurationChangedEventArgs args)
 {
     sections.Remove(args.SectionName);
     OnConfigurationChanged(sender, args);
 }
Exemplo n.º 5
0
 /// <summary>
 /// <para>Raises the <seealso cref="ConfigurationChanged"/> event.</para>
 /// </summary>
 /// <param name="e">
 /// <para>A <see cref="ConfigurationChangedEventArgs"/> that contains the event data.</para>
 /// </param>
 protected virtual void OnConfigurationChanged(ConfigurationChangedEventArgs e)
 {
     if (null != ConfigurationChanged)
     {
         ConfigurationChanged(this, e);
     }
 }
Exemplo n.º 6
0
        /// <summary>
        /// <para>
        /// Write configuration for a section to storage.
        /// </para>
        /// </summary>
        /// <param name="sectionName">
        /// <para>The name of the section for the configuration data.</para>
        /// </param>
        /// <param name="configValue">
        /// <para>The configuration value to store.</para>
        /// </param>
        /// <exception cref="ConfigurationException">
        /// <para><paramref name="sectionName"/> is not valid section for this configuration.</para>
        /// <para>- or -</para>
        /// <para>The section data is read only.</para>
        /// <para>- or -</para>
        /// <para>An error occured while reading the configuration to save the data.</para>
        /// </exception>
        public void WriteConfiguration(string sectionName, object configValue)
        {
            ValidateSection(sectionName);
            ConfigurationChangingEventArgs args = CreateConfigurationChangingEventArgs(sectionName, configValue);
            OnConfigurationChanging(args);
            if (!args.Cancel)
            {
                IStorageProviderWriter configStorageWriter = GetConfigurationStorageWriter(sectionName);
                object writeData = GetSerializedDataToWrite(sectionName, configValue);
                ConfigurationWriterActionCommand writerActionCommand = new ConfigurationWriterActionCommand(configStorageWriter, writeData);
                sections.UpdateSection(sectionName, writerActionCommand, configValue);

                ConfigurationChangedEventArgs changedArgs = new ConfigurationChangedEventArgs(configFile.FileName, sectionName);
                OnConfigurationChanged(changedArgs);
            }
        }