Ejemplo n.º 1
0
        public static IEnumerable <ShellVerb> GetShellVerbs()
        {
            foreach (string keyName in CommandStoreShell.GetSubKeyNames())
            {
                RegistryKey key = CommandStoreShell.OpenSubKey(keyName);

                ShellVerb verb = ShellVerb.From(key);

                yield return(verb);
            }
        }
Ejemplo n.º 2
0
        public static ShellVerb GetShellVerb(string name)
        {
            ShellVerb verb = null;

            foreach (ShellVerb shellVerb in GetShellVerbs())
            {
                if (shellVerb.Name == name)
                {
                    verb = shellVerb;
                }
            }

            return(verb);
        }
Ejemplo n.º 3
0
        protected override void ProcessRecord()
        {
            if (ParameterSetName == "ByName")
            {
                string value = DynamicParameters["Name"].Value.ToString();

                ShellVerb verb = RegistryHelper.GetShellVerb(value);

                if (Properties)
                {
                    WriteObject(verb.Properties);
                }
                else
                {
                    WriteObject(verb);
                }
            }
            else
            {
                WriteObject(RegistryHelper.GetShellVerbs(), true);
            }
        }