コード例 #1
0
        internal VisualStudioWorkspace(HostServices hostServices, WorkspaceBackgroundWork backgroundWork)
            : base(hostServices, WorkspaceKind.Host)
        {
            if ((backgroundWork & WorkspaceBackgroundWork.Compile) != 0)
            {
                _backgroundCompiler = new BackgroundCompiler(this);
            }

            if ((backgroundWork & WorkspaceBackgroundWork.Parse) != 0)
            {
                _backgroundParser = new BackgroundParser(this);
                _backgroundParser.Start();
            }
        }
コード例 #2
0
        private void OnCacheFlushRequested(object sender, EventArgs e)
        {
            if (_backgroundCompiler != null)
            {
                _backgroundCompiler.Dispose();
                _backgroundCompiler = null; // PartialSemanticsEnabled will now return false
            }

            // No longer need cache notifications
            var cacheService = Services.GetService<IWorkspaceCacheService>();
            if (cacheService != null)
            {
                cacheService.CacheFlushRequested -= OnCacheFlushRequested;
            }
        }
コード例 #3
0
        internal VisualStudioWorkspace(HostServices hostServices, WorkspaceBackgroundWork backgroundWork)
            : base(hostServices, WorkspaceKind.Host)
        {
            if ((backgroundWork & WorkspaceBackgroundWork.Compile) != 0)
            {
                _backgroundCompiler = new BackgroundCompiler(this);

                var cacheService = Services.GetService<IWorkspaceCacheService>();
                if (cacheService != null)
                {
                    cacheService.CacheFlushRequested += OnCacheFlushRequested;
                }
            }

            if ((backgroundWork & WorkspaceBackgroundWork.Parse) != 0)
            {
                _backgroundParser = new BackgroundParser(this);
                _backgroundParser.Start();
            }
        }