public static bool TestExecution(AnkhCommand commandEnum, object argument) { AnkhRuntime runtime = new AnkhRuntime(ServiceProviderHelper.serviceProvider); runtime.AddModule(new AnkhModule(runtime)); runtime.Start(); return(runtime.CommandMapper.Execute(commandEnum, new CommandEventArgs(commandEnum, runtime.Context, argument, false, false))); }
public void SetUp() { sp = new AnkhServiceProvider(); object pvar; var shell = new Mock <SVsShell>().As <IVsShell>(); shell.Setup(x => x.GetProperty(It.IsAny <int>(), out pvar)).Returns(-1); sp.AddService(typeof(SVsShell), shell.Object); var state = new Mock <IAnkhCommandStates>(); state.SetupGet(x => x.SccProviderActive).Returns(true); state.SetupGet(x => x.SolutionExists).Returns(true); sp.AddService(typeof(IAnkhCommandStates), state.Object); var selection = new Mock <ISelectionContext>(); selection.Setup(x => x.Cache[It.IsAny <object>()]).Returns(null); var rawHandle = new Mock <IVsSccProject2>(); var p = new SccProject("c:\foo\bar", rawHandle.Object); selection.Setup(x => x.GetSelectedProjects(It.IsAny <bool>())).Returns(new[] { p }); sp.AddService(typeof(ISelectionContext), selection.Object); var pcMgr = new Mock <IPendingChangesManager>(); sp.AddService(typeof(IPendingChangesManager), pcMgr.Object); var textMgr = new Mock <SVsTextManager>().As <IVsTextManager>(); sp.AddService(typeof(SVsTextManager), textMgr.Object); var selectionMonitor = new Mock <IVsMonitorSelection>(); sp.AddService(typeof(IVsMonitorSelection), selectionMonitor.Object); var r = new AnkhRuntime(sp); r.AddModule(new AnkhModule(r)); r.AddModule(new AnkhSccModule(r)); //r.AddModule(new AnkhVSModule(r)); r.AddModule(new AnkhUIModule(r)); r.AddModule(new AnkhDiffModule(r)); r.Start(); cm = r.GetService <CommandMapper>(); }
///////////////////////////////////////////////////////////////////////////// // Overridden Package Implementation #region Package Members /// <summary> /// Initialization of the package; this method is called right after the package is sited, so this is the place /// where you can put all the initialization code that rely on services provided by VisualStudio. /// </summary> protected override void Initialize() { base.Initialize(); AnkhRuntime runtime = null; IAnkhPackage pkg = GetService(typeof(IAnkhPackage)) as IAnkhPackage; if (pkg != null) { runtime = AnkhRuntime.Get(pkg); } if (runtime != null) { runtime.AddModule(new AnkhWpfModule(runtime)); runtime.AddModule(new AnkhWpfUIModule(runtime)); } else { Trace.WriteLine(string.Format("Failed to initialize {0}, because the Ankh Runtime is not available", typeof(AnkhSvnWpfPackage).FullName)); } }
///////////////////////////////////////////////////////////////////////////// // Overridden Package Implementation #region Package Members /// <summary> /// Initialization of the package; this method is called right after the package is sited, so this is the place /// where you can put all the initialization code that rely on services provided by VisualStudio. /// </summary> protected override async System.Threading.Tasks.Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress) { // Switches to the UI thread in order to consume some services used in command initialization await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); AnkhRuntime runtime = null; IAnkhPackage pkg = await GetServiceAsync(typeof(IAnkhPackage)) as IAnkhPackage; if (pkg != null) { runtime = AnkhRuntime.Get(pkg); } if (runtime != null) { runtime.AddModule(new AnkhWpfModule(runtime)); runtime.AddModule(new AnkhWpfUIModule(runtime)); } else { Trace.WriteLine(string.Format("Failed to initialize {0}, because the Ankh Runtime is not available", typeof(AnkhSvnWpfPackage).FullName)); } }
public AnkhSccModule(AnkhRuntime runtime) : base(runtime) { }
/// <summary> /// Initializes a new instance of the <see cref="AnkhDiffModule"/> class. /// </summary> /// <param name="runtime">The runtime.</param> public AnkhDiffModule(AnkhRuntime runtime) : base(runtime) { }
public AnkhUIModule(AnkhRuntime runtime) : base(runtime) { }
public AnkhGitSccModule(AnkhRuntime runtime) : base(runtime) { }
public AnkhWpfUIModule(AnkhRuntime runtime) : base(runtime) { Ankh.VS.WpfServices.VSColorProxy.Ensure(); }
public static bool TestExecution(AnkhCommand commandEnum, object argument) { AnkhRuntime runtime = new AnkhRuntime(ServiceProviderHelper.serviceProvider); runtime.AddModule(new AnkhModule(runtime)); runtime.Start(); return runtime.CommandMapper.Execute(commandEnum, new CommandEventArgs(commandEnum, runtime.Context, argument, false, false)); }
public void SetUp() { sp = new AnkhServiceProvider(); object pvar; var shell = new Mock<SVsShell>().As<IVsShell>(); shell.Setup(x => x.GetProperty(It.IsAny<int>(), out pvar)).Returns(-1); sp.AddService(typeof(SVsShell), shell.Object); var state = new Mock<IAnkhCommandStates>(); state.SetupGet(x => x.SccProviderActive).Returns(true); state.SetupGet(x => x.SolutionExists).Returns(true); sp.AddService(typeof(IAnkhCommandStates), state.Object); var selection = new Mock<ISelectionContext>(); selection.Setup(x => x.Cache[It.IsAny<object>()]).Returns(null); var rawHandle = new Mock<IVsSccProject2>(); var p = new SvnProject("c:\foo\bar", rawHandle.Object); selection.Setup(x => x.GetSelectedProjects(It.IsAny<bool>())).Returns(new[] { p }); sp.AddService(typeof(ISelectionContext), selection.Object); var pcMgr = new Mock<IPendingChangesManager>(); sp.AddService(typeof(IPendingChangesManager), pcMgr.Object); var textMgr = new Mock<SVsTextManager>().As<IVsTextManager>(); sp.AddService(typeof(SVsTextManager), textMgr.Object); var selectionMonitor = new Mock<IVsMonitorSelection>(); sp.AddService(typeof(IVsMonitorSelection), selectionMonitor.Object); var r = new AnkhRuntime(sp); r.AddModule(new AnkhModule(r)); r.AddModule(new AnkhSccModule(r)); //r.AddModule(new AnkhVSModule(r)); r.AddModule(new AnkhUIModule(r)); r.AddModule(new AnkhDiffModule(r)); r.Start(); cm = r.GetService<CommandMapper>(); }
/// <summary> /// Default constructor of the package. /// Inside this method you can place any initialization code that does not require /// any Visual Studio service because at this point the package object is created but /// not sited yet inside Visual Studio environment. The place to do all the other /// initialization is the Initialize method. /// </summary> public AnkhSvnPackage() { _runtime = new AnkhRuntime(this); }