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


C# Tuple.Select方法代码示例

本文整理汇总了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();
 }
开发者ID:flowmatters,项目名称:Veneer,代码行数:7,代码来源:MultipleTimeSeries.cs

示例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())
 {
 }
开发者ID:vashage,项目名称:MarsMiner,代码行数:7,代码来源:ChunkTable.cs

示例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();
        }
开发者ID:radi4music,项目名称:NakedObjectsFramework,代码行数:7,代码来源:PropertyChoicesFacetViaMethod.cs

示例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()) + " |";
 }
开发者ID:wurdum,项目名称:deployer,代码行数:7,代码来源:TableRenderer.cs

示例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;
 }
开发者ID:Tetnacious,项目名称:ByContext,代码行数:7,代码来源:ItemsWithConflictingHighestScoreException.cs

示例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();
     }
 }
开发者ID:phmi,项目名称:phmi,代码行数:7,代码来源:LogMaintainer.cs

示例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);
 }
开发者ID:iambmelt,项目名称:Vipr,代码行数:7,代码来源:ODataKeyPredicate.cs

示例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();
 }
开发者ID:radi4music,项目名称:NakedObjectsFramework,代码行数:8,代码来源:ActionChoicesFacetViaMethod.cs

示例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);
        }
开发者ID:Robin--,项目名称:NakedObjectsFramework,代码行数:8,代码来源:PropertyChoicesFacet.cs

示例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];
 }
开发者ID:ralfw,项目名称:instavote.open,代码行数:8,代码来源:TrainingsuebersichtDialog.cs

示例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);
 }
开发者ID:joe90p,项目名称:Telestrations,代码行数:9,代码来源:GameScoring.cs

示例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();            
 }
开发者ID:heimanhon,项目名称:researchwork,代码行数:10,代码来源:BasketDataAggregator.cs

示例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);
 }
开发者ID:NakedObjectsGroup,项目名称:NakedObjectsFramework,代码行数:9,代码来源:ActionChoicesFacetViaMethod.cs

示例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();
        }
开发者ID:TimothyPuffer,项目名称:euler54,代码行数:53,代码来源:euler54.cs

示例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));

        }
开发者ID:rasupit,项目名称:mvc.jquery.datatables,代码行数:21,代码来源:Tests.cs


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