当前位置: 首页>>代码示例>>C#>>正文


C# ProjectId类代码示例

本文整理汇总了C#中ProjectId的典型用法代码示例。如果您正苦于以下问题:C# ProjectId类的具体用法?C# ProjectId怎么用?C# ProjectId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ProjectId类属于命名空间,在下文中一共展示了ProjectId类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RaiseWorkspaceChangedEventAsync

        protected Task RaiseWorkspaceChangedEventAsync(WorkspaceChangeKind kind, Solution oldSolution, Solution newSolution, ProjectId projectId = null, DocumentId documentId = null)
        {
            if (newSolution == null)
            {
                throw new ArgumentNullException(nameof(newSolution));
            }

            if (oldSolution == newSolution)
            {
                return SpecializedTasks.EmptyTask;
            }

            if (projectId == null && documentId != null)
            {
                projectId = documentId.ProjectId;
            }

            var ev = _eventMap.GetEventHandlers<EventHandler<WorkspaceChangeEventArgs>>(WorkspaceChangeEventName);
            if (ev.HasHandlers)
            {
                return this.ScheduleTask(() =>
                {
                    var args = new WorkspaceChangeEventArgs(kind, oldSolution, newSolution, projectId, documentId);
                    ev.RaiseEvent(handler => handler(this, args));
                }, "Workspace.WorkspaceChanged");
            }
            else
            {
                return SpecializedTasks.EmptyTask;
            }
        }
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:31,代码来源:Workspace_Events.cs

示例2: DiagnosticsUpdatedArgs

 public DiagnosticsUpdatedArgs(
     object id, Workspace workspace, Solution solution, ProjectId projectId, DocumentId documentId, ImmutableArray<DiagnosticData> diagnostics) :
         base(id, workspace, projectId, documentId)
 {
     this.Solution = solution;
     this.Diagnostics = diagnostics;
 }
开发者ID:nileshjagtap,项目名称:roslyn,代码行数:7,代码来源:DiagnosticsUpdatedArgs.cs

示例3: ReportAnalyzerDiagnostic

        internal void ReportAnalyzerDiagnostic(DiagnosticAnalyzer analyzer, Diagnostic diagnostic, Workspace workspace, ProjectId projectId)
        {
            if (workspace != this.Workspace)
            {
                return;
            }

            var project = workspace.CurrentSolution.GetProject(projectId);

            bool raiseDiagnosticsUpdated = true;
            var diagnosticData = project != null ?
                DiagnosticData.Create(project, diagnostic) :
                DiagnosticData.Create(this.Workspace, diagnostic);

            var dxs = ImmutableInterlocked.AddOrUpdate(ref s_analyzerHostDiagnosticsMap,
                analyzer,
                ImmutableHashSet.Create(diagnosticData),
                (a, existing) =>
                {
                    var newDiags = existing.Add(diagnosticData);
                    raiseDiagnosticsUpdated = newDiags.Count > existing.Count;
                    return newDiags;
                });

            if (raiseDiagnosticsUpdated)
            {
                RaiseDiagnosticsUpdated(MakeArgs(analyzer, dxs, project));
            }
        }
开发者ID:ehsansajjad465,项目名称:roslyn,代码行数:29,代码来源:AbstractHostDiagnosticUpdateSource.cs

示例4: ClearAnalyzerDiagnostics

 private void ClearAnalyzerDiagnostics(ImmutableArray<DiagnosticAnalyzer> analyzers, ProjectId projectId)
 {
     foreach (var analyzer in analyzers)
     {
         ClearAnalyzerDiagnostics(analyzer, projectId);
     }
 }
开发者ID:ehsansajjad465,项目名称:roslyn,代码行数:7,代码来源:AbstractHostDiagnosticUpdateSource.cs

示例5: DiagnosticGetter

            public DiagnosticGetter(
                DiagnosticIncrementalAnalyzer owner,
                Solution solution,
                ProjectId projectId,
                DocumentId documentId,
                object id,
                bool includeSuppressedDiagnostics)
            {
                Owner = owner;
                CurrentSolution = solution;

                CurrentDocumentId = documentId;
                CurrentProjectId = projectId ?? documentId?.ProjectId;

                Id = id;
                IncludeSuppressedDiagnostics = includeSuppressedDiagnostics;

                // try to retrieve projectId/documentId from id if possible.
                var argsId = id as LiveDiagnosticUpdateArgsId;
                if (argsId != null)
                {
                    CurrentDocumentId = CurrentDocumentId ?? argsId.Key as DocumentId;
                    CurrentProjectId = CurrentProjectId ?? (argsId.Key as ProjectId) ?? CurrentDocumentId.ProjectId;
                }

                _builder = null;
            }
开发者ID:TyOverby,项目名称:roslyn,代码行数:27,代码来源:DiagnosticIncrementalAnalyzer_GetDiagnostics.cs

示例6: RemoveProject

            public void RemoveProject(ProjectId projectId)
            {
                long unused;
                _map.TryRemove(projectId, out unused);

                _size = _map.Values.Sum();
            }
开发者ID:furesoft,项目名称:roslyn,代码行数:7,代码来源:SolutionSizeTracker.cs

示例7: CreateSolution

        protected override Solution CreateSolution(ProjectId projectId, string language)
        {
            Solution solution = base.CreateSolution(projectId, language);
            Project project = solution.GetProject(projectId);

            return solution.WithProjectParseOptions(projectId, project.ParseOptions.WithDocumentationMode(this.documentationMode));
        }
开发者ID:Romanx,项目名称:StyleCopAnalyzers,代码行数:7,代码来源:SA0001UnitTests.cs

示例8: UpdateReferences

 public void UpdateReferences(ProjectId projectId, FrameworkProject frameworkProject)
 {
     DnxProject project = FindProject (projectId);
     if (project != null) {
         UpdateReferences (project, frameworkProject);
     }
 }
开发者ID:lordfinal,项目名称:monodevelop-dnx-addin,代码行数:7,代码来源:AspNetProjectReferenceMaintainer.cs

示例9: AbstractAddRemoveUndoUnit

 protected AbstractAddRemoveUndoUnit(
     VisualStudioWorkspaceImpl workspace,
     ProjectId fromProjectId)
 {
     Workspace = workspace;
     FromProjectId = fromProjectId;
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:7,代码来源:VisualStudioWorkspaceImpl.AbstractAddRemoveUndoUnit.cs

示例10: ActionDisplay

        void IProjectView.ShowView(FilteredProject project)
        {
            _region.SwitchTo("project-view");

            this.Sync(() =>
                {
                    _project = project.Info.ProjectId;
                    _projectName.Text = string.Format("{0} ({1})", project.Info.Outcome, project.ActionCount);

                    // TODO: smarter update for the case when we remove item
                    if (_source.Count == project.FilteredActions.Count)
                    {
                        for (int i = 0; i < project.FilteredActions.Count; i++)
                        {
                            _source[i] = new ActionDisplay(project.FilteredActions[i], this);
                        }
                        return;
                    }

                    _source.Clear();
                    foreach (var action in project.FilteredActions)
                    {
                        _source.Add(new ActionDisplay(action, this));
                    }
                });
        }
开发者ID:beingtheworst,项目名称:btw-gtd,代码行数:26,代码来源:ProjectView.cs

示例11: CreateDiagnostic

        private DiagnosticData CreateDiagnostic(ProjectId projectId, AnalyzerDependencyConflict conflict)
        {
            string id = ServicesVSResources.WRN_AnalyzerDependencyConflictId;
            string category = ServicesVSResources.ErrorCategory;
            string message = string.Format(
                ServicesVSResources.WRN_AnalyzerDependencyConflictMessage,
                conflict.DependencyFilePath1,
                Path.GetFileNameWithoutExtension(conflict.AnalyzerFilePath1),
                conflict.DependencyFilePath2,
                Path.GetFileNameWithoutExtension(conflict.AnalyzerFilePath2));

            DiagnosticData data = new DiagnosticData(
                id,
                category,
                message,
                ServicesVSResources.WRN_AnalyzerDependencyConflictMessage,
                severity: DiagnosticSeverity.Warning,
                defaultSeverity: DiagnosticSeverity.Warning,
                isEnabledByDefault: true,
                warningLevel: 0,
                customTags: ImmutableArray<string>.Empty,
                workspace: _workspace,
                projectId: projectId);

            return data;
        }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:26,代码来源:AnalyzerDependencyCheckingService.cs

示例12: UpdatedEventArgs

 public UpdatedEventArgs(object id, Workspace workspace, ProjectId projectId, DocumentId documentId)
 {
     this.Id = id;
     this.Workspace = workspace;
     this.ProjectId = projectId;
     this.DocumentId = documentId;
 }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:7,代码来源:UpdatedEventArgs.cs

示例13: TodoItemsUpdatedArgs

 public TodoItemsUpdatedArgs(
     object id, Workspace workspace, Solution solution, ProjectId projectId, DocumentId documentId, ImmutableArray<TodoItem> todoItems) :
     base(id, workspace, projectId, documentId)
 {
     this.Solution = solution;
     this.TodoItems = todoItems;
 }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:7,代码来源:TodoItemsUpdatedArgs.cs

示例14: ActionAssignedToProject

 public ActionAssignedToProject(TenantId id, ActionId action, ProjectId newProject, DateTime timeUtc)
 {
     Id = id;
     Action = action;
     NewProject = newProject;
     TimeUtc = timeUtc;
 }
开发者ID:jcwrequests,项目名称:btw-gtd,代码行数:7,代码来源:Messages.cs

示例15: RemoveProject

 public void RemoveProject(ProjectId projectId)
 {
     foreach (var documentId in _map.Keys.Where(id => id.ProjectId == projectId).ToArray())
     {
         RemoveDocument(documentId);
     }
 }
开发者ID:GuilhermeSa,项目名称:roslyn,代码行数:7,代码来源:SemanticChangeNotificationService.cs


注:本文中的ProjectId类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。