Ejemplo n.º 1
0
        public DevEnvImpl(
            ClideSettings settings,
            IServiceLocator serviceLocator,
            IEnumerable <Lazy <IToolWindow> > toolWindows,
            Lazy <IDialogWindowFactory> dialogFactory,
            Lazy <IUIThread> uiThread,
            Lazy <IMessageBoxService> messageBox,
            IShellEvents shellEvents,
            Lazy <IReferenceService> references,
            IErrorsManager errorsManager,
            Lazy <IOutputWindowManager> outputWindow)
        {
            this.serviceLocator = serviceLocator;
            this.dialogFactory  = dialogFactory;
            this.toolWindows    = toolWindows;
            this.shellEvents    = shellEvents;
            this.uiThread       = uiThread;
            this.messageBox     = messageBox;
            this.status         = new Lazy <IStatusBar>(() => new StatusBar(this.ServiceLocator));
            this.references     = references;
            this.errorsManager  = errorsManager;
            this.outputWindow   = outputWindow;

            TracingExtensions.ErrorsManager = this.errorsManager;

            if (settings.Debug)
            {
                Tracer.Manager.AddListener(Strings.Trace.RootSource,
                                           new TextTraceListener(outputWindow.Value.GetPane(new Guid(Strings.Trace.OutputPaneId), Strings.Trace.OutputPaneTitle)));
            }

            Tracer.Manager.SetTracingLevel(Strings.Trace.RootSource, settings.TracingLevel);

            this.isElevated = new Lazy <bool>(() =>
            {
                var shell = this.ServiceLocator.TryGetService <SVsShell, IVsShell3>();
                if (shell == null)
                {
                    return(false);
                }

                bool elevated;
                shell.IsRunningElevated(out elevated);
                return(elevated);
            });
        }
Ejemplo n.º 2
0
        public DevEnvImpl(
            ClideSettings settings,
            IServiceLocator serviceLocator,
            IEnumerable<Lazy<IToolWindow>> toolWindows,
            Lazy<IDialogWindowFactory> dialogFactory,
            Lazy<IUIThread> uiThread,
            Lazy<IMessageBoxService> messageBox,
            IShellEvents shellEvents,
            Lazy<IReferenceService> references,
            IErrorsManager errorsManager, 
            Lazy<IOutputWindowManager> outputWindow)
        {
            this.serviceLocator = serviceLocator;
            this.dialogFactory = dialogFactory;
            this.toolWindows = toolWindows;
            this.shellEvents = shellEvents;
            this.uiThread = uiThread;
            this.messageBox = messageBox;
            this.status = new Lazy<IStatusBar>(() => new StatusBar(this.ServiceLocator));
            this.references = references;
            this.errorsManager = errorsManager;
            this.outputWindow = outputWindow;

            TracingExtensions.ErrorsManager = this.errorsManager;

            if (settings.Debug)
            {
                Tracer.Manager.AddListener(Strings.Trace.RootSource,
                    new TextTraceListener(outputWindow.Value.GetPane(new Guid(Strings.Trace.OutputPaneId), Strings.Trace.OutputPaneTitle)));
            }

            Tracer.Manager.SetTracingLevel(Strings.Trace.RootSource, settings.TracingLevel);

            this.isElevated = new Lazy<bool>(() =>
            {
                var shell = this.ServiceLocator.TryGetService<SVsShell, IVsShell3>();
                if (shell == null)
                    return false;

                bool elevated;
                shell.IsRunningElevated(out elevated);
                return elevated;
            });
        }