本文整理汇总了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));
}
示例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());
}
示例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);
}