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


C# IOrderedEnumerable.Select方法代码示例

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


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

示例1: DisplayPackageViewModel

        public DisplayPackageViewModel(Package package, IOrderedEnumerable<Package> packageHistory, bool isVersionHistory)
            : base(package)
        {
            Copyright = package.Copyright;

            if (!isVersionHistory)
            {
                Dependencies = new DependencySetsViewModel(package.Dependencies);
                PackageVersions = packageHistory.Select(p => new DisplayPackageViewModel(p, packageHistory, isVersionHistory: true));
            }

            DownloadCount = package.DownloadCount;
            LastEdited = package.LastEdited;

            if (!isVersionHistory && packageHistory.Any())
            {
                // calculate the number of days since the package registration was created
                // round to the nearest integer, with a min value of 1
                // divide the total download count by this number
                TotalDaysSinceCreated = Convert.ToInt32(Math.Max(1, Math.Round((DateTime.UtcNow - packageHistory.Last().Created).TotalDays)));
                DownloadsPerDay = TotalDownloadCount / TotalDaysSinceCreated; // for the package
            }
            else
            {
                TotalDaysSinceCreated = 0;
                DownloadsPerDay = 0;
            }
        }
开发者ID:ZhiYuanHuang,项目名称:NuGetGallery,代码行数:28,代码来源:DisplayPackageViewModel.cs

示例2: BurrowsWheelerTransform

 internal BurrowsWheelerTransform(IOrderedEnumerable<int[]> transform)
 {
     var y = transform.Select(v => new { F = v[0], L = v[2], S = v[1] }).ToArray();
     sorted = y.Select(v => v.F).ToArray();
     bwt = y.Select(v => v.L).ToArray();
     suffix = y.Select(v => v.S).ToArray();
     index = suffix.Select((s, i) => new { S = s, I = i }).OrderBy(v => v.S).Select(v => v.I).ToArray();
 }
开发者ID:dialectsoftware,项目名称:DialectSoftware.Text,代码行数:8,代码来源:BurrowsWheelerTransform.cs

示例3: Print

        private static void Print(IOrderedEnumerable<A> result)
        {
            var output = result.Select(a =>
                                           {
                                               Console.WriteLine(a.S);
                                               return a.S;
                                           });

        }
开发者ID:fr4nky80,项目名称:LearnCSharp,代码行数:9,代码来源:Sorting.cs

示例4: MeansOfTransportAsString

        public string MeansOfTransportAsString(IOrderedEnumerable<TransportMethod> meansOfTransport)
        {
            if (meansOfTransport == null || !meansOfTransport.Any())
            {
                return string.Empty;
            }

            return string.Join("-", meansOfTransport.Select(m => EnumHelper.GetShortName(m)));
        }
开发者ID:EnvironmentAgency,项目名称:prsd-iws,代码行数:9,代码来源:MeansOfTransportFormatter.cs

示例5: AddLinkedChain

            public FromComprenoModel AddLinkedChain(Compreno.SentenceElement master, IOrderedEnumerable<Compreno.SentenceElement> dependantWords)
            {
                var linkedChain = new LinkedChain();
                linkedChain.Master.Words.Add(_toSentenceWord(master));
                linkedChain.Dependent.Words.AddRange(dependantWords.Select(_toSentenceWord));

                _comparisonSentence.LinkedChains.Add(linkedChain);

                return this;
            }
开发者ID:Ogonik,项目名称:LWS,代码行数:10,代码来源:ComparisonModelBuilder.cs

示例6: AddSimpleSentence

            public FromComprenoModel AddSimpleSentence(IOrderedEnumerable<Compreno.SentenceElement> words)
            {
                var simpleSentece = new SimpleSentence();

                simpleSentece.Words.AddRange(words.Select(_toSentenceWord));

                _comparisonSentence.SimpleSentences.Add(simpleSentece);

                return this;
            }
开发者ID:Ogonik,项目名称:LWS,代码行数:10,代码来源:ComparisonModelBuilder.cs

示例7: CheckFirstMainWrite

 private static void CheckFirstMainWrite(IOrderedEnumerable<KeyValuePair<string, string>> data)
 {
     if (firstMainWrite && _mainLogger.IsInfoEnabled)
     {
         lock (firstMainWriteLock)
         {
             if (firstMainWrite)
             {
                 _mainLogger.Info(string.Join(";", data.Select(kvp => kvp.Key).ToArray()));
                 firstMainWrite = false;
             }
         }
     }
 }
开发者ID:daszat,项目名称:zetbox,代码行数:14,代码来源:Log4NetAppenderUtils.cs

示例8: Swiss

 /// <summary>
 /// Pairs the players against each other in swiss format, e.g. top player plays
 /// against the second, third against the fourth and so on. Avoids creating the 
 /// same pairing twice. See the PairingAlgorithm.txt document for details.
 /// </summary>
 public IEnumerable<Pairing> Swiss(IOrderedEnumerable<KeyValuePair<Player, int>> standings, IList<Pairing> history)
 {
     ValidatePlayerCount(standings.Select(i => i.Key));
     var players = standings.OrderByDescending(i => i.Value).Select(i => i.Key).ToList();
     var pairings = new Stack<Pairing>();
     var timer = Stopwatch.StartNew();
     while (!AllPlayersPaired(pairings, players))
     {
         TryAddPairing(pairings, players, history);
         if (timer.ElapsedMilliseconds > SwissTimeout)
         {
             throw new TimeoutException("The requested operation took too long to complete.");
         }
     }
     return pairings.ToArray().Reverse();
 }
开发者ID:akukolu,项目名称:tournamenttracker-lib,代码行数:21,代码来源:PairingGenerator.cs

示例9: GetMatchStats

 private MatchStats[] GetMatchStats(IOrderedEnumerable<MatchScore> orderedMatches)
 {
     IEnumerable<MatchStats> matchStats = orderedMatches.Select(x => x.MatchStats);
     MatchStats[] matchStatsArray = matchStats.ToArray();
     return matchStatsArray;
 }
开发者ID:georgeyu,项目名称:LolStats,代码行数:6,代码来源:CarryProgram.cs

示例10: Create

 public static ActivitiesViewModel Create(ActivityQuery query, IOrderedEnumerable<Application> applications)
 {
     var model = Mapper.Map<ActivitiesViewModel>(query);
     var list = new List<SelectListItem>
                    {
                        new SelectListItem
                            {
                                Selected = query.ApplicationId == null,
                                Text = String.Empty,
                                Value = null
                            }
                    };
     list.AddRange(applications.Select(x => Create(query, x)));
     model.Applications = list;
     return model;
 }
开发者ID:ByteCarrot,项目名称:Masslog,代码行数:16,代码来源:ActivitiesViewModel.cs

示例11: LoadInfo

        private void LoadInfo()
        {
            if (_selectedType != _loadedInfoForType) {
                _collection =
                    typeof(GameState).GetMethod("FetchAll")
                    .MakeGenericMethod(_selectedType)
                    .Invoke(null, new object[] { false }) as IList;

                _props = _selectedType.GetProperties().OrderBy(prop => prop.Name);
                _headers = _props.Select(prop => {
                    var header = new TableHeader { Label = prop.Name, Width = 100 };
                    switch (header.Label) {
                        case "_Id":
                            header.Label = "ID";
                            header.Width = 23;
                            break;
                        case "_EditorId":
                            header.Label = "Editor ID";
                            break;
                    }
                    return header;
                }).ToArray();
                _loadedInfoForType = _selectedType;
            }
        }
开发者ID:alasdairhurst,项目名称:ELB,代码行数:25,代码来源:ModelList.cs

示例12: OrderProduct

		private static OrderLine OrderProduct(int productId, IOrderedEnumerable<int> variants, int itemCount, OrderInfo order)
		{
			var currentLocalization = StoreHelper.CurrentLocalization;
			var productService = IO.Container.Resolve<IProductService>();
			var productInfo = productService.CreateProductInfoByProductId(productId, order, currentLocalization, itemCount);
			if (variants != null && variants.Any())
			{
				var productVariantService = IO.Container.Resolve<IProductVariantService>();
				var variantClasses = variants.Select(variant => productVariantService.GetById(variant, currentLocalization)).Where(variant => variant != null).GroupBy(a => a.Group).Select(g => g.FirstOrDefault()).Where(variant => variant != null);

				productInfo.ProductVariants = variantClasses.Select(variant => new ProductVariantInfo(variant, productInfo, itemCount)).ToList();
			}
			return new OrderLine(productInfo, order);
		}
开发者ID:Chuhukon,项目名称:uWebshop-Releases,代码行数:14,代码来源:OrderUpdatingService.cs

示例13: ParseToHighChart

 public HighChart ParseToHighChart(IOrderedEnumerable<ScoreList> source)
 {
     var hiChart = new HighChart();
     if(source.Any())
     {
         hiChart.Name = source.First().Title;
         hiChart.Data = source.Select(s => ParseDateAndNumber(s.Date, s.Popular)).ToList();
     }
     return hiChart;
 }
开发者ID:died,项目名称:logs.died.tw,代码行数:10,代码来源:datacenter.ashx.cs

示例14: CheckFirstObjectWrite

 private static void CheckFirstObjectWrite(IOrderedEnumerable<KeyValuePair<string, string>> data)
 {
     if (firstObjectWrite)
     {
         lock (firstObjectWriteLock)
         {
             if (firstObjectWrite)
             {
                 _objectsLogger.Info("name;" + string.Join(";", data.Select(kvp => kvp.Key).ToArray()));
                 firstObjectWrite = false;
             }
         }
     }
 }
开发者ID:jrgcubano,项目名称:zetbox,代码行数:14,代码来源:Log4NetAppenderUtils.cs

示例15: CreateParameters

 /// <summary>
 /// Create the display model from the parameter model.
 /// </summary>
 /// <param name="parameterModel">The parameters in the model</param>
 /// <returns>An observable collection of the parameters using the display model</returns>
 internal static ObservableCollection<ParameterDisplayModel> CreateParameters(IOrderedEnumerable<ParameterModel> parameterModel)
 {
     return new ObservableCollection<ParameterDisplayModel>(parameterModel.Select(p => new ParameterDisplayModel(p)));
 }
开发者ID:dianatle,项目名称:XTMF,代码行数:9,代码来源:ParameterDisplayModel.cs


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