public static CommandTargetProxy GetProxyTarget(ITextView textView, ICoreShell coreShell) { var proxy = ServiceManager.GetService<CommandTargetProxy>(textView); if (proxy == null) { proxy = new CommandTargetProxy(textView, coreShell); } return proxy; }
public static CommandTargetProxy GetProxyTarget(ITextView textView, ICoreShell coreShell) { var proxy = ServiceManager.GetService <CommandTargetProxy>(textView); if (proxy == null) { proxy = new CommandTargetProxy(textView, coreShell); } return(proxy); }
/// <summary> /// Retrieves base command target that is chained to the main controller /// attached to a given view. This is typically a core editor command target. /// </summary> /// <param name="textView">Text view</param> /// <returns>Chained command target</returns> private ICommandTarget GetBaseCommandTarget(ITextView textView) { var controller = MdMainController.FromTextView(textView); // If there is no chained target yet, create a simple proxy target // for now. Real target will be set later. if (controller != null && controller.ChainedController != null) { return(controller.ChainedController); } return(CommandTargetProxy.GetProxyTarget(textView)); }