Ejemplo n.º 1
0
        public VSProcess GetOrCreateVSProcessForSolution(string solutionFilePath)
        {
            VSProcess vsProcess = null;

            vsProcess = GetVSProcessWithSolution(solutionFilePath);
            if (vsProcess != null)
            {
                return(vsProcess);
            }

            vsProcess = GetVSProcessWithoutSolution();
            if (vsProcess != null)
            {
                return(vsProcess);
            }

            vsProcess = VSProcess.StartNewProcess();
            if (vsProcess != null)
            {
                vsProcess.Initialize();
                vsProcesses.Insert(0, vsProcess);
            }

            return(vsProcess);
        }
Ejemplo n.º 2
0
 public void PrintRunningInstances()
 {
     VSProcess.Initialize(vsProcesses);
     foreach (var vsProcess in vsProcesses)
     {
         PrintVSInstance(vsProcess);
     }
 }
Ejemplo n.º 3
0
 public VSProcess GetVSProcessWithoutSolution()
 {
     VSProcess.Initialize(vsProcesses);
     foreach (var vsProcess in vsProcesses)
     {
         if (!vsProcess.HasOpenSolution)
         {
             return(vsProcess);
         }
     }
     return(null);
 }
Ejemplo n.º 4
0
 public VSProcess GetVSProcessWithSolution(string solutionFilePath)
 {
     VSProcess.Initialize(vsProcesses);
     foreach (var vsProcess in vsProcesses)
     {
         if (vsProcess.HasOpenSolution && vsProcess.Solution.FullName == solutionFilePath)
         {
             return(vsProcess);
         }
     }
     return(null);
 }
Ejemplo n.º 5
0
 public static void Initialize(VSProcess vsProcess)
 {
     vsProcess?.Initialize();
 }