本文整理汇总了C#中Tuple.Select方法的典型用法代码示例。如果您正苦于以下问题:C# Tuple.Select方法的具体用法?C# Tuple.Select怎么用?C# Tuple.Select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tuple
的用法示例。
在下文中一共展示了Tuple.Select方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MultipleTimeSeries
public MultipleTimeSeries(Tuple<TimeSeriesLink, TimeSeries>[] src,bool includeValues = true)
{
if(includeValues)
TimeSeries = src.Select(item => new SlimTimeSeries(item.Item1,item.Item2)).ToArray();
else
TimeSeries = src.Select(item => new TimeSeriesFullSummary(item.Item1, item.Item2)).ToArray();
}
示例2: ChunkTable
public ChunkTable(GameSave gameSave, Tuple<int, int, Chunk>[] chunks)
: this(gameSave,
chunks.Select(x => x.Item1).ToArray(),
chunks.Select(x => x.Item2).ToArray(),
chunks.Select(x => x.Item3).ToArray())
{
}
示例3: PropertyChoicesFacetViaMethod
public PropertyChoicesFacetViaMethod(MethodInfo optionsMethod, IFacetHolder holder)
: base(holder) {
method = optionsMethod;
parameterNamesAndTypes = optionsMethod.GetParameters().Select(p => new Tuple<string, INakedObjectSpecification>(p.Name.ToLower(), NakedObjectsContext.Reflector.LoadSpecification(p.ParameterType))).ToArray();
parameterNames = parameterNamesAndTypes.Select(pnt => pnt.Item1).ToArray();
}
示例4: TableRenderer
public TableRenderer(string title, Tuple<string, int>[] headers)
{
_title = title;
_headers = headers;
_totalWidth = _headers.Sum(h => h.Item2) + (_headers.Count() - 1) * 3;
_rowTemplate = "| " + String.Join(" | ", _headers.Select((h, i) => "{" + i + ",-" + h.Item2 + "}").ToArray()) + " |";
}
示例5: ItemsWithConflictingHighestScoreException
public ItemsWithConflictingHighestScoreException(Tuple<IValueProvider, IProbe>[] itemsWithConflictingScore, int highestScore)
: base(string.Format(
"items: {0} with conflicting highest score of {1} exists, cannot determine default", string.Concat(itemsWithConflictingScore.Select(x=>x.Item1.ToString())), highestScore))
{
ItemsWithConflictingScore = itemsWithConflictingScore;
HighestScore = highestScore;
}
示例6: GetItems
public LogItem[][] GetItems(Tuple<CriteriaType, DateTime, int, bool>[] parameters)
{
using (var connection = _connectionFactory.Create())
{
return parameters.Select(p => _repository.GetItems(connection, p.Item1, p.Item2, p.Item3, p.Item4)).ToArray();
}
}
示例7: AsString
public static string AsString(Tuple<string, object>[] keyValues)
{
return keyValues.Count() == 1
? keyValues.First().Item2 as string
: keyValues.Select(k => string.Format("{0}='{1}'", k.Item1, k.Item2))
.Aggregate((c, n) => c + "," + n);
}
示例8: ActionChoicesFacetViaMethod
public ActionChoicesFacetViaMethod(MethodInfo choicesMethod, Type choicesType, IFacetHolder holder, bool isMultiple = false)
: base(holder) {
this.choicesMethod = choicesMethod;
this.choicesType = choicesType;
this.isMultiple = isMultiple;
parameterNamesAndTypes = choicesMethod.GetParameters().Select(p => new Tuple<string, INakedObjectSpecification>(p.Name.ToLower(), NakedObjectsContext.Reflector.LoadSpecification(p.ParameterType))).ToArray();
parameterNames = parameterNamesAndTypes.Select(pnt => pnt.Item1).ToArray();
}
示例9: PropertyChoicesFacetx
public PropertyChoicesFacetx(MethodInfo optionsMethod, Tuple<string, IObjectSpecImmutable>[] parameterNamesAndTypes, ISpecification holder)
: base(typeof (IPropertyChoicesFacet), holder) {
method = optionsMethod;
this.parameterNamesAndTypes = parameterNamesAndTypes;
parameterNames = parameterNamesAndTypes.Select(pnt => pnt.Item1).ToArray();
methodDelegate = DelegateUtils.CreateDelegate(method);
}
示例10: Show
public void Show(string trainerMatchcode, Tuple<string,string>[] trainings, string error)
{
dynamic vm = new ExpandoObject();
vm.TrainerMatchcode = trainerMatchcode;
vm.Trainings = trainings.Select(tr => new {Id = tr.Item1, Matchcode = tr.Item2}).ToArray();
vm.Error = error;
_portal.SharedResponse = _portal.View["Trainingsuebersicht.Main.html", vm];
}
示例11: AwardMarks
public void AwardMarks(int awarderId, Tuple<int, int>[] guessMarks)
{
var player = new Player(awarderId);
var marks =
guessMarks.Select(
gm =>
Tuple.Create(this.repository.Query<IGuessDTO>(g => g.Id == gm.Item1).FirstOrDefault(), gm.Item2)).ToArray();
player.AwardMarks(marks);
}
示例12: AggregateBasketCollections
// aggregate all the basket consitituents data
public DatedDataCollectionGen<double> AggregateBasketCollections(Tuple<CustomBasket, DatedDataCollectionGen<double>>[] basketsWithData)
{
var results = basketsWithData.Select(basketData =>
{
var rolledSeries = RollOverBasket(basketData);
return rolledSeries.MultiplyBy(basketData.Item1.Weight);
});
return results.Add();
}
示例13: ActionChoicesFacetViaMethod
public ActionChoicesFacetViaMethod(MethodInfo choicesMethod, Tuple<string, IObjectSpecImmutable>[] parameterNamesAndTypes, Type choicesType, ISpecification holder, bool isMultiple = false)
: base(holder) {
this.choicesMethod = choicesMethod;
this.choicesType = choicesType;
IsMultiple = isMultiple;
ParameterNamesAndTypes = parameterNamesAndTypes;
parameterNames = parameterNamesAndTypes.Select(pnt => pnt.Item1).ToArray();
choicesDelegate = DelegateUtils.CreateDelegate(choicesMethod);
}
示例14: GetHandValue
static int[] GetHandValue(Tuple<int, string>[] hand)
{
Predicate<Tuple<int, string>[]> isFlush = c => c.Select(f => f.Item2).Distinct().Count() == 1;
List<int> handRanks = hand.Select(c => c.Item1).OrderByDescending(c => c).ToList();
int straightValue = IsStraight(handRanks);
if (isFlush(hand) && straightValue != -1)
return new int[] { 10, straightValue };
List<int> kind4 = HasSets(handRanks, new int[] { 4, 1 });
if (kind4 != null)
{
kind4.Insert(0, 9);
return kind4.ToArray();
}
List<int> kind32 = HasSets(handRanks, new int[] { 3, 2 });
if (kind32 != null)
{
kind32.Insert(0, 8);
return kind32.ToArray();
}
if (isFlush(hand))
return new int[] { 7, handRanks.Max() };
if (straightValue != -1)
return new int[] { 6, straightValue };
List<int> kind311 = HasSets(handRanks, new int[] { 3, 1, 1 });
if (kind311 != null)
{
kind311.Insert(0, 5);
return kind311.ToArray();
}
List<int> kind221 = HasSets(handRanks, new int[] { 2, 2, 1 });
if (kind221 != null)
{
kind221.Insert(0, 4);
return kind221.ToArray();
}
List<int> kind2111 = HasSets(handRanks, new int[] { 2, 1, 1, 1 });
if (kind2111 != null)
{
kind2111.Insert(0, 3);
return kind2111.ToArray();
}
handRanks.Insert(0, 0);
return handRanks.ToArray();
}
示例15: Setup
public void Setup()
{
queryable = new List<SomeModel>()
{
new SomeModel()
{
Category = 1,
DisplayName = "Cheddar",
Id = 123,
Scale = 123.456d,
Discounted = true
}
}.AsQueryable();
dataTablesParam = new DataTablesParam();
columns = TypeExtensions.GetSortedProperties<SomeModel>().Select((p, i) =>
Tuple.Create(i, new ColInfo(p.Name, p.PropertyType))).ToArray();
dataTablesParam.sSearchColumns = new List<string>(columns.Select(c => null as string));
dataTablesParam.bSearchable = new List<bool>(columns.Select(c => true));
}