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


C# IGrouping类代码示例

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


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


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