Пример #1
0
 public static void Register(IVsTextView interopTextView, IWpfTextView textView, CodeFormattingServices services)
 {
     var dispatcher = new StandardCommandDispatcher();
     dispatcher._textView = textView;
     dispatcher._services = services;
     interopTextView.AddCommandFilter(dispatcher, out dispatcher._commandChain);
 }
        public static void Register(IVsTextView interopTextView, IWpfTextView textView, CodeFormattingServices services)
        {
            GeneralOptionsPage generalOptions = (GeneralOptionsPage)(Package.GetGlobalService(typeof(GeneralOptionsPage)));
            if (!generalOptions.FormattingEnabled) return;

            var dispatcher = new StandardCommandDispatcher();
            dispatcher._textView = textView;
            dispatcher._services = services;
            interopTextView.AddCommandFilter(dispatcher, out dispatcher._commandChain);
        }
        public static StandardCommandDispatcher Register(IVsTextView interopTextView, IWpfTextView textView, CodeFormattingServices services)
        {
            var generalOptions = Setting.getGeneralOptions(services.ServiceProvider);
            if (generalOptions == null || !generalOptions.FormattingEnabled) return null;

            var dispatcher = new StandardCommandDispatcher();
            dispatcher._textView = textView;
            dispatcher._services = services;
            interopTextView.AddCommandFilter(dispatcher, out dispatcher._commandChain);
            return dispatcher;
        }
        public static void Register(IVsTextView interopTextView, IWpfTextView textView, CodeFormattingServices services)
        {
            GeneralOptionsPage generalOptions = (GeneralOptionsPage)(Package.GetGlobalService(typeof(GeneralOptionsPage)));
            if (!generalOptions.FormattingEnabled)
            {
                logger.Log(LogType.Information, "Formatting feature is disabled in General option page.");
                return;
            }

            var dispatcher = new StandardCommandDispatcher();
            dispatcher._textView = textView;
            dispatcher._services = services;
            interopTextView.AddCommandFilter(dispatcher, out dispatcher._commandChain);
        }
        public static StandardCommandDispatcher Register(IVsTextView interopTextView, IWpfTextView textView, CodeFormattingServices services)
        {
            var generalOptions = Utils.GetGeneralOptionsPage(services.ServiceProvider);

            if (!generalOptions.FormattingEnabled)
            {
                return(null);
            }

            var dispatcher = new StandardCommandDispatcher();

            dispatcher._textView = textView;
            dispatcher._services = services;
            interopTextView.AddCommandFilter(dispatcher, out dispatcher._commandChain);
            return(dispatcher);
        }
Пример #6
0
        public static void Register(IVsTextView interopTextView, IWpfTextView textView, CodeFormattingServices services)
        {
            var dispatcher = new StandardCommandDispatcher();

            dispatcher._textView = textView;
            dispatcher._services = services;
            interopTextView.AddCommandFilter(dispatcher, out dispatcher._commandChain);
        }