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


C# IGrouping.Select方法代码示例

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


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

示例1: ReduceGroup

        private static IEnumerable<KeyValuePair<IndexedName, RealNode>> ReduceGroup(
			IEnumerable<KeyValuePair<IndexedName, RealNode>> aggr, IGrouping<XName, RealNode> items)
        {
            var addition = items.Select((elem, i) =>
                new KeyValuePair<IndexedName, RealNode>(new IndexedName(items.Key, i), elem));
            return aggr.Concat(addition);
        }
开发者ID:atanas-georgiev,项目名称:Autosar-Merger,代码行数:7,代码来源:XmlComparer.cs

示例2: ExportMasteries

        /// <summary>
        /// Exports the masteries.
        /// </summary>
        /// <param name="typeMasteries">The type masteries.</param>
        /// <returns></returns>
        private static IEnumerable<SerializableMastery> ExportMasteries(IGrouping<int, DgmTypeMasteries> typeMasteries)
        {
            List<SerializableMastery> listOfMasteries = new List<SerializableMastery>();

            foreach (DgmMasteries typeMastery in typeMasteries.Select(x => Database.DgmMasteriesTable[x.MasteryID]))
            {
                Util.UpdatePercentDone(Database.MasteriesTotalCount);

                int grade = typeMastery.Grade + 1;

                SerializableMastery mastery;
                if (listOfMasteries.All(x=> x.Grade != grade))
                {
                    mastery = new SerializableMastery { Grade = grade };
                    listOfMasteries.Add(mastery);
                }
                else
                    mastery = listOfMasteries.First(x => x.Grade == grade);

                SerializableMasteryCertificate masteryCertificate = new SerializableMasteryCertificate
                {
                    ID = typeMastery.CertificateID,
                    ClassName =
                        Database.CrtClassesTable[Database.CrtCertificatesTable[typeMastery.CertificateID].ClassID].ClassName
                };

                mastery.Certificates.Add(masteryCertificate);
            }

            return listOfMasteries;
        }
开发者ID:RapidFiring,项目名称:evemon,代码行数:36,代码来源:Masteries.cs

示例3: FormatCanonicalizedValues

 public static string FormatCanonicalizedValues(IGrouping<string, string> headerOrParameter)
 {
     return headerOrParameter.Key.ToLowerInvariant() + ":" +
         String.Join(",", headerOrParameter
             .Select(value => value.TrimStart().Replace("\r\n", String.Empty))
             .OrderBy(value => value, StringComparer.OrdinalIgnoreCase));
 }
开发者ID:CedarLogic,项目名称:Dash,代码行数:7,代码来源:SharedKeySignature.cs

示例4: GroupedOrderTagViewModel

 public GroupedOrderTagViewModel(Order selectedItem, IGrouping<string, OrderTagGroup> orderTagGroups)
 {
     Name = orderTagGroups.Key;
     OrderTags = orderTagGroups.Select(x => new GroupedOrderTagButtonViewModel(selectedItem, x)).ToList();
     ColumnCount = orderTagGroups.First().ColumnCount;
     ButtonHeight = orderTagGroups.First().ButtonHeight;
 }
开发者ID:GHLabs,项目名称:SambaPOS-3,代码行数:7,代码来源:GroupedOrderTagViewModel.cs

示例5: CreateVirtualDirectory

        protected virtual ResourceVirtualDirectory CreateVirtualDirectory(IGrouping<string, string[]> subResources)
        {
            var remainingResourceNames = subResources.Select(g => g[1]);
            var subDir = new ResourceVirtualDirectory(
                VirtualPathProvider, this, backingAssembly, subResources.Key, remainingResourceNames);

            return subDir;
        }
开发者ID:grammarware,项目名称:fodder,代码行数:8,代码来源:src_ServiceStack_Razor_VirtualPath_ResourceVirtualDirectory.cs

示例6: HtmlButtonGroup

        private HtmlButtonGroup( HtmlForm form, IGrouping<string, IHtmlElement> inputGroup )
        {
            _form = form;

              name = inputGroup.Key;

              items = inputGroup.Select( e => new HtmlInputItem( this, e ) ).ToArray();
        }
开发者ID:neo2018,项目名称:Jumony,代码行数:8,代码来源:HtmlButtonGroup.cs

示例7: MenuItemGroupedPropertyViewModel

 public MenuItemGroupedPropertyViewModel(TicketItemViewModel selectedItem, IGrouping<string, MenuItemPropertyGroup> menuItemPropertyGroups)
 {
     Name = menuItemPropertyGroups.Key;
     Properties = menuItemPropertyGroups.Select(x => new MenuItemGroupedPropertyItemViewModel(selectedItem, x)).ToList();
     ColumnCount = menuItemPropertyGroups.First().ColumnCount;
     ButtonHeight = menuItemPropertyGroups.First().ButtonHeight;
     TerminalButtonHeight = menuItemPropertyGroups.First().TerminalButtonHeight;
     TerminalColumnCount = menuItemPropertyGroups.First().TerminalColumnCount;
 }
开发者ID:hpbaotho,项目名称:sambapos,代码行数:9,代码来源:MenuItemGroupedPropertyViewModel.cs

示例8: OnSelector

		private DebuggerViewItem OnSelector(IGrouping<IHandler, Burden> lookup)
		{
			var handler = lookup.Key;
			var objects = lookup.Select(g => g.Instance).ToArray();
			var view = ComponentDebuggerView.BuildFor(handler);
			return new DebuggerViewItem(handler.GetComponentName(),
			                            "Count = " + objects.Length,
			                            new ReleasePolicyTrackedObjectsDebuggerViewItem(view, objects));
		}
开发者ID:pmcg,项目名称:Castle.Windsor,代码行数:9,代码来源:ReleasePolicyTrackedObjects.cs

示例9: HeroStatistic

 public HeroStatistic(IGrouping<string, Match> group)
 {
     Hero = group.Key;
     Matches = group.Count();
     Wins = group.Where(m => m.Win).Count();
     Losses = group.Where(m => m.Win == false).Count();
     WinRatio = Convert.ToInt32((double)Wins / (double)Matches * 100);
     TimePlayed = group.Select(g => g.Duration).Aggregate(TimeSpan.Zero, (subtotal, t) => subtotal.Add(t));
 }
开发者ID:Gmoneydrums,项目名称:StormVault,代码行数:9,代码来源:HeroStatistic.cs

示例10: GetApi

 private static Api GetApi(IGrouping<string, SwaggerRouteData> @group)
 {
     return new Api
     {
         Path = @group.Key,
         Operations = @group
             .Select(d => d.ToOperation())
             .OrderBy(o => o.Method)
     };
 }        
开发者ID:cemremengu,项目名称:Nancy.Swagger,代码行数:10,代码来源:DefaultSwaggerMetadataConverter.cs

示例11: CreateMenuItemModel

        private MenuItemModel CreateMenuItemModel(IGrouping<string, HeaderNavigationDTO> menuGroup, bool isParentSelected, int? selectedHeaderId)
        {
            var headers = menuGroup.Select(m => CreateHeaderItemModel(m, selectedHeaderId, isParentSelected));

            return new MenuItemModel()
            {
                IsExpanded = isParentSelected && headers.Any(h => h.IsSelected),
                Name = menuGroup.Key,
                Headers = headers
            };
        }
开发者ID:Dani88,项目名称:GFIS,代码行数:11,代码来源:NavigatorFactory.cs

示例12: GenerateApiSpec

        private ApiSpec GenerateApiSpec(IGrouping<string, ApiDescription> apiDescriptionGroup, ModelSpecMap modelSpecMap)
        {
            var operationSpecs = apiDescriptionGroup
                .Select(apiDesc => GenerateOperationSpec(apiDesc, modelSpecMap))
                .ToList();

            return new ApiSpec
            {
                Path = "/" + apiDescriptionGroup.Key.Split('?').First(),
                Operations = operationSpecs
            };
        }
开发者ID:nprovencher,项目名称:Swashbuckle,代码行数:12,代码来源:SwaggerGenerator.cs

示例13: CreateApiSpec

        private ApiSpec CreateApiSpec(IGrouping<string, ApiDescription> apiDescriptionGroup, ModelSpecRegistrar modelSpecRegistrar)
        {
            var operationSpecs = apiDescriptionGroup
                .Select(apiDesc => _operationSpecGenerator.From(apiDesc, modelSpecRegistrar))
                .ToList();

            return new ApiSpec
            {
                Path = "/" + apiDescriptionGroup.Key.Split('?').First(),
                Operations = operationSpecs
            };
        }
开发者ID:kevinforbes,项目名称:Swashbuckle,代码行数:12,代码来源:SwaggerGenerator.cs

示例14: CreateApi

        private Api CreateApi(IGrouping<string, ApiDescription> apiDescriptionGroup, OperationGenerator operationGenerator)
        {
            var operations = apiDescriptionGroup
                .Select(operationGenerator.ApiDescriptionToOperation)
                .OrderBy(op => op.Method)
                .ToList();

            return new Api
            {
                Path = "/" + apiDescriptionGroup.Key,
                Operations = operations
            };
        }
开发者ID:AnthonyNeace,项目名称:Swashbuckle,代码行数:13,代码来源:SwaggerGenerator.cs

示例15: CreateApi

        private Api CreateApi(IGrouping<string, ApiDescription> apiDescriptionGroup, Dictionary<string, DataType> complexModels)
        {
            var operations = apiDescriptionGroup
                .Select(apiDesc => _operationGenerator.ApiDescriptionToOperation(apiDesc, complexModels))
                .OrderBy(op => op.Method)
                .ToList();

            return new Api
            {
                Path = "/" + apiDescriptionGroup.Key,
                Operations = operations
            };
        }
开发者ID:kevynb,项目名称:Swashbuckle,代码行数:13,代码来源:SwaggerGenerator.cs


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