FileAssociation/ProgramAssociationInfo.cs
/// <summary>
/// Adds single <see cref="ProgramVerb"/> that define the verb supported by this ProgID.
/// </summary>
/// <param name="verb">Single <see cref="ProgramVerb"/> that contains supported verb.</param>
Adds single  that define the verb supported by this ProgID.
Adds single that define the verb supported by this ProgID .
protected void AddVerbInternal(ProgramVerb verb)
      {
         RegistryKey root = RegistryWrapper.ClassesRoot;
         RegistryKey key = root.OpenSubKey(this.progId).OpenSubKey("shell", true);
         if (key == null)
         {
            key = root.OpenSubKey(this.progId, true).CreateSubKey("shell");
         }
         RegistryKey tmpkey = key.OpenSubKey(verb.Name, true);
         if (tmpkey == null)
         {
            tmpkey = key.CreateSubKey(verb.Name);
         }
         key = tmpkey;
         tmpkey = key.OpenSubKey("command", true);
         if (tmpkey == null)
         {
            tmpkey = key.CreateSubKey("command");
         }
         tmpkey.SetValue(string.Empty, verb.Command, RegistryValueKind.ExpandString);
         tmpkey.Close();
         key.Close();
         root.Close();
         ShellNotification.NotifyOfChange();
      }
protected void AddVerbInternal ( ProgramVerb verb ) { RegistryKey root = RegistryWrapper . ClassesRoot ; RegistryKey key = root . OpenSubKey ( this . progId ) . OpenSubKey ( " " , true ) ; if ( key == null ) { key = root . OpenSubKey ( this . progId , true ) . CreateSubKey ( " " ) ; } RegistryKey tmpkey = key . OpenSubKey ( verb . Name , true ) ; if ( tmpkey == null ) { tmpkey = key . CreateSubKey ( verb . Name ) ; } key = tmpkey ; tmpkey = key . OpenSubKey ( " " , true ) ; if ( tmpkey == null ) { tmpkey = key . CreateSubKey ( " " ) ; } tmpkey . SetValue ( string . Empty , verb . Command , RegistryValueKind . ExpandString ) ; tmpkey . Close ( ) ; key . Close ( ) ; root . Close ( ) ; ShellNotification . NotifyOfChange ( ) ; }
Adds single  that define the verb supported by this ProgID.
Adds single that define the verb supported by this ProgID .
verb
ProgramVerb
Single  that contains supported verb.
Single that contains supported verb .