public override void Disconnect()
        {
            // project is going away
            this.EditAndContinueImplOpt = null;

            base.Disconnect();
        }
 public AbstractRoslynProject(
     VisualStudioProjectTracker projectTracker,
     Func<ProjectId, IVsReportExternalErrors> reportExternalErrorCreatorOpt,
     string projectSystemName,
     IVsHierarchy hierarchy,
     string language,
     IServiceProvider serviceProvider,
     VisualStudioWorkspaceImpl visualStudioWorkspaceOpt,
     HostDiagnosticUpdateSource hostDiagnosticUpdateSourceOpt)
     : base(projectTracker, reportExternalErrorCreatorOpt, projectSystemName, hierarchy, language, serviceProvider, visualStudioWorkspaceOpt, hostDiagnosticUpdateSourceOpt)
 {
     if (visualStudioWorkspaceOpt != null)
     {
         this.EditAndContinueImplOpt = new VsENCRebuildableProjectImpl(this);
     }
 }
Beispiel #3
0
        public AbstractProject(
            VisualStudioProjectTracker projectTracker,
            Func<ProjectId, IVsReportExternalErrors> reportExternalErrorCreatorOpt,
            string projectSystemName,
            IVsHierarchy hierarchy,
            string language,
            IServiceProvider serviceProvider,
            MiscellaneousFilesWorkspace miscellaneousFilesWorkspaceOpt,
            VisualStudioWorkspaceImpl visualStudioWorkspaceOpt,
            HostDiagnosticUpdateSource hostDiagnosticUpdateSourceOpt)
        {
            Contract.ThrowIfNull(projectSystemName);

            _language = language;
            this.ServiceProvider = serviceProvider;
            _hierarchy = hierarchy;

            var componentModel = (IComponentModel)serviceProvider.GetService(typeof(SComponentModel));

            _contentTypeRegistryService = componentModel.GetService<IContentTypeRegistryService>();
            this.RunningDocumentTable = (IVsRunningDocumentTable4)serviceProvider.GetService(typeof(SVsRunningDocumentTable));

            this.DisplayName = _projectSystemName;
            _projectSystemName = projectSystemName;
            this.ProjectTracker = projectTracker;
            _miscellaneousFilesWorkspaceOpt = miscellaneousFilesWorkspaceOpt;
            _visualStudioWorkspaceOpt = visualStudioWorkspaceOpt;
            _hostDiagnosticUpdateSourceOpt = hostDiagnosticUpdateSourceOpt;

            UpdateProjectDisplayNameAndFilePath();

            if (_filePathOpt != null)
            {
                _version = VersionStamp.Create(File.GetLastWriteTimeUtc(_filePathOpt));
            }
            else
            {
                _version = VersionStamp.Create();
            }

            _id = this.ProjectTracker.GetOrCreateProjectIdForPath(_filePathOpt ?? _projectSystemName, _projectSystemName);
            if (reportExternalErrorCreatorOpt != null)
            {
                _externalErrorReporter = reportExternalErrorCreatorOpt(_id);
            }

            if (visualStudioWorkspaceOpt != null)
            {
                this.EditAndContinueImplOpt = new VsENCRebuildableProjectImpl(this);
            }

            ConnectHierarchyEvents();

            SetIsWebstite(hierarchy);
        }
 public VsActiveStatement(VsENCRebuildableProjectImpl owner, uint statementId, DocumentId documentId, ActiveStatementSpan span)
 {
     this.Owner = owner;
     this.StatementId = statementId;
     this.DocumentId = documentId;
     this.Span = span;
 }