本文整理汇总了C#中StateSet.IsActiveFile方法的典型用法代码示例。如果您正苦于以下问题:C# StateSet.IsActiveFile方法的具体用法?C# StateSet.IsActiveFile怎么用?C# StateSet.IsActiveFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StateSet
的用法示例。
在下文中一共展示了StateSet.IsActiveFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RaiseProjectDiagnosticsCreated
private void RaiseProjectDiagnosticsCreated(Project project, StateSet stateSet, DiagnosticAnalysisResult oldAnalysisResult, DiagnosticAnalysisResult newAnalysisResult, Action<DiagnosticsUpdatedArgs> raiseEvents)
{
foreach (var documentId in newAnalysisResult.DocumentIds)
{
var document = project.GetDocument(documentId);
if (document == null)
{
// it can happen with build synchronization since, in build case,
// we don't have actual snapshot (we have no idea what sources out of proc build has picked up)
// so we might be out of sync.
// example of such cases will be changing anything about solution while building is going on.
// it can be user explict actions such as unloading project, deleting a file, but also it can be
// something project system or roslyn workspace does such as populating workspace right after
// solution is loaded.
continue;
}
RaiseDocumentDiagnosticsIfNeeded(document, stateSet, AnalysisKind.NonLocal, oldAnalysisResult, newAnalysisResult, raiseEvents);
// we don't raise events for active file. it will be taken cared by active file analysis
if (stateSet.IsActiveFile(documentId))
{
continue;
}
RaiseDocumentDiagnosticsIfNeeded(document, stateSet, AnalysisKind.Syntax, oldAnalysisResult, newAnalysisResult, raiseEvents);
RaiseDocumentDiagnosticsIfNeeded(document, stateSet, AnalysisKind.Semantic, oldAnalysisResult, newAnalysisResult, raiseEvents);
}
RaiseDiagnosticsCreated(project, stateSet, newAnalysisResult.Others, raiseEvents);
}
示例2: RaiseProjectDiagnosticsRemoved
private void RaiseProjectDiagnosticsRemoved(StateSet stateSet, ProjectId projectId, IEnumerable<DocumentId> documentIds, bool handleActiveFile, Action<DiagnosticsUpdatedArgs> raiseEvents)
{
Solution nullSolution = null;
foreach (var documentId in documentIds)
{
RaiseDiagnosticsRemoved(documentId, nullSolution, stateSet, AnalysisKind.NonLocal, raiseEvents);
// we don't raise events for active file. it will be taken cared by active file analysis
if (!handleActiveFile && stateSet.IsActiveFile(documentId))
{
continue;
}
RaiseDiagnosticsRemoved(documentId, nullSolution, stateSet, AnalysisKind.Syntax, raiseEvents);
RaiseDiagnosticsRemoved(documentId, nullSolution, stateSet, AnalysisKind.Semantic, raiseEvents);
}
RaiseDiagnosticsRemoved(projectId, nullSolution, stateSet, raiseEvents);
}
示例3: RaiseProjectDiagnosticsCreated
private void RaiseProjectDiagnosticsCreated(Project project, StateSet stateSet, AnalysisResult oldAnalysisResult, AnalysisResult newAnalysisResult, Action<DiagnosticsUpdatedArgs> raiseEvents)
{
foreach (var documentId in newAnalysisResult.DocumentIds)
{
var document = project.GetDocument(documentId);
Contract.ThrowIfNull(document);
RaiseDocumentDiagnosticsIfNeeded(document, stateSet, AnalysisKind.NonLocal, oldAnalysisResult, newAnalysisResult, raiseEvents);
// we don't raise events for active file. it will be taken cared by active file analysis
if (stateSet.IsActiveFile(documentId))
{
continue;
}
RaiseDocumentDiagnosticsIfNeeded(document, stateSet, AnalysisKind.Syntax, oldAnalysisResult, newAnalysisResult, raiseEvents);
RaiseDocumentDiagnosticsIfNeeded(document, stateSet, AnalysisKind.Semantic, oldAnalysisResult, newAnalysisResult, raiseEvents);
}
RaiseDiagnosticsCreated(project, stateSet, newAnalysisResult.Others, raiseEvents);
}