public void Dispose() { _unloading.Set(); _runTestRunner = false; if (!_debugThread.Join(TimeSpan.FromSeconds(10))) { _output.Write("ReSharper TestRunner hasn't stopped on time, killing."); _debugThread.Abort(); } }
public void Dispose() { _output.Write("Unloading."); //runTestRunner = false; #if !v600 && !v610 _selfPlugin.Enabled = false; ResharperPluginManager.Instance.Plugins.Remove(_selfPlugin); #else _selfPlugin.IsEnabled.SetValue(false); _pluginsDirectory.Plugins.Remove(_selfPlugin); _lifetimeDefinition.Terminate(); _host = null; #endif _selfPlugin = null; }
void RefreshProjects() { if (_shuttingDown) { return; } _output.Write("Changes detected, updating assembly references ({0}).", GetHashCode()); foreach (var project in _solution.GetAllProjects()) { if (project.ProjectFile == null) { continue; } var projectPath = project.ProjectFile.Location.FullPath; if (!_assemblyMap.ContainsKey(projectPath)) { continue; } var existingOpenWrapReferences = project.GetAssemblyReferences() .Where(x => x.GetProperty(ISWRAP) != null).ToList(); var existingOpenWrapReferencePaths = existingOpenWrapReferences .Select(assemblyRef => assemblyRef.HintLocation()).ToList(); var assemblies = _assemblyMap[projectPath]; foreach (var path in assemblies .Where(x => !existingOpenWrapReferencePaths.Contains(x))) { ResharperLogger.Debug("Adding reference {0} to {1}", projectPath, path); var assembly = project.AddAssemblyReference(path); assembly.SetProperty(ISWRAP, true); } foreach (var toRemove in existingOpenWrapReferencePaths.Where(x => !assemblies.Contains(x))) { string remove = toRemove; ResharperLogger.Debug("Removing reference {0} from {1}", projectPath, toRemove); project.RemoveAssemblyReference(existingOpenWrapReferences.First(x => x.HintLocation() == remove)); } } }
public PluginManager() { _dte = (DTE2)SiteManager.GetGlobalService<DTE>(); _output = new OpenWrapOutput("Resharper Plugin Manager"); _output.Write("Loaded ({0}).", GetType().Assembly.GetName().Version); #if !v600 && !v610 && !v710 _threading = new LegacyShellThreading(); #else _host = resharper::JetBrains.VsIntegration.Application.JetVisualStudioHost.GetOrCreateHost((Microsoft.VisualStudio.OLE.Interop.IServiceProvider)_dte); var resolvedObj = _host.Environment.Container.ResolveDynamic(typeof(ResharperThreading)); if (resolvedObj != null) _threading = (ResharperThreading)resolvedObj.Instance; #endif if (_threading == null) { _output.Write("Threading not found, the plugin manager will not initialize."); return; } _threading.Run("Loading plugins...", StartDetection); }
public PluginManager() { _dte = (DTE2)SiteManager.GetGlobalService <DTE>(); _output = new OpenWrapOutput("Resharper Plugin Manager"); _output.Write("Loaded ({0}).", GetType().Assembly.GetName().Version); #if !v600 _threading = new LegacyShellThreading(); #else _host = resharper::JetBrains.VsIntegration.Application.JetVisualStudioHost.GetOrCreateHost((Microsoft.VisualStudio.OLE.Interop.IServiceProvider)_dte); var resolvedObj = _host.Environment.Container.ResolveDynamic(typeof(ResharperThreading)); if (resolvedObj != null) { _threading = (ResharperThreading)resolvedObj.Instance; } #endif if (_threading == null) { _output.Write("Threading not found, the plugin manager will not initialize."); return; } _threading.Run("Loading plugins...", StartDetection); }
public ProjectReferenceUpdater(resharper::JetBrains.ProjectModel.ISolution solution, resharper::JetBrains.Application.ChangeManager changeManager, ResharperThreading threading) { _solution = solution; _changeManager = changeManager; _threading = threading; _output = new OpenWrapOutput("ReSharper Project Reference Updater"); _output.Write("Solution opened " + solution.Name); _thread = new System.Threading.Thread(LoadAssemblies) { Name = "OpenWrap assembly change listener" }; _thread.Start(); _changeManager.Changed += HandleChanges; }
public ProjectReferenceUpdater(resharper::JetBrains.ProjectModel.ISolution solution, resharper::JetBrains.Application.ChangeManager changeManager, ResharperThreading threading) { _solution = solution; _changeManager = changeManager; _threading = threading; _output = new OpenWrapOutput("ReSharper Project Reference Updater"); _output.Write("Solution opened " + solution.Name); _thread = new System.Threading.Thread(LoadAssemblies) { Name = "OpenWrap assembly change listener" }; _thread.Start(); _changeManager.Changed += HandleChanges; }