• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IGrouping类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IGrouping的典型用法代码示例。如果您正苦于以下问题:C# IGrouping类的具体用法?C# IGrouping怎么用?C# IGrouping使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: ConstructorsAmbiguous

        /// <summary>
        /// Generates a message saying that the constructor is ambiguous.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="bestDirectives">The best constructor directives.</param>
        /// <returns>The exception message.</returns>
        public static string ConstructorsAmbiguous(IContext context, IGrouping<int, ConstructorInjectionDirective> bestDirectives)
        {
            using (var sw = new StringWriter())
            {
                sw.WriteLine("Error activating {0} using {1}", context.Request.Service.Format(), context.Binding.Format(context));
                sw.WriteLine("Several constructors have the same priority. Please specify the constructor using ToConstructor syntax or add an Inject attribute.");
                sw.WriteLine();

                sw.WriteLine("Constructors:");
                foreach (var constructorInjectionDirective in bestDirectives)
                {
                    FormatConstructor(constructorInjectionDirective.Constructor, sw);
                }

                sw.WriteLine();

                sw.WriteLine("Activation path:");
                sw.WriteLine(context.Request.FormatActivationPath());

                sw.WriteLine("Suggestions:");
                sw.WriteLine("  1) Ensure that the implementation type has a public constructor.");
                sw.WriteLine("  2) If you have implemented the Singleton pattern, use a binding with InSingletonScope() instead.");

                return sw.ToString();
            }
        }
开发者ID:remogloor,项目名称:ninject,代码行数:32,代码来源:ExceptionFormatter.cs


示例2: MachineEditorVm

		/// <summary>
		/// Create a machine with the given SSAM Group
		/// </summary>
		/// <param name="machine"></param>
		public MachineEditorVm(IGrouping<Model.Machine, Model.StateStationActivityMachine> machine)
		{
			_group = machine;
			MachineId = machine.Key.Id;
			Name = machine.Key.Name;
			Code = machine.Key.Code;
		}
开发者ID:T1Easyware,项目名称:Soheil,代码行数:11,代码来源:MachineEditorVm.cs


示例3: 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


示例4: CreateAttendanceDTO

 private static DeptWiseAttendanceDTO CreateAttendanceDTO(IGrouping<int, ActivityLogDTO> grp, IEnumerable<Employee> allEmployees)
 {
     var deptMembers = allEmployees.Where(e => e.Deprtment.Id == grp.First().Department.Id);
     var dto = new DeptWiseAttendanceDTO
     {
         DepartmentName = grp.First().Department.Name,
         Attendance = grp.GroupBy(gd => gd.Employee.Id)
                         .Select(empGroup => new AttendanceDTO
                         {
                             EmployeeName = empGroup.First().Employee.Name,
                             EmployeeId = empGroup.First().Employee.Id,
                             Attended = true,
                             Date = empGroup.First().TimeStamp.ToString("yyyy-MM-dd")
                         })
                         .ToList()
     };
     var absents = deptMembers.Where(m => !dto.Attendance.Any(a => a.EmployeeId == m.Id));
     var date = dto.Attendance.First().Date;
     dto.Attendance.AddRange(absents.Select(a => new AttendanceDTO
                         {
                             EmployeeName = a.Name,
                             EmployeeId = a.Id,
                             Attended = false,
                             Date = date
                         }));
     return dto;
 }
开发者ID:chakrabar,项目名称:AccessAdmin,代码行数:27,代码来源:ReportGeneratorFacade.cs


示例5: 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


示例6: GetEventFromGroup

 public static PageRequest GetEventFromGroup(IGrouping<Guid, PageRequest> group)
 {
     var element = group.First();
     var other = group.Skip(1).ToList();
     if (other.Count == 0) return element;
     else return new RequestSessionGroup(element, other);
 }
开发者ID:DCT-UA,项目名称:Monator,代码行数:7,代码来源:RequestSessionGroup.cs


示例7: TableInfo

		//internal TableInfo(DB2Connection connection, DB2DataReader reader)
		//{
		//	_connection = connection;

		//	Name = Convert.ToString(reader.GetValue(reader.GetOrdinal("NAME")));
		//	Remarks = Convert.ToString(reader.GetValue(reader.GetOrdinal("REMARKS")));
		//}

		internal TableInfo(IGrouping<string, DataRow> data)
		{
			_data = data;

			Name = data.First().Field<string>("TBNAME");
			Remarks = data.First().Field<string>("TBREMARKS");
		}
开发者ID:treytomes,项目名称:DB2LinqPadDriver,代码行数:15,代码来源:TableInfo.cs


示例8: ExportPendingChangesGroup

		/// <summary>
		/// Creates XML element containing the information on the specified pending changes group.
		/// </summary>
		public static XElement ExportPendingChangesGroup(IGrouping<IUserInfo, PendingChange> changesGroup)
		{
			return new XElement(
				"group",
				ExportUserInfo(changesGroup.Key),
				from change in changesGroup select ExportPendingChange(change));
		}
开发者ID:shuruev,项目名称:CCNet.Extensions,代码行数:10,代码来源:XmlExporter.cs


示例9: PackageFoundResult

 public PackageFoundResult(IGrouping<string, IPackageInfo> packageInfos, PackageListOptions options, IEnumerable<IPackageInfo> currentPackages)
 {
     Options = options;
     CurrentPackages = currentPackages;
     Name = packageInfos.Key;
     Packages = packageInfos.ToList();
 }
开发者ID:carcer,项目名称:openwrap,代码行数:7,代码来源:PackageFoundResult.cs


示例10: 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


示例11: 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


示例12: ConvertEndsFacade

 public ConvertEndsFacade(IGrouping<double, PanelBlRefExport> itemLefEndsByY, bool isLeftSide, ConvertPanelService cps)
 {
     this.itemLefEndsByY = itemLefEndsByY;
     this.sideName = isLeftSide ? "левый" : "правый";
     this.isLeftSide = isLeftSide;
     CPS = cps;
 }
开发者ID:vildar82,项目名称:PanelColorAlbum,代码行数:7,代码来源:ConvertEndsFacade.cs


示例13: parseClientGroup

 private static IEnumerable<IAutoCompleteListItem> parseClientGroup(IGrouping<ulong, Toggl.TogglAutocompleteView> c)
 {
     var projectItems = c.GroupBy(p => p.ProjectID).Select(parseProjectGroup);
     if (c.Key == 0)
         return projectItems;
     var clientName = c.First().ClientLabel;
     return new ClientCategory(clientName, projectItems.ToList()).Yield<IAutoCompleteListItem>();
 }
开发者ID:Nukil,项目名称:toggldesktop,代码行数:8,代码来源:AutoCompleteControllers.cs


示例14: 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


示例15: CreateModuleRouteSummary

        private ModuleRouteSummary CreateModuleRouteSummary(IGrouping<Type, RouteInfo> moduleRouteInfos)
        {
            var moduleRouteSummary = new ModuleRouteSummary(moduleRouteInfos.Key.Name, _helpModulePath);

            foreach (var routeInfo in moduleRouteInfos)
                moduleRouteSummary.Routes.Add(new RouteSummary(routeInfo, _helpModulePath));
            return moduleRouteSummary;
        }
开发者ID:MingLu8,项目名称:Nancy.WebApi.HelpPages,代码行数:8,代码来源:DefaultApiExplorer.cs


示例16: CreateOneNamespaceDeclaration

 private static MemberDeclarationSyntax CreateOneNamespaceDeclaration(IGrouping<string, NamespaceDeclarationSyntax> ns)
 {
     var nameSyntax = SyntaxFactory.ParseName(ns.Key);
     return SyntaxFactory
         .NamespaceDeclaration(nameSyntax)
         .AddMembers(ns.SelectMany(x => x.Members)
         .ToArray());
 }
开发者ID:jhgbrt,项目名称:joincs,代码行数:8,代码来源:Joiner.cs


示例17: CollectUpsertOperations

 private IEnumerable<Action<ISimpleDbService>> CollectUpsertOperations(IGrouping<ISimpleDbDomain, ISessionItem> domainSet)
 {
     var putBatches = domainSet.Where(i => i.State == SessionItemState.Create || i.State == SessionItemState.Update).GroupsOf(25);
     foreach (var putBatch in putBatches)
     {
         yield return service => service.BatchPutAttributes(domainSet.Key.Name, putBatch.Cast<object>().ToArray());
     }
 }
开发者ID:rsparkyc,项目名称:SimpleDb.Net,代码行数:8,代码来源:SimpleDbSession.cs


示例18: CreateFilterGroupModel

 private FilterGroupModel CreateFilterGroupModel(IGrouping<int, FilterDTO> filterDTOGroup, string locationID, string database)
 {
     return new FilterGroupModel()
     {
         FilterGroupItems = filterDTOGroup.OrderBy(f => f.ViewOrder).Select(f => CreateBaseFilter(f, locationID, database)).ToList(),
         Index = filterDTOGroup.Key
     };
 }
开发者ID:Dani88,项目名称:GFIS,代码行数:8,代码来源:ReportFilterFactory.cs


示例19: ShowItemGroup

 private void ShowItemGroup(IGrouping<string, LootItem> lootItemGroup)
 {
     GameObject lootItemGameObject = LootItemGroupTemplate.Clone();
     lootItemGameObjects.Add(lootItemGameObject);
     LootItemSelectionGroupController lootItemSelectionGroupController = lootItemGameObject.GetComponent<LootItemSelectionGroupController>();
     lootItemSelectionGroupController.OnLootItemGroupSelected += LootItemGroupSelectedEventHandler;
     lootItemSelectionGroupController.ShowItemGroup(lootItemGroup);
 }
开发者ID:maximecharron,项目名称:GLO-3002-Frima,代码行数:8,代码来源:LootItemSelectionController.cs


示例20: CollectDeleteOperations

 private IEnumerable<Action<ISimpleDbService>> CollectDeleteOperations(IGrouping<ISimpleDbDomain, ISessionItem> domainSet)
 {
     var deleteBatches = domainSet.Where(i => i.State == SessionItemState.Delete).GroupsOf(25);
     foreach (var deleteBatch in deleteBatches)
     {
         yield return service => service.BatchDeleteAttributes(domainSet.Key.Name, deleteBatch.Cast<object>().ToArray());
     }
 }
开发者ID:rsparkyc,项目名称:SimpleDb.Net,代码行数:8,代码来源:SimpleDbSession.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IGuildMember类代码示例发布时间:2022-05-24
下一篇:
C# IGroup类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap