private XmlSerializerTransformerData GetXmlSerializerTransformerData(string sectionName) { TransformerData transformerData = GetTransformerProviderData(sectionName); ArgumentValidation.CheckExpectedType(transformerData, typeof(XmlSerializerTransformerData)); return((XmlSerializerTransformerData)transformerData); }
/// <summary> /// <para>Initializes a new instance of the <see cref="ConfigurationSectionData"/> class with a name, a cache, a storage provider, a data protection provider and a data transformer.</para> /// </summary> /// <param name="name"> /// <para>The name of the section.</para> /// </param> /// <param name="encrypt"> /// <para>Determines if the section is encrypted or not.</para> /// </param> /// <param name="storageProvider"> /// <para>The <see cref="StorageProviderData"/> used for the configuration section.</para> /// </param> /// <param name="transformer"> /// <para>The <see cref="TransformerData"/> used for the section.</para> /// </param> /// <seealso cref="StorageProviderData"/> /// <seealso cref="TransformerData"/> public ConfigurationSectionData(string name, bool encrypt, StorageProviderData storageProvider, TransformerData transformer) { this.name = name; this.encrypt = encrypt; this.storageProvider = storageProvider; this.transformer = transformer; }
protected override Type GetConfigurationType(string sectionName) { TransformerData transformerData = GetTransformerData(sectionName); if (null != transformerData) { string typeName = transformerData.TypeName; return(GetType(typeName)); } return(typeof(NullTransformer)); }
protected override void InitializeConfigurationProvider(string sectionName, IConfigurationProvider provider) { TransformerData transformerData = GetTransformerData(sectionName); // since we could be using a NullTransformer if (transformerData != null) { provider.ConfigurationName = transformerData.Name; } ((ITransformer)provider).CurrentSectionName = sectionName; base.InitializeConfigurationProvider(sectionName, provider); }
/// <summary> /// <para>Initializes a new instance of the <see cref="ConfigurationSectionData"/> class with a name, a cache, a storage provider, a data protection provider and a data transformer.</para> /// </summary> /// <param name="name"> /// <para>The name of the section.</para> /// </param> /// <param name="encrypt"> /// <para>Determines if the section is encrypted or not.</para> /// </param> /// <param name="storageProvider"> /// <para>The <see cref="StorageProviderData"/> used for the configuration section.</para> /// </param> /// <param name="transformer"> /// <para>The <see cref="TransformerData"/> used for the section.</para> /// </param> /// <seealso cref="StorageProviderData"/> /// <seealso cref="TransformerData"/> public ReadOnlyConfigurationSectionData(string name, bool encrypt, StorageProviderData storageProvider, TransformerData transformer) : base(name, encrypt, storageProvider, transformer) { }