Exemplo n.º 1
0
 public void CheckForChange()
 {
     if (timeStamp != File.GetLastWriteTimeUtc(path))
     {
         if (Reference != null)
         {
             foreach (var solution in IdeApp.Workspace.GetAllSolutions())
             {
                 var workspace = TypeSystemService.GetWorkspace(solution);
                 foreach (var projId in InUseBy)
                 {
                     if (workspace.CurrentSolution.ContainsProject(projId))
                     {
                         workspace.OnMetadataReferenceRemoved(projId, Reference);
                     }
                 }
             }
         }
         CreateNewReference();
         if (Reference != null)
         {
             foreach (var solution in IdeApp.Workspace.GetAllSolutions())
             {
                 var workspace = TypeSystemService.GetWorkspace(solution);
                 foreach (var projId in InUseBy)
                 {
                     if (workspace.CurrentSolution.ContainsProject(projId))
                     {
                         workspace.OnMetadataReferenceAdded(projId, Reference);
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
 public void CheckForChange()
 {
     if (timeStamp != File.GetLastWriteTimeUtc(path))
     {
         if (Reference != null)
         {
             foreach (var solution in IdeApp.Workspace.GetAllSolutions())
             {
                 var workspace = TypeSystemService.GetWorkspace(solution);
                 foreach (var projId in InUseBy)
                 {
                     while (true)
                     {
                         var project = workspace.CurrentSolution.GetProject(projId);
                         if (project == null)
                         {
                             break;
                         }
                         if (workspace.TryApplyChanges(project.RemoveMetadataReference(Reference).Solution))
                         {
                             break;
                         }
                     }
                 }
             }
         }
         CreateNewReference();
         if (Reference != null)
         {
             foreach (var solution in IdeApp.Workspace.GetAllSolutions())
             {
                 var workspace = TypeSystemService.GetWorkspace(solution);
                 foreach (var projId in InUseBy)
                 {
                     while (true)
                     {
                         var project = workspace.CurrentSolution.GetProject(projId);
                         if (project == null)
                         {
                             break;
                         }
                         if (workspace.TryApplyChanges(project.AddMetadataReference(Reference).Solution))
                         {
                             break;
                         }
                     }
                 }
             }
         }
     }
 }