//todo: there is quite a bit going on in here...this is going to need to be looked at...
 private void ExecuteOperation(ApplicationPool appPool, DeploymentResult result)
 {
     switch (Operation)
     {
         case Iis7ApplicationPoolOperation.StopApplicationPool:
             if (appPool == null)
             {
                 result.AddAlert(ApplicationPoolDoesNotExistError);
             }
             else if (appPool.CanBeStopped())
             {
                 CheckForElevatedPrivileges(appPool.StopAndWaitForCompletion);
                 result.AddGood("Application Pool '{0}' stopped.".FormatWith(ApplicationPool));
             }
             else
             {
                 result.AddNote("Application Pool '{0}' is not running.".FormatWith(ApplicationPool));
             }
             break;
         case Iis7ApplicationPoolOperation.StartApplicationPool:
             if (appPool == null)
             {
                 throw new InvalidOperationException(ApplicationPoolDoesNotExistError);
             }
             else if (appPool.CanBeStarted())
             {
                 IisUtility.WaitForIisToCompleteAnyOperations();
                 CheckForElevatedPrivileges(appPool.StartAndWaitForCompletion);
                 result.AddGood("Application Pool '{0}' started.".FormatWith(ApplicationPool));
             }
             else
             {
                 result.AddGood("Application Pool '{0}' is already running.".FormatWith(ApplicationPool));
             }
             break;
     }
 }