Example #1
0
        // Internal for testing
        protected RazorProjectHostBase(
            IUnconfiguredProjectCommonServices commonServices,
            Workspace workspace,
            ProjectSnapshotManagerBase projectManager)
            : base(commonServices.ThreadingService.JoinableTaskContext)
        {
            if (commonServices == null)
            {
                throw new ArgumentNullException(nameof(commonServices));
            }

            if (workspace == null)
            {
                throw new ArgumentNullException(nameof(workspace));
            }

            if (projectManager == null)
            {
                throw new ArgumentNullException(nameof(projectManager));
            }

            CommonServices  = commonServices;
            _workspace      = workspace;
            _projectManager = projectManager;

            _lock             = new AsyncSemaphore(initialCount: 1);
            _currentDocuments = new Dictionary <string, HostDocument>(FilePathComparer.Instance);
        }
 // Internal for testing
 internal DefaultRazorProjectHost(
     IUnconfiguredProjectCommonServices commonServices,
     Workspace workspace,
     ProjectSnapshotManagerBase projectManager)
     : base(commonServices, workspace, projectManager)
 {
 }
 internal FallbackRazorProjectHost(
     IUnconfiguredProjectCommonServices commonServices,
     Workspace workspace,
     ProjectConfigurationFilePathStore projectConfigurationFilePathStore,
     ProjectSnapshotManagerBase projectManager)
     : base(commonServices, workspace, projectConfigurationFilePathStore, projectManager)
 {
 }
 internal FallbackRazorProjectHost(
     IUnconfiguredProjectCommonServices commonServices,
     Workspace workspace,
     RazorProjectChangePublisher razorProjectChangePublisher,
     ProjectSnapshotManagerBase projectManager)
     : base(commonServices, workspace, razorProjectChangePublisher, projectManager)
 {
 }
Example #5
0
        public override void Initialize(ProjectSnapshotManagerBase projectManager)
        {
            _projectManager = projectManager;
            _projectManager.Workspace.WorkspaceChanged += Workspace_WorkspaceChanged;

            _deferredUpdates = new Dictionary <ProjectId, Task>();

            InitializeSolution(_projectManager.Workspace.CurrentSolution);
        }
Example #6
0
 internal DefaultWindowsRazorProjectHost(
     IUnconfiguredProjectCommonServices commonServices,
     Workspace workspace,
     ProjectSnapshotManagerDispatcher projectSnapshotManagerDispatcher,
     ProjectConfigurationFilePathStore projectConfigurationFilePathStore,
     ProjectSnapshotManagerBase projectManager)
     : base(commonServices, workspace, projectSnapshotManagerDispatcher, projectConfigurationFilePathStore, projectManager)
 {
 }
        public override void Initialize(ProjectSnapshotManagerBase projectManager)
        {
            _projectManager          = projectManager;
            _projectManager.Changed += ProjectManager_Changed;
            _projectManager.Workspace.WorkspaceChanged += Workspace_WorkspaceChanged;

            _deferredUpdates = new Dictionary <ProjectId, Task>();

            // This will usually no-op, in the case that another project snapshot change trigger immediately adds projects we want to be able to handle those projects
            InitializeSolution(_projectManager.Workspace.CurrentSolution);
        }
Example #8
0
        // Should only be called from the UI thread.
        private ProjectSnapshotManagerBase GetProjectManager()
        {
            CommonServices.ThreadingService.VerifyOnUIThread();

            if (_projectManager == null)
            {
                _projectManager = (ProjectSnapshotManagerBase)_workspace.Services.GetLanguageServices(RazorLanguage.Name).GetRequiredService <ProjectSnapshotManager>();
            }

            return(_projectManager);
        }
Example #9
0
        // Should only be called from the project snapshot manager's specialized thread.
        private ProjectSnapshotManagerBase GetProjectManager()
        {
            _projectSnapshotManagerDispatcher.AssertDispatcherThread();

            if (_projectManager == null)
            {
                _projectManager = (ProjectSnapshotManagerBase)_workspace.Services.GetLanguageServices(RazorLanguage.Name).GetRequiredService <ProjectSnapshotManager>();
            }

            return(_projectManager);
        }
Example #10
0
        // Internal for testing
        protected RazorProjectHostBase(
            IUnconfiguredProjectCommonServices commonServices,
            Workspace workspace,
            RazorProjectChangePublisher razorProjectChangePublisher,
            ProjectSnapshotManagerBase projectManager)
            : this(commonServices, workspace, razorProjectChangePublisher)
        {
            if (projectManager == null)
            {
                throw new ArgumentNullException(nameof(projectManager));
            }

            _projectManager = projectManager;
        }
        // Internal for testing
        protected RazorProjectHostBase(
            IUnconfiguredProjectCommonServices commonServices,
            Workspace workspace,
            ProjectConfigurationFilePathStore projectConfigurationFilePathStore,
            ProjectSnapshotManagerBase projectManager)
            : this(commonServices, workspace, projectConfigurationFilePathStore)
        {
            if (projectManager == null)
            {
                throw new ArgumentNullException(nameof(projectManager));
            }

            _projectManager = projectManager;
        }
 public override void Initialize(ProjectSnapshotManagerBase projectManager)
 {
     _initializeNotification();
 }
 public override void Initialize(ProjectSnapshotManagerBase projectManager)
 {
 }