コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="icon"></param>
        protected void SetDefaultIcon(ProgramIcon icon)
        {
            if (!this.Exists)
            {
                throw new Exception("Extension does not exist");
            }

            if (icon != ProgramIcon.None)
            {
                // registryWrapper.Write(this.progId, "DefaultIcon", icon.ToString());

                RegistryKey root   = Registry.ClassesRoot;
                RegistryKey key    = root.OpenSubKey(this.progId, true);
                RegistryKey tmpKey = key.OpenSubKey("DefaultIcon", true);

                if (tmpKey != null)
                {
                    key.DeleteSubKeyTree("DefaultIcon");
                }

                tmpKey = key.CreateSubKey("DefaultIcon");
                tmpKey.SetValue(string.Empty, icon.ToString(), RegistryValueKind.ExpandString);

                ShellNotification.NotifyOfChange();
            }
        }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="icon"></param>
        protected void SetDefaultIcon(ProgramIcon icon)
        {
            if (!this.Exists)
            {
                throw new Exception("Extension does not exist");
            }

            if (icon != ProgramIcon.None)
            {
                registryWrapper.Write(this.progId, "DefaultIcon", icon.ToString());

                ShellNotification.NotifyOfChange();
            }
        }
コード例 #3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="icon"></param>
        protected void SetDefaultIcon(ProgramIcon icon)
        {
            if (!this.Exists)
            throw new Exception("Extension does not exist");

             if (icon != ProgramIcon.None)
             {
             registryWrapper.Write(this.progId + "\\DefaultIcon", "", icon.ToString());

            ShellNotification.NotifyOfChange();
             }
        }
コード例 #4
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="icon"></param>
        protected void SetDefaultIcon(ProgramIcon icon)
        {
            if (!this.Exists)
            throw new Exception("Extension does not exist");

             if (icon != ProgramIcon.None)
             {
            // registryWrapper.Write(this.progId, "DefaultIcon", icon.ToString());

            RegistryKey root = Registry.ClassesRoot;
            RegistryKey key = root.OpenSubKey(this.progId, true);
            RegistryKey tmpKey = key.OpenSubKey("DefaultIcon", true);

            if (tmpKey != null)
            {
                key.DeleteSubKeyTree("DefaultIcon");
            }

            tmpKey = key.CreateSubKey("DefaultIcon");
            tmpKey.SetValue(string.Empty, icon.ToString(), RegistryValueKind.ExpandString);

            ShellNotification.NotifyOfChange();
             }
        }