예제 #1
0
        /// <summary>
        /// Removed the additional info from the registry that allowed the shell to discover the shell extension.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="description">The description.</param>
        /// <param name="progId">The name.</param>
        protected static void ComUnregister(Type type, string description, string progId)
        {
            if (progId == null)
            {
                throw new ArgumentNullException(nameof(progId));
            }

            RegistryExtensions.RemoveAsApprovedShellExtension(type);

            using (var key = Registry.ClassesRoot.OpenSubKey(progId + @"\ShellEx\PropertySheetHandlers\", true))
            {
                key?.DeleteSubKey(description, false);
            }
        }
예제 #2
0
        /// <summary>
        /// Removed the additional info from the registry that allowed the shell to discover the shell extension.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="name">The name.</param>
        protected static void ComUnregister(Type type, string name)
        {
            Contract.Requires(type != null);
            Contract.Requires(!string.IsNullOrEmpty(name));

            RegistryExtensions.RemoveAsApprovedShellExtension(type);

            var keyName = @"Directory\ShellEx\CopyHookHandlers\" + name;

            using (var key = Registry.ClassesRoot.OpenSubKey(keyName, true))
            {
                key?.DeleteValue(type.GUID.ToString("B"), false);
            }
        }
예제 #3
0
        /// <summary>
        /// Removed the additional info from the registry that allowed the shell to discover the shell extension.
        /// </summary>
        /// <remarks>
        /// This function will only remove the COM registration from the specific ContextMenu. To prevent breaking
        /// other COM registrations other shell extensions are left untouched.
        /// It may be required to also remove the ProgID, this should be done in a separate method.
        /// </remarks>
        /// <param name="type">The type.</param>
        /// <param name="description">The description.</param>
        /// <param name="progId">The prog id.</param>
        protected static void ComUnregister(Type type, string description, string progId)
        {
            Contract.Requires(type != null);
            Contract.Requires(!string.IsNullOrEmpty(description));
            Contract.Requires(!string.IsNullOrEmpty(progId));

            // Remove the ContextMenu COM registration.
            // Leave the 'ContextMenuHandlers' subkey intact, other handlers may also be installed.
            using (var contextMenuHandlersKey = Registry.ClassesRoot.OpenSubKey(progId + @"\ShellEx\ContextMenuHandlers", true))
            {
                contextMenuHandlersKey?.DeleteSubKey(description, false);
            }

            RegistryExtensions.RemoveAsApprovedShellExtension(type);
        }
예제 #4
0
        /// <summary>
        /// Removed the additional info from the registry that allowed the shell to discover the shell extension.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="description">The description.</param>
        /// <param name="progId">The name.</param>
        protected static void ComUnregister(Type type, string description, string progId)
        {
            Contract.Requires(type != null);
            Contract.Requires(!string.IsNullOrEmpty(description));
            Contract.Requires(!string.IsNullOrEmpty(progId));

            RegistryExtensions.RemoveAsApprovedShellExtension(type);

            using (var key = Registry.ClassesRoot.OpenSubKey(progId + @"\ShellEx\PropertySheetHandlers\", true))
            {
                if (key != null)
                {
                    key.DeleteSubKey(description, false);
                }
            }
        }
예제 #5
0
        /// <summary>
        /// Removed the additional info from the registry that allowed the shell to discover the shell extension.
        /// </summary>
        /// <param name="type">The type.</param>
        protected static void ComUnregister(Type type)
        {
            if (type == null)
            {
                throw new ArgumentNullException(nameof(type));
            }

            // Only try to remove when it was registered.
            if (IsShell60OrHigher())
            {
                return;
            }

            using (var key = Registry.ClassesRoot.OpenSubKey(ColumnHandlersKeyName, true))
            {
                key?.DeleteSubKey(type.GUID.ToString("B"), false);
            }

            RegistryExtensions.RemoveAsApprovedShellExtension(type);
        }
예제 #6
0
        /// <summary>
        /// Removed the additional info from the registry that allowed the shell to discover the shell extension.
        /// </summary>
        /// <param name="type">The type.</param>
        protected static void ComUnregister(Type type)
        {
            Contract.Requires(type != null);

            // Only try to remove when it was registered.
            if (IsShell60OrHigher())
            {
                return;
            }

            using (var key = Registry.ClassesRoot.OpenSubKey(ColumnHandlersKeyName, true))
            {
                if (key != null)
                {
                    key.DeleteSubKey(type.GUID.ToString("B"), false);
                }
            }

            RegistryExtensions.RemoveAsApprovedShellExtension(type);
        }
예제 #7
0
 /// <summary>
 /// Removed the additional info from the registry that allowed the shell to discover the shell extension.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <param name="progId">The prog id.</param>
 protected static void ComUnregister(Type type, string progId)
 {
     RegistryExtensions.RemoveAsApprovedShellExtension(type);
 }
예제 #8
0
 /// <summary>
 /// Removed the additional info from the registry that allowed the shell to discover the shell extension.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <param name="progId">The prog id.</param>
 protected static void ComUnregister(Type type, string progId)
 {
     Contract.Requires(type != null);
     RegistryExtensions.RemoveAsApprovedShellExtension(type);
 }