Exemplo n.º 1
0
 private void btnReplace_Click(ActionEntry entry)
 {
     entry.LogLine( "Removing old virtual directory" );
     entry.LaunchSubAction( RemoveVirtualDirectory );
     if( (!entry.HasErrors) && (!entry.HasExceptions) )
     {
         entry.LogLine( "Recreate virtual directory" );
         entry.LaunchSubAction( CreateVirtualDirectory );
     }
     entry.LogLine( "Reload IIS virtual directories list" );
     ddVirtualDirs.SelectedIndex = -1;
     entry.LaunchSubAction( LoadVirtualDirectories );
     if( (!entry.HasErrors) && (!entry.HasExceptions) )
     {
         MessageBox.Show( "Virtual directory replaced" );
     }
     else
     {
     System.Diagnostics.Debug.Fail( "HERE: DialogBox de l'ActionEntry qui a foiré" );
     }
     CheckStatus();
 }
Exemplo n.º 2
0
 private void BrowseDirectoriesRecursive(ActionEntry entry, DirectoryEntry dirEntry, List<DirectoryEntry> dirList)
 {
     foreach( var child in dirEntry.Children.Cast<DirectoryEntry>() )
     {
         switch( child.SchemaClassName )
         {
             case "IIsWebVirtualDir":
                 entry.LogLine( "Found virtual directory at '" + child.Path + "'" );
                 dirList.Add( child );
                 goto case "IIsWebDirectory";
             case "IIsWebDirectory":
                 entry.LaunchSubAction( (e)=>{ BrowseDirectoriesRecursive( e, child, dirList ); } );
                 break;
             default:
                 System.Diagnostics.Debug.Fail( "Unknown child type '" + child.SchemaClassName + "'" );
                 break;
         }
     }
 }