Esempio n. 1
0
 internal static void Uninstall(string friendlyName)
 {
     Validate.StringNeitherNullNorEmpty(parameter: friendlyName, parameterName: nameof(friendlyName));
     Trace.WriteLine(message: "Uninstalling;");
     Trace.WriteLine(message: " friendlyName='" + friendlyName + "'");
     GetProvidersKey(openForWriting: true).DeleteSubKeyTree(subkey: friendlyName);
     _installedProviders = null;
 }
Esempio n. 2
0
        internal static void Install(
            Type registrarType,
            string friendlyName,
            bool onByDefault,
            string description)
        {
            Validate.ArgumentNotNull(parameter: registrarType, parameterName: nameof(registrarType));
            Validate.StringNeitherNullNorEmpty(parameter: friendlyName, parameterName: nameof(friendlyName));
            Trace.WriteLine(message: "Installing;");
            Trace.WriteLine(message: " friendlyName='" + friendlyName + "'");
            Trace.WriteLine(message: " registrarType='" + registrarType.AssemblyQualifiedName + "'");
            Trace.WriteLine(message: " onByDefault='" + onByDefault + "'");
            Trace.WriteLine(message: " description='" + description);
            var subKey = GetProvidersKey(openForWriting: true).CreateSubKey(subkey: friendlyName, writable: true);

            subKey.SetValue(name: "RegistrarType", value: registrarType.AssemblyQualifiedName);
            subKey.SetValue(name: "OnByDefault", value: onByDefault);
            subKey.SetValue(name: "Description", value: description);
            _installedProviders = null;
        }