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


C# ImmutableDictionary.First方法代码示例

本文整理汇总了C#中ImmutableDictionary.First方法的典型用法代码示例。如果您正苦于以下问题:C# ImmutableDictionary.First方法的具体用法?C# ImmutableDictionary.First怎么用?C# ImmutableDictionary.First使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ImmutableDictionary的用法示例。


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

示例1: Create

 /// <summary>
 /// Creates a new <see cref="FixMultipleContext"/>.
 /// Use this overload when applying fix multiple diagnostics with a source location.
 /// </summary>
 /// <param name="diagnosticsToFix">Specific set of diagnostics to fix. Must be a non-empty set.</param>
 /// <param name="codeFixProvider">Underlying <see cref="CodeFixes.CodeFixProvider"/> which triggered this fix all.</param>
 /// <param name="codeActionEquivalenceKey">The <see cref="CodeAction.EquivalenceKey"/> value expected of a <see cref="CodeAction"/> participating in this fix all.</param>
 /// <param name="cancellationToken">Cancellation token for fix all computation.</param>
 public static FixMultipleContext Create(
     ImmutableDictionary<Project, ImmutableArray<Diagnostic>> diagnosticsToFix,
     CodeFixProvider codeFixProvider,
     string codeActionEquivalenceKey,
     CancellationToken cancellationToken)
 {
     var triggerProject = diagnosticsToFix.First().Key;
     var diagnosticIds = GetDiagnosticsIds(diagnosticsToFix.Values);
     var diagnosticProvider = new FixMultipleDiagnosticProvider(diagnosticsToFix);
     return new FixMultipleContext(triggerProject, codeFixProvider, codeActionEquivalenceKey, diagnosticIds, diagnosticProvider, cancellationToken);
 }
开发者ID:nemec,项目名称:roslyn,代码行数:19,代码来源:FixMultipleContext.cs

示例2: GetFix

        public Solution GetFix(
            ImmutableDictionary<Project, ImmutableArray<Diagnostic>> diagnosticsToFix,
            Workspace workspace,
            CodeFixProvider fixProvider,
            FixAllProvider fixAllProvider,
            string equivalenceKey,
            string waitDialogTitle,
            string waitDialogMessage,
            CancellationToken cancellationToken)
        {
            var fixMultipleState = FixAllState.Create(fixAllProvider, diagnosticsToFix, fixProvider, equivalenceKey);
            var triggerDiagnostic = diagnosticsToFix.First().Value.First();

            var suggestedAction = GetSuggestedAction(fixMultipleState, triggerDiagnostic, workspace, waitDialogTitle, waitDialogMessage, showPreviewChangesDialog: false, cancellationToken: cancellationToken);
            return suggestedAction.GetChangedSolution(cancellationToken);
        }
开发者ID:Rickinio,项目名称:roslyn,代码行数:16,代码来源:FixMultipleOccurrencesService.cs

示例3: GetFix

        public Solution GetFix(
            ImmutableDictionary<Document, ImmutableArray<Diagnostic>> diagnosticsToFix,
            Workspace workspace,
            CodeFixProvider fixProvider,
            FixAllProvider fixAllProvider,
            string equivalenceKey,
            string waitDialogTitle,
            string waitDialogMessage,
            CancellationToken cancellationToken)
        {
            var fixMultipleState = FixAllState.Create(fixAllProvider, diagnosticsToFix, fixProvider, equivalenceKey);
            var triggerDiagnostic = diagnosticsToFix.First().Value.First();

            var result = GetFixedSolution(
                fixMultipleState, triggerDiagnostic, workspace,
                waitDialogTitle, waitDialogMessage, cancellationToken);
            return result;
        }
开发者ID:genlu,项目名称:roslyn,代码行数:18,代码来源:FixMultipleOccurrencesService.cs

示例4: Create

 internal static FixAllState Create(
     FixAllProvider fixAllProvider,
     ImmutableDictionary<Project, ImmutableArray<Diagnostic>> diagnosticsToFix,
     CodeFixProvider codeFixProvider,
     string codeActionEquivalenceKey)
 {
     var triggerProject = diagnosticsToFix.First().Key;
     var diagnosticIds = GetDiagnosticsIds(diagnosticsToFix.Values);
     var diagnosticProvider = new FixMultipleDiagnosticProvider(diagnosticsToFix);
     return new FixAllState(
         fixAllProvider,
         triggerProject, codeFixProvider, 
         FixAllScope.Custom, codeActionEquivalenceKey, 
         diagnosticIds, diagnosticProvider);
 }
开发者ID:Rickinio,项目名称:roslyn,代码行数:15,代码来源:FixAllState.cs


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