コード例 #1
0
ファイル: MenuStatusChecker.cs プロジェクト: yanglee/Fody
 public void DisableCommandStatusCheck(OleMenuCommand disableCommand)
 {
     try
     {
         disableCommand.Enabled = false;
         foreach (var project in currentProjectFinder.GetCurrentProjects())
         {
             var xmlForProject = LoadXmlForProject(project);
             if (xmlForProject != null)
             {
                 if (containsFodyChecker.Check(xmlForProject))
                 {
                     disableCommand.Enabled = true;
                     return;
                 }
             }
         }
     }
     catch (COMException exception)
     {
         exceptionDialog.HandleException(exception);
     }
     catch (Exception exception)
     {
         exceptionDialog.HandleException(exception);
     }
 }
コード例 #2
0
 public void ConfigureCallback()
 {
     try
     {
         var currentProjects = currentProjectFinder.GetCurrentProjects();
         if (currentProjects
             .Any(UnsaveProjectChecker.HasUnsavedPendingChanges))
         {
             return;
         }
         foreach (var project in currentProjects)
         {
             Configure(project);
         }
     }
     catch (COMException exception)
     {
         exceptionDialog.HandleException(exception);
     }
     catch (Exception exception)
     {
         exceptionDialog.HandleException(exception);
     }
 }
コード例 #3
0
 public void DisableCallback()
 {
     try
     {
         var projects = currentProjectFinder.GetCurrentProjects();
         if (projects.Any(UnsaveProjectChecker.HasUnsavedPendingChanges))
         {
             return;
         }
         foreach (var project in projects)
         {
             messageDisplayer.ShowInfo(string.Format("Fody: Removed from the project '{0}'. However no binary files will be removed in case they are being used by other projects.", project.Name));
             new ProjectRemover(project.FullName);
         }
     }
     catch (COMException exception)
     {
         exceptionDialog.HandleException(exception);
     }
     catch (Exception exception)
     {
         exceptionDialog.HandleException(exception);
     }
 }