コード例 #1
0
        /// <summary>
        /// Sets a value that determines numerous shell options for extension as well as limitations on how extension properties can be edited by programs that honor <see cref="EditFlags"/>
        /// </summary>
        /// <param name="flags"><see cref="EditFlags"/> for program file type.</param>
        protected void SetEditFlags(EditFlags flags)
        {
            if (!this.Exists)
            {
                throw new Exception("Extension does not exist");
            }

            //registryWrapper.Write(info.progId, "EditFlags", (uint)flags);
            registryWrapper.Write(this.progId, "EditFlags", flags);

            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>
        /// Sets a value that indicates the filter component that is used to search for text within documents of this type.
        /// </summary>
        /// <param name="file"><see cref="FileAssociationInfo"/> that provides specifics of the extension to be changed.</param>
        /// <param name="persistentHandler">Guid of filter component.</param>
        protected void SetPersistentHandler(FileAssociationInfo file, Guid persistentHandler)
        {
            if (!file.Exists)
            {
                throw new Exception("Extension does not exist");
            }

            if (persistentHandler == Guid.Empty)
            {
                return;
            }

            _registryWrapper.Write(file._extension + "\\" + PersistentHandler, string.Empty, persistentHandler);

            ShellNotification.NotifyOfChange();
        }
コード例 #4
0
        /// <summary>
        /// Sets a value that determines if the file's extension will always be shown.
        /// </summary>
        /// <param name="value">Value that specifies if the file's extension should be always displayed.</param>
        protected void SetAlwaysShowExt(bool value)
        {
            if (!this.Exists)
            {
                throw new Exception("Extension does not exist");
            }

            if (value)
            {
                registryWrapper.Write(this.progId, "AlwaysShowExt", string.Empty);
            }
            else
            {
                registryWrapper.Delete(this.progId, "AlwaysShowExt");
            }

            ShellNotification.NotifyOfChange();
        }