Пример #1
0
        public static ILanguage GetLanguage(String key)
        {
            var model   = new SComponentModel();
            var factory = model.GetService <ILanguageFactory>();

            return(factory.TryCreateLanguage(key));
        }
Пример #2
0
        public PresentationModeCommand(VsfPackage package, OleMenuCommandService omcs)
            : base(package, omcs)
        {
            var model = new SComponentModel();

            this.state = model.GetService <IPresentationModeState>();
            Initialize(new Guid(Guids.guidVsfViewCmdSet), PkgCmdIdList.cmdidPresentationMode);
        }
Пример #3
0
        public ObfuscateTextCommand(VsfPackage package, OleMenuCommandService omcs)
            : base(package, omcs)
        {
            Initialize(new Guid(Guids.guidVsfViewCmdSet), PkgCmdIdList.cmdidObfuscateText);
            SComponentModel model = new SComponentModel();

            this.telemetry = model.GetService <IVsfTelemetry>();
        }
Пример #4
0
        protected override void Dispose(bool disposing)
        {
            var model = new SComponentModel();
            var ps    = model.GetService <IPresentationModeState>();

            if (disposing && ps.PresentationModeTurnedOn)
            {
                ps.TurnOff(notifyChanges: false);
            }

            base.Dispose(disposing);
        }
Пример #5
0
        public static ITextView GetCurrentView()
        {
            var textManager = (IVsTextManager)
            ServiceProvider.GlobalProvider.GetService(typeof(SVsTextManager));

              IVsTextView textView;
              int hr = textManager.GetActiveView(1, null, out textView);
              CheckError(hr, "GetActiveView");

              var componentModel = new SComponentModel();
              var factory = componentModel.GetService<IVsEditorAdaptersFactoryService>();
              return factory.GetWpfTextView(textView);
        }
Пример #6
0
        public static bool SupportsOutlines(ITextView view)
        {
            var componentModel   = new SComponentModel();
            var outliningService = componentModel.GetService <IOutliningManagerService>();

            if (outliningService == null)
            {
                return(false);
            }
            var outliningManager = outliningService.GetOutliningManager(view);

            return(outliningManager != null && outliningManager.Enabled);
        }
Пример #7
0
        public static ITextView GetCurrentView()
        {
            var textManager = (IVsTextManager)
                              ServiceProvider.GlobalProvider.GetService(typeof(SVsTextManager));

            int hr = textManager.GetActiveView(1, null, out IVsTextView textView);

            CheckError(hr, "GetActiveView");

            var componentModel = new SComponentModel();
            var factory        = componentModel.GetService <IVsEditorAdaptersFactoryService>();

            return(factory.GetWpfTextView(textView));
        }
Пример #8
0
        public static ITextView GetCurrentView()
        {
            var textManager = (IVsTextManager)
                              ServiceProvider.GlobalProvider.GetService(typeof(SVsTextManager));

            int hr = textManager.GetActiveView(1, null, out IVsTextView textView);

            if (hr != Constants.S_OK || textView == null)
            {
                return(null);
            }

            var componentModel = new SComponentModel();
            var factory        = componentModel.GetService <IVsEditorAdaptersFactoryService>();

            return(factory.GetWpfTextView(textView));
        }
Пример #9
0
 public static bool SupportsOutlines(ITextView view)
 {
     var componentModel = new SComponentModel();
       var outliningService = componentModel.GetService<IOutliningManagerService>();
       if ( outliningService == null ) {
     return false;
       }
       var outliningManager = outliningService.GetOutliningManager(view);
       return outliningManager != null && outliningManager.Enabled;
 }
Пример #10
0
        private static ILogger GetLogger()
        {
            var model = new SComponentModel();

            return(model.GetService <ILogger>());
        }
Пример #11
0
        public static IVsfSettings GetSettings()
        {
            var model = new SComponentModel();

            return(model.GetService <IVsfSettings>());
        }
Пример #12
0
        public static T GetService <T>()
        {
            var model = new SComponentModel();

            return(model.GetService <T>());
        }
Пример #13
0
 public static IVsfSettings GetSettings()
 {
     var model = new SComponentModel();
       return model.GetService<IVsfSettings>();
 }
Пример #14
0
 public static ILanguage GetLanguage(String key)
 {
     var model = new SComponentModel();
       var factory = model.GetService<ILanguageFactory>();
       return factory.TryCreateLanguage(key);
 }