本文整理汇总了C#中ImmutableList.Select方法的典型用法代码示例。如果您正苦于以下问题:C# ImmutableList.Select方法的具体用法?C# ImmutableList.Select怎么用?C# ImmutableList.Select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImmutableList
的用法示例。
在下文中一共展示了ImmutableList.Select方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateFilter
public static EventFilter CreateFilter(EventKind internalEventKind, JvmtiEnvironment environment, JniEnvironment nativeEnvironment, RequestId requestId, SuspendPolicy suspendPolicy, ImmutableList<EventRequestModifier> modifiers)
{
if (modifiers.Count == 0)
return new PassThroughEventFilter(internalEventKind, requestId, suspendPolicy, modifiers);
EventFilter[] elements = modifiers.Select(modifier => CreateFilter(internalEventKind, environment, nativeEnvironment, requestId, suspendPolicy, modifiers, modifier)).ToArray();
if (elements.Length == 1)
return elements[0];
return new AggregateEventFilter(internalEventKind, requestId, suspendPolicy, modifiers, elements);
}
示例2: CreateCloudWords
public ImmutableList<TagCloudWord> CreateCloudWords(ImmutableList<FrequencyWord> frequencyWords)
{
var freqs = frequencyWords
.Select(x => x.Frequency)
.Distinct()
.OrderByDescending(x => x)
.ToImmutableList();
using (fontSelector.Configure(freqs))
using (brushSelector.Configure(freqs))
using (rectSelector.Configure(freqs))
return CreateCloudWordUsingSelectors(frequencyWords).ToImmutableList();
}
示例3: GetModels
private static IReadOnlyList<TypeScriptClass> GetModels(ImmutableList<SourceFileProcessor> processors)
{
var models = new List<TypeScriptClass>();
var classNames = processors.Select(p => p.ClassName).ToImmutableList();
var classNamesToProperties = processors.ToDictionary(processor => processor.ClassName, processor => processor.GetProperties(classNames));
foreach (var classToProperty in classNamesToProperties)
{
var references = classToProperty.Value.Where(p => classNames.Contains(p.Type) && p.Type != classToProperty.Key).Select(p => p.Type).Distinct().ToImmutableList();
models.Add(new TypeScriptClass(classToProperty.Key, classToProperty.Value, references));
}
return models.ToImmutableList();
}
示例4: Workspace
private Workspace(DirectoryInfo dir, Entry tree,
ImmutableList<string> projects)
{
_dir = dir;
_tree = tree;
_projects = projects;
_projectCache = new Lazy<ImmutableList<ProjectEntry>>(() => _projects.Select(p => FindProject(_tree, p)).ToImmutableList());
_errorList = new Lazy<ImmutableList<DiagnosticMessage>>(() =>
{
var diagnostics = ImmutableList.CreateBuilder<DiagnosticMessage>();
foreach (var project in _projectCache.Value)
diagnostics.AddRange(project.Diagnostics);
return diagnostics.ToImmutable();
});
}
示例5: Step
private Step(Step step, Tuple<IEnumerable<Cell>, int> pointsNCells)
{
height = step.height;
width = step.width;
commandIndex = step.commandIndex + 1;
points = step.points + pointsNCells.Item2;
Pieces = step.Pieces;
CurrentPieceCells = Pieces[step.pieceIndex].Cells;
UsedCells = pointsNCells.Item1.ToImmutableHashSet();
Center = GetShift(CurrentPieceCells);
RunningCells = CurrentPieceCells.Select(c => new Cell(c + Center)).ToImmutableHashSet();
pieceIndex = (step.pieceIndex + 1) % step.Pieces.Count;
}
示例6: CreateAggregateMessage
private static Message CreateAggregateMessage(
Guid searchTermId,
ImmutableList<Message> searchResultMessages)
{
var aggregateMessage = Message.CreateMessage(
searchTermId.ToCanonicalString(),
"Aggregate",
Predecessors.Set
.In("SearchResult", searchResultMessages.Select(r => r.Hash)),
searchTermId,
new { });
return aggregateMessage;
}
示例7: DeQueue
static ImmutableList<Order> DeQueue(ImmutableList<Order> orders, DateTime currentTime)
{
return orders.Select(order => order.Status == OrderStatus.InQueue && order.ToTime <= currentTime ? order.With(status: OrderStatus.New, products: order.Products.Select(product => product.With(status: ProductStatus.New)).ToImmutableArray()) : order).ToImmutableList();
}
示例8: Create
// TODO: param name should be optional
public static FunctionType Create(ExprType returnType, ImmutableList<Tuple<Option<String>, ExprType>> args, Boolean hasVarArgs) =>
Create(returnType, args.Select(_ => Tuple.Create(_.Item1.IsSome ? _.Item1.Value : "", _.Item2)).ToList(), hasVarArgs);