FileAssociation/ProgramAssociationInfo.cs
/// <summary>
/// Gets an array of <see cref="ProgramVerb"/> that define the verbs supported by this ProgID.
/// </summary>
/// <returns>Array of <see cref="ProgramVerb"/> that contains supported verbs.</returns>
Gets an array of  that define the verbs supported by this ProgID.
Gets an array of that define the verbs supported by this ProgID .
protected ProgramVerb[] GetVerbs()
      {
         if (!this.Exists)
            throw new Exception("Extension does not exist");
         RegistryKey root = RegistryWrapper.ClassesRoot;
         RegistryKey key = root.OpenSubKey(this.progId);
         List<ProgramVerb> verbs = new List<ProgramVerb>();
         key = key.OpenSubKey("shell", false);
         if (key != null)
         {
            string[] keyNames = key.GetSubKeyNames();
            foreach (string s in keyNames)
            {
               RegistryKey verb = key.OpenSubKey(s);
               if (verb == null)
                  continue;
               verb = verb.OpenSubKey("command");
               if (verb == null)
                  continue;
               string command = (string)verb.GetValue("", "", RegistryValueOptions.DoNotExpandEnvironmentNames);
               verbs.Add(new ProgramVerb(s, command));
            }
            key.Close();
         }
         root.Close();
         return verbs.ToArray();
      }
protected ProgramVerb [ ] GetVerbs ( ) { if ( ! this . Exists ) throw new Exception ( " " ) ; RegistryKey root = RegistryWrapper . ClassesRoot ; RegistryKey key = root . OpenSubKey ( this . progId ) ; List < ProgramVerb > verbs = new List < ProgramVerb > ( ) ; key = key . OpenSubKey ( " " , false ) ; if ( key != null ) { string [ ] keyNames = key . GetSubKeyNames ( ) ; foreach ( string s in keyNames ) { RegistryKey verb = key . OpenSubKey ( s ) ; if ( verb == null ) continue ; verb = verb . OpenSubKey ( " " ) ; if ( verb == null ) continue ; string command = ( string ) verb . GetValue ( " " , " " , RegistryValueOptions . DoNotExpandEnvironmentNames ) ; verbs . Add ( new ProgramVerb ( s , command ) ) ; } key . Close ( ) ; } root . Close ( ) ; return verbs . ToArray ( ) ; }
Gets an array of  that define the verbs supported by this ProgID.
Gets an array of that define the verbs supported by this ProgID .
Array of  that contains supported verbs.
Array of that contains supported verbs .