本文整理汇总了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;
}
}
示例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;
}
示例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));
}
}
示例4: ClearAnalyzerDiagnostics
private void ClearAnalyzerDiagnostics(ImmutableArray<DiagnosticAnalyzer> analyzers, ProjectId projectId)
{
foreach (var analyzer in analyzers)
{
ClearAnalyzerDiagnostics(analyzer, projectId);
}
}
示例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;
}
示例6: RemoveProject
public void RemoveProject(ProjectId projectId)
{
long unused;
_map.TryRemove(projectId, out unused);
_size = _map.Values.Sum();
}
示例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));
}
示例8: UpdateReferences
public void UpdateReferences(ProjectId projectId, FrameworkProject frameworkProject)
{
DnxProject project = FindProject (projectId);
if (project != null) {
UpdateReferences (project, frameworkProject);
}
}
示例9: AbstractAddRemoveUndoUnit
protected AbstractAddRemoveUndoUnit(
VisualStudioWorkspaceImpl workspace,
ProjectId fromProjectId)
{
Workspace = workspace;
FromProjectId = fromProjectId;
}
示例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));
}
});
}
示例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;
}
示例12: UpdatedEventArgs
public UpdatedEventArgs(object id, Workspace workspace, ProjectId projectId, DocumentId documentId)
{
this.Id = id;
this.Workspace = workspace;
this.ProjectId = projectId;
this.DocumentId = documentId;
}
示例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;
}
示例14: ActionAssignedToProject
public ActionAssignedToProject(TenantId id, ActionId action, ProjectId newProject, DateTime timeUtc)
{
Id = id;
Action = action;
NewProject = newProject;
TimeUtc = timeUtc;
}
示例15: RemoveProject
public void RemoveProject(ProjectId projectId)
{
foreach (var documentId in _map.Keys.Where(id => id.ProjectId == projectId).ToArray())
{
RemoveDocument(documentId);
}
}