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


C# ImmutableDictionary.Select方法代码示例

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


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

示例1: GetFixAsync

        internal sealed override async Task<CodeAction> GetFixAsync(
            ImmutableDictionary<Document, ImmutableArray<Diagnostic>> documentsAndDiagnosticsToFixMap, 
            FixAllState fixAllState, 
            CancellationToken cancellationToken)
        {
            // Process all documents in parallel.
            var updatedDocumentTasks = documentsAndDiagnosticsToFixMap.Select(
                kvp => FixDocumentAsync(kvp.Key, kvp.Value, cancellationToken));

            await Task.WhenAll(updatedDocumentTasks).ConfigureAwait(false);

            var currentSolution = fixAllState.Solution;
            foreach (var task in updatedDocumentTasks)
            {
                // 'await' the tasks so that if any completed in a cancelled manner then we'll
                // throw the right exception here.  Calling .Result on the tasks might end up
                // with AggregateExceptions being thrown instead.
                var updatedDocument = await task.ConfigureAwait(false);
                currentSolution = currentSolution.WithDocumentSyntaxRoot(
                    updatedDocument.Id,
                    await updatedDocument.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false));
            }

            var title = fixAllState.GetDefaultFixAllTitle();
            return new CodeAction.SolutionChangeAction(title, _ => Task.FromResult(currentSolution));
        }
开发者ID:jkotas,项目名称:roslyn,代码行数:26,代码来源:DocumentBasedFixAllProvider.cs

示例2: UpdateStockData

 public void UpdateStockData(FullStockData data)
 {
     StockData = StockData.SetItem(data.Symbol, new Tuple<Quote, IFeed>(data.Quote, data.Headlines));
     this.lstDownloadedStocks.Items.Clear();
     lstDownloadedStocks.Items.AddRange(StockData.Select(x => new ListViewItem(x.Key)).ToArray());
 }
开发者ID:juergenhoetzel,项目名称:akka.net,代码行数:6,代码来源:MainForm.cs

示例3: Create

 public static InsertStatement Create(Table table, ImmutableDictionary<string, object> data, DataContext context)
 {
     var parameters = data.Select(kvp => new Parameter(kvp.Key, kvp.Value)).ToArray();
     return new InsertStatement(table, data.Keys.ToArray(), parameters);
 }
开发者ID:RendleLabs,项目名称:Simple.Data.Core,代码行数:5,代码来源:InsertStatement.cs


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