System.Configuration.SectionInformation.ProtectSection C# (CSharp) Метод

ProtectSection() публичный Метод

public ProtectSection ( string provider ) : void
provider string
Результат void
		public void ProtectSection (string provider)
		{
			protection_provider = ProtectedConfiguration.GetProvider (provider, true);
		}

Usage Example

Пример #1
0
        void DoDeserializeSection(XmlReader reader)
        {
            reader.MoveToContent();

            string protection_provider = null;
            string config_source       = null;
            string localName;

            while (reader.MoveToNextAttribute())
            {
                localName = reader.LocalName;
                if (localName == "configProtectionProvider")
                {
                    protection_provider = reader.Value;
                }
                else if (localName == "configSource")
                {
                    config_source = reader.Value;
                }
            }

            /* XXX this stuff shouldn't be here */
            {
                if (protection_provider != null)
                {
                    ProtectedConfigurationProvider prov = ProtectedConfiguration.GetProvider(protection_provider, true);
                    XmlDocument doc = new ConfigurationXmlDocument();

                    reader.MoveToElement();

                    doc.Load(new StringReader(reader.ReadInnerXml()));

                    XmlNode n = prov.Decrypt(doc);

                    reader = new XmlNodeReader(n);

                    SectionInformation.ProtectSection(protection_provider);

                    reader.MoveToContent();
                }
            }

            if (config_source != null)
            {
                SectionInformation.ConfigSource = config_source;
            }

            SectionInformation.SetRawXml(RawXml);
            if (SectionHandler == null)
            {
                DeserializeElement(reader, false);
            }
        }