示例#1
0
 public SolutionBuildMonitor(VisualStudioWorkspace workspace)
 {
     var notificationService = workspace.Services.GetService<IGlobalOperationNotificationService>() as GlobalOperationNotificationService;
     if (notificationService != null)
     {
         _notificationService = notificationService;
         KnownUIContexts.SolutionBuildingContext.UIContextChanged += SolutionBuildingContextChanged;
     }
 }
		protected override void Initialize()
		{
			var model = this.GetService(typeof(SComponentModel)) as IComponentModel;
			this.workspace = model.GetService<VisualStudioWorkspace>();
			this.dte = this.GetService(typeof(DTE)) as DTE;
			this.documentEvents = this.dte.Events.DocumentEvents as DocumentEventsClass;

			this.documentEvents.DocumentSaved += this.OnDocumentSaved;

			base.Initialize();
		}
        public SalesforceConnectedServiceWizard(ConnectedServiceProviderContext context, VisualStudioWorkspace visualStudioWorkspace)
        {
            this.context = context;
            this.visualStudioWorkspace = visualStudioWorkspace;

            this.telemetryHelper = new TelemetryHelper(context);
            this.telemetryHelper.TrackWizardStartedEvent();

            this.userSettings = UserSettings.Load(context.Logger);

            this.InitializePages();
        }
示例#4
0
 /// Initialization of the package; this method is called right after the package is sited, so this is the place
 /// where you can put all the initialization code that rely on services provided by VisualStudio.
 protected override void Initialize()
 {
     ProjectDeployer.EnsureDevArchProjectSupportExists();
     var serviceProvider = this;
     var commandFactory = new CommandFactory(serviceProvider);
     var guidDevarchToolsMenu = new Guid("d5a065b2-0a4e-4adc-ad08-2e4178f6ed21");
     var componentModel = (IComponentModel)GetGlobalService(typeof(SComponentModel));
     Workspace = componentModel.GetService<VisualStudioWorkspace>();
     commandFactory.AddCommand(new GenerateImagesCommand(serviceProvider, Workspace), new CommandID(guidDevarchToolsMenu, 0x0105));
     //commandFactory.AddCommand(new ViewDiagramsCommand(serviceProvider), new CommandID(guidDevarchToolsMenu, 0x0106) );
     base.Initialize();
 }
        private VirtualMemoryNotificationListener(
            SVsServiceProvider serviceProvider,
            VisualStudioWorkspace workspace) : base(assertIsForeground: true)
        {
            _workspace = workspace;
            _workspace.WorkspaceChanged += OnWorkspaceChanged;

            _workspaceCacheService = workspace.Services.GetService<IWorkspaceCacheService>() as WorkspaceCacheService;

            var shell = (IVsShell)serviceProvider.GetService(typeof(SVsShell));
            // Note: We never unhook this event sink. It lives for the lifetime of the host.
            ErrorHandler.ThrowOnFailure(shell.AdviseBroadcastMessages(this, out var cookie));
        }
示例#6
0
 public RwHtmlCompletionSource(RwHtmlCompletionSourceProvider sourceProvider, RwHtmlParser parser, 
     RwHtmlClassifier classifier, ITextBuffer textBuffer, VisualStudioWorkspace workspace, 
     IGlyphService glyphService, DTE2 dte, RedwoodConfigurationProvider configurationProvider,
     MetadataControlResolver metadataControlResolver)
 {
     this.sourceProvider = sourceProvider;
     this.textBuffer = textBuffer;
     this.classifier = classifier;
     this.parser = parser;
     this.workspace = workspace;
     this.glyphService = glyphService;
     this.dte = dte;
     this.configurationProvider = configurationProvider;
     this.MetadataControlResolver = metadataControlResolver;
 }
示例#7
0
 private WorkspaceWrapper(VisualStudioWorkspace workspace)
 {
     _workspace = workspace;
 }
 private VisualStudioWorkspace_InProc()
 {
     _visualStudioWorkspace = GetComponentModelService<VisualStudioWorkspace>();
 }
 public static Project GetProject(IVsHierarchy projectHierarchy, VisualStudioWorkspace visualStudioWorkspace)
 {
     return visualStudioWorkspace.CurrentSolution.Projects
         .FirstOrDefault(p => projectHierarchy == visualStudioWorkspace.GetHierarchy(p.Id));
 }
示例#10
0
 public GenerateImagesCommand(ToolsMenuPackage serviceProvider, VisualStudioWorkspace vsWorkspace) : base(serviceProvider)
 {
     _vsWorkspace = vsWorkspace;
 }