Пример #1
0
        /// <summary>
        /// Deletes a Windows Registry key.
        /// </summary>
        /// <param name="reg"></param>
        /// <param name="root">The Windows Registry hive to use. See <see cref="WindowsRegistryRoot"/> for available options. Example: WindowsRegistryRoot.HKEY_LOCAL_MACHINE</param>
        /// <param name="key">Name of the key you want to delete. Example: SOFTWARE\ConDep</param>
        /// <returns></returns>
        public static IOfferWindowsRegistryOperations DeleteKey(this IOfferWindowsRegistryOperations reg, WindowsRegistryRoot root, string key)
        {
            var op         = new DeleteWindowsRegistryKeyOperation(root, key);
            var regBuilder = reg as WindowsRegistryBuilder;

            OperationExecutor.Execute((RemoteBuilder)reg, op);
            return(reg);
        }
Пример #2
0
        /// <summary>
        /// Deletes a Windows Registry key.
        /// </summary>
        /// <param name="reg"></param>
        /// <param name="root">The Windows Registry hive to use. See <see cref="WindowsRegistryRoot"/> for available options. Example: WindowsRegistryRoot.HKEY_LOCAL_MACHINE</param>
        /// <param name="key">Name of the key you want to delete. Example: SOFTWARE\ConDep</param>
        /// <returns></returns>
        public static IOfferWindowsRegistryOperations DeleteKey(this IOfferWindowsRegistryOperations reg, WindowsRegistryRoot root, string key)
        {
            var op         = new DeleteWindowsRegistryKeyOperation(root, key);
            var regBuilder = reg as WindowsRegistryBuilder;

            Configure.Operation(regBuilder.RemoteConfigurationBuilder, op);
            return(reg);
        }