void StartDetection() { try { var asm = GetType().Assembly; var id = "ReSharper OpenWrap Integration"; #if v600 _lifetimeDefinition = resharper::JetBrains.DataFlow.Lifetimes.Define(resharper::JetBrains.DataFlow.EternalLifetime.Instance, "OpenWrap Solution"); _pluginsDirectory = (resharper::JetBrains.Application.PluginSupport.PluginsDirectory)_host.Environment.Container.ResolveDynamic(typeof(resharper::JetBrains.Application.PluginSupport.PluginsDirectory)).Instance; _selfPlugin = new ResharperPlugin(_lifetimeDefinition.Lifetime, new[] { new resharper::JetBrains.Util.FileSystemPath(asm.Location) }, null, null, null); _pluginsDirectory.Plugins.Add(_selfPlugin); #else _selfPlugin = new ResharperPlugin(id, new[] { asm }); ResharperPluginManager.Instance.Plugins.Add(_selfPlugin); _selfPlugin.Enabled = true; resharper::JetBrains.Application.Shell.Instance.LoadAssemblies(id, asm); #endif } catch (Exception e) { _output.Write("Plugin integration failed.\r\n" + e.ToString()); } }
public void Dispose() { _output.Write("Unloading."); #if !RESHARPER_6 _selfPlugin.Enabled = false; ResharperPluginManager.Instance.Plugins.Remove(_selfPlugin); #else _selfPlugin.IsEnabled.SetValue(false); _pluginsDirectory.Plugins.Remove(_selfPlugin); _lifetimeDefinition.Terminate(); _host = null; #endif _selfPlugin = null; }
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 StartDetection() { try { var asm = GetType().Assembly; #if v600 || v610 _lifetimeDefinition = resharper::JetBrains.DataFlow.Lifetimes.Define(resharper::JetBrains.DataFlow.EternalLifetime.Instance, "OpenWrap Solution"); _pluginsDirectory = (resharper::JetBrains.Application.PluginSupport.PluginsDirectory)_host.Environment.Container.ResolveDynamic(typeof(resharper::JetBrains.Application.PluginSupport.PluginsDirectory)).Instance; _selfPlugin = new ResharperPlugin(_lifetimeDefinition.Lifetime, new[] { new resharper::JetBrains.Util.FileSystemPath(asm.Location) }, null, null, null); _pluginsDirectory.Plugins.Add(_selfPlugin); _selfPlugin.IsEnabled.SetValue(true); #elif v710 _lifetimeDefinition = resharper::JetBrains.DataFlow.Lifetimes.Define(resharper::JetBrains.DataFlow.EternalLifetime.Instance, "OpenWrap Solution"); _pluginsDirectory = (resharper::JetBrains.Application.PluginSupport.PluginsDirectory)_host.Environment.Container.ResolveDynamic(typeof(resharper::JetBrains.Application.PluginSupport.PluginsDirectory)).Instance; _selfPlugin = new ResharperPlugin(_lifetimeDefinition.Lifetime, new[] { new resharper::JetBrains.Util.FileSystemPath(asm.Location) }, null, null, null); //_pluginsDirectory.Plugins.Add(_selfPlugin); _selfPlugin.IsEnabled.SetValue(true); #else var id = "ReSharper OpenWrap Integration"; _selfPlugin = new ResharperPlugin(id, new[] { asm }); ResharperPluginManager.Instance.Plugins.Add(_selfPlugin); _selfPlugin.Enabled = true; resharper::JetBrains.Application.Shell.Instance.LoadAssemblies(id, asm); #endif } catch (Exception e) { _output.Write("Plugin integration failed.\r\n" + e.ToString()); } }
void StartDetection() { try { _output.Write("Start detection of Simple.Testing Resharper plugin" ); var asm = GetType().Assembly; var id = "Simple.Testing ReSharper Plugin"; #if RESHARPER_6 _lifetimeDefinition = resharper::JetBrains.DataFlow.Lifetimes.Define(resharper::JetBrains.DataFlow.EternalLifetime.Instance, "Simple.Testing Reharper Plugin"); _pluginsDirectory = (resharper::JetBrains.Application.PluginSupport.PluginsDirectory)_host.Environment.Container.ResolveDynamic(typeof(resharper::JetBrains.Application.PluginSupport.PluginsDirectory)).Instance; _selfPlugin = new ResharperPlugin(_lifetimeDefinition.Lifetime, new[] { new resharper::JetBrains.Util.FileSystemPath(asm.Location) }, null, null, null); _pluginsDirectory.Plugins.Add(_selfPlugin); #else _selfPlugin = new ResharperPlugin(id, new[] { asm }); ResharperPluginManager.Instance.Plugins.Add(_selfPlugin); _selfPlugin.Enabled = true; resharper::JetBrains.Application.Shell.Instance.LoadAssemblies(id, asm); #endif _output.Write("End detection of Simple.Testing Resharper plugin"); } catch (Exception e) { _output.Write("Plugin integration failed.\r\n" + e.ToString()); } }