Run() private method

private Run ( ) : bool
return bool
Beispiel #1
0
 private DialogResult ShowDialog(WaitCursor waitCursor, ShowDialogCallback callback)
 {
     DialogResult result;
     IWin32Window owner = null;
     if (this._platform == null)
     {
         throw new InvalidOperationException(Microsoft.ManagementConsole.Internal.Utility.LoadResourceString(Microsoft.ManagementConsole.Internal.Strings.ExceptionInternalConsoleDialogHostOwnerNotInitialized));
     }
     try
     {
         BeginModalLoopConsoleDialogCommand command = new BeginModalLoopConsoleDialogCommand();
         command.OwnerId = this._ownerId;
         BeginModalLoopConsoleDialogCommandResult result2 = (BeginModalLoopConsoleDialogCommandResult) this._platform.ProcessCommand(command);
         owner = result2.Window;
         if ((waitCursor != null) && waitCursor.Run())
         {
             return waitCursor.DialogResult;
         }
         result = callback(owner);
     }
     finally
     {
         EndModalLoopConsoleDialogCommand command2 = new EndModalLoopConsoleDialogCommand();
         command2.OwnerId = this._ownerId;
         this._platform.ProcessCommand(command2);
     }
     return result;
 }