A proxy class that allows delayed chaining of controllers in case contained language sets its command target first before primary view is created. When finally the primary view is created it sets actual command target on the proxy.
Inheritance: ICommandTarget
コード例 #1
0
ファイル: CommandTargetProxy.cs プロジェクト: Microsoft/RTVS
 public static CommandTargetProxy GetProxyTarget(ITextView textView, ICoreShell coreShell) {
     var proxy = ServiceManager.GetService<CommandTargetProxy>(textView);
     if (proxy == null) {
         proxy = new CommandTargetProxy(textView, coreShell);
     }
     return proxy;
 }
コード例 #2
0
ファイル: CommandTargetProxy.cs プロジェクト: mvacha/RTVS
        public static CommandTargetProxy GetProxyTarget(ITextView textView, ICoreShell coreShell)
        {
            var proxy = ServiceManager.GetService <CommandTargetProxy>(textView);

            if (proxy == null)
            {
                proxy = new CommandTargetProxy(textView, coreShell);
            }
            return(proxy);
        }
コード例 #3
0
        /// <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));
        }