public VisualStudioEventsService(IVscUIService uiService, IServiceProvider serviceProvider)
        {
            this.UIService = uiService;
            this.ServiceProvider = serviceProvider;

            VsShellPropertyEvents = new VsShellPropertyEventsHandler(serviceProvider);
            VsShellPropertyEvents.AfterShellPropertyChanged += VsShellPropertyEvents_AfterShellPropertyChanged;

            BroadsMessagesEvents = new BroadcastMessagesEventsHandler(serviceProvider);
            BroadsMessagesEvents.AfterMessageBroadcast += BroadsMessagesEvents_AfterMessageBroadcast;
        }
Ejemplo n.º 2
0
        public VisualStudioEventsService(
            IVscUIService uiService,
            IServiceProvider serviceProvider,
            IClassificationFormatMapService classificationFormatMapService)
        {
            this.UIService       = uiService;
            this.ServiceProvider = serviceProvider;
            this.ClassificationFormatMapService = classificationFormatMapService;

            TextClassificationFormatMap = ClassificationFormatMapService.GetClassificationFormatMap("text");
            TextClassificationFormatMap.ClassificationFormatMappingChanged += (s, e) => RaiseAfterTextColorSettingsChanged();

            VsShellPropertyEvents = new VsShellPropertyEventsHandler(serviceProvider);
            VsShellPropertyEvents.AfterShellPropertyChanged += VsShellPropertyEvents_AfterShellPropertyChanged;

            BroadsMessagesEvents = new BroadcastMessagesEventsHandler(serviceProvider);
            BroadsMessagesEvents.AfterMessageBroadcast += BroadsMessagesEvents_AfterMessageBroadcast;
        }
        public VisualStudioEventsService(
            IVscUIService uiService, 
            IServiceProvider serviceProvider, 
            IClassificationFormatMapService classificationFormatMapService)
        {
            this.UIService = uiService;
            this.ServiceProvider = serviceProvider;
            this.ClassificationFormatMapService = classificationFormatMapService;

            TextClassificationFormatMap = ClassificationFormatMapService.GetClassificationFormatMap("text");
            TextClassificationFormatMap.ClassificationFormatMappingChanged += (s, e) => RaiseAfterTextColorSettingsChanged();

            VsShellPropertyEvents = new VsShellPropertyEventsHandler(serviceProvider);
            VsShellPropertyEvents.AfterShellPropertyChanged += VsShellPropertyEvents_AfterShellPropertyChanged;

            BroadsMessagesEvents = new BroadcastMessagesEventsHandler(serviceProvider);
            BroadsMessagesEvents.AfterMessageBroadcast += BroadsMessagesEvents_AfterMessageBroadcast;
        }
        void VsShellPropertyEvents_AfterShellPropertyChanged(object sender, VsShellPropertyEventsHandler.ShellPropertyChangeEventArgs e)
        {
            SafeExecute(() =>
            {
                // when zombie state changes to false, finish package initialization
                //! DO NOT USE CODE WHICH MAY EXECUTE FOR LONG TIME HERE

                if ((int)__VSSPROPID.VSSPROPID_Zombie == e.PropId)
                {
                    if ((bool)e.Var == false)
                    {

                        var dte2 = ServiceProvider.GetDte2();

                        Events = dte2.Events as Events2;
                        DTEEvents = Events.DTEEvents;
                        SolutionEvents = Events.SolutionEvents;
                        DocumentEvents = Events.DocumentEvents;
                        WindowEvents = Events.WindowEvents;
                        DebuggerEvents = Events.DebuggerEvents;
                        CommandEvents = Events.CommandEvents;
                        SelectionEvents = Events.SelectionEvents;

                        DelayedInitialise();
                    }
                }
            });
        }