本文整理汇总了C#中ProjectId类的典型用法代码示例。如果您正苦于以下问题:C# ProjectId类的具体用法?C# ProjectId怎么用?C# ProjectId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProjectId类属于命名空间,在下文中一共展示了ProjectId类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: DiagnosticData
public DiagnosticData(
string id,
string category,
string message,
string enuMessageForBingSearch,
DiagnosticSeverity severity,
bool isEnabledByDefault,
int warningLevel,
Workspace workspace,
ProjectId projectId,
DocumentId documentId = null,
TextSpan? span = null,
string originalFilePath = null,
int originalStartLine = 0,
int originalStartColumn = 0,
int originalEndLine = 0,
int originalEndColumn = 0,
string title = null,
string description = null,
string helpLink = null) :
this(
id, category, message, enuMessageForBingSearch,
severity, severity, isEnabledByDefault, warningLevel,
ImmutableArray<string>.Empty, ImmutableDictionary<string, string>.Empty,
workspace, projectId, documentId, span,
null, originalStartLine, originalStartColumn, originalEndLine, originalEndColumn,
originalFilePath, originalStartLine, originalStartColumn, originalEndLine, originalEndColumn,
title, description, helpLink)
{
}
开发者ID:reidwooten99apps,项目名称:roslyn,代码行数:30,代码来源:DiagnosticData.cs
示例17: GetCompilationAsync
public async Task<Compilation> GetCompilationAsync(Checksum solutionChecksum, ProjectId projectId, CancellationToken cancellationToken)
{
var solution = await RoslynServices.SolutionService.GetSolutionAsync(solutionChecksum, cancellationToken).ConfigureAwait(false);
// TODO: need to figure out how to deal with exceptions in service hub
return await solution.GetProject(projectId).GetCompilationAsync(cancellationToken).ConfigureAwait(false);
}
开发者ID:Rickinio,项目名称:roslyn,代码行数:7,代码来源:CompilationService.cs
示例18: GetDiagnosticsAsync
public async Task<ImmutableArray<DiagnosticData>> GetDiagnosticsAsync(Solution solution, ProjectId projectId, DocumentId documentId, CancellationToken cancellationToken)
{
if (solution == null)
{
return GetDiagnosticData();
}
if (documentId != null)
{
var document = solution.GetDocument(documentId);
await AppendDiagnosticsAsync(document, cancellationToken).ConfigureAwait(false);
await AppendProjectAndDocumentDiagnosticsAsync(document.Project, document, d => d.DocumentId == documentId, cancellationToken).ConfigureAwait(false);
return GetDiagnosticData();
}
if (projectId != null)
{
await AppendDiagnosticsAsync(solution.GetProject(projectId), cancellationToken: cancellationToken).ConfigureAwait(false);
return GetDiagnosticData();
}
await AppendDiagnosticsAsync(solution, cancellationToken: cancellationToken).ConfigureAwait(false);
return GetDiagnosticData();
}
开发者ID:daking2014,项目名称:roslyn,代码行数:25,代码来源:DiagnosticIncrementalAnalyzer_GetDiagnostics.cs
示例19: SolutionPreviewItem
public SolutionPreviewItem(ProjectId projectId, DocumentId documentId, string text)
{
ProjectId = projectId;
DocumentId = documentId;
Text = text;
LazyPreview = c => Task.FromResult<object>(text);
}
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:7,代码来源:SolutionPreviewItem.cs
示例20: GetFolders
public IList<string> GetFolders(ProjectId projectId, Workspace workspace)
{
var folders = new List<string>();
if (workspace is VisualStudioWorkspaceImpl)
{
((VisualStudioWorkspaceImpl)workspace).GetProjectData(projectId, out var ivisualStudioHostProject, out var hierarchy, out var envDTEProject);
var projectItems = envDTEProject.ProjectItems;
var projectItemsStack = new Stack<Tuple<ProjectItem, string>>();
// Populate the stack
projectItems.OfType<ProjectItem>().Where(n => n.IsFolder()).Do(n => projectItemsStack.Push(Tuple.Create(n, "\\")));
while (projectItemsStack.Count != 0)
{
var projectItemTuple = projectItemsStack.Pop();
var projectItem = projectItemTuple.Item1;
var currentFolderPath = projectItemTuple.Item2;
var folderPath = currentFolderPath + projectItem.Name + "\\";
folders.Add(folderPath);
projectItem.ProjectItems.OfType<ProjectItem>().Where(n => n.IsFolder()).Do(n => projectItemsStack.Push(Tuple.Create(n, folderPath)));
}
}
return folders;
}
开发者ID:GuilhermeSa,项目名称:roslyn,代码行数:29,代码来源:VisualStudioProjectManagementService.cs
注:本文中的ProjectId类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论