RegistryConfigurationProvider.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / Tools / WSATConfig / Configuration / RegistryConfigurationProvider.cs / 1305376 / RegistryConfigurationProvider.cs

                            //------------------------------------------------------------------------------ 
// Copyright (c) Microsoft Corporation.  All rights reserved.
//-----------------------------------------------------------------------------

namespace Microsoft.Tools.ServiceModel.WsatConfig 
{
    using System; 
    using System.IO; 
    using System.Management;
    using System.Runtime.InteropServices; 
    using Microsoft.Win32;

    class RegistryConfigurationProvider : ConfigurationProvider
    { 
        StdRegProviderWrapper stdRegProvider = null;
 
        internal RegistryConfigurationProvider(RegistryHive remoteHive, string subKey, string machineName) 
        {
            stdRegProvider = new StdRegProviderWrapper(remoteHive, subKey, machineName); 
        }

        RegistryConfigurationProvider(StdRegProviderWrapper stdRegProvider)
        { 
            this.stdRegProvider = stdRegProvider;
        } 
 
        internal override ConfigurationProvider OpenKey(string subKey)
        { 
            StdRegProviderWrapper subRegWrapper = stdRegProvider.OpenKey(subKey);
            return new RegistryConfigurationProvider(subRegWrapper);
        }
 
        internal override uint ReadUInt32(string name, uint defaultValue)
        { 
            return stdRegProvider.ReadUInt32(name, defaultValue); 
        }
 
        internal override string ReadString(string name, string defaultValue)
        {
            return stdRegProvider.ReadString(name, defaultValue);
        } 

        internal override string[] ReadMultiString(string name, string[] defaultValue) 
        { 
            return stdRegProvider.ReadMultiString(name, defaultValue);
        } 

        internal override void WriteUInt32(string name, uint value)
        {
            stdRegProvider.WriteUInt32(name, value); 
        }
 
        internal override void WriteString(string name, string value) 
        {
            stdRegProvider.WriteString(name, value); 
        }

        internal override void WriteMultiString(string name, string[] value)
        { 
            stdRegProvider.WriteMultiString(name, value);
        } 
 
        internal override void AdjustRegKeyPermission()
        { 
            stdRegProvider.AdjustRegKeyPermission();
        }

        public override void Dispose() 
        {
            if(stdRegProvider != null) 
            { 
                stdRegProvider.Dispose();
                stdRegProvider = null; 
            }
        }
    }
} 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK