/// <summary> /// Registers all supplied <paramref name="implementationTypes"/> based on the closed-generic version /// of the given <paramref name="openGenericServiceType"/> with the given <paramref name="lifestyle"/>. /// </summary> /// <param name="openGenericServiceType">The definition of the open generic type.</param> /// <param name="implementationTypes">A list types to be registered.</param> /// <param name="lifestyle">The lifestyle to register instances with.</param> /// <exception cref="ArgumentNullException">Thrown when one of the arguments contain a null /// reference (Nothing in VB).</exception> /// <exception cref="ArgumentException">Thrown when <paramref name="openGenericServiceType"/> is not /// an open generic type or when one of the supplied types from the /// <paramref name="implementationTypes"/> collection does not derive from /// <paramref name="openGenericServiceType"/>.</exception> /// <exception cref="InvalidOperationException">Thrown when the given set of /// <paramref name="implementationTypes"/> contain multiple types that implement the same /// closed generic version of the given <paramref name="openGenericServiceType"/>.</exception> public void Register(Type openGenericServiceType, IEnumerable <Type> implementationTypes, Lifestyle lifestyle) { Requires.IsNotNull(openGenericServiceType, nameof(openGenericServiceType)); Requires.IsNotNull(lifestyle, nameof(lifestyle)); Requires.IsNotNull(implementationTypes, nameof(implementationTypes)); Requires.IsGenericType(openGenericServiceType, nameof(openGenericServiceType), guidance: StringResources.SuppliedTypeIsNotGenericExplainingAlternativesWithTypes); Requires.IsNotPartiallyClosed(openGenericServiceType, nameof(openGenericServiceType)); Requires.IsOpenGenericType(openGenericServiceType, nameof(openGenericServiceType), guidance: StringResources.SuppliedTypeIsNotOpenGenericExplainingAlternativesWithTypes); implementationTypes = implementationTypes.Distinct().ToArray(); Requires.DoesNotContainNullValues(implementationTypes, nameof(implementationTypes)); Requires.CollectionDoesNotContainOpenGenericTypes(implementationTypes, nameof(implementationTypes)); Requires.ServiceIsAssignableFromImplementations(openGenericServiceType, implementationTypes, nameof(implementationTypes), typeCanBeServiceType: false); var mappings = from mapping in BatchMapping.Build(openGenericServiceType, implementationTypes) let registration = lifestyle.CreateRegistration(mapping.ImplementationType, this) from serviceType in mapping.ClosedServiceTypes select new { serviceType, registration }; foreach (var mapping in mappings) { this.AddRegistration(mapping.serviceType, mapping.registration); } }
/// <summary> /// Fills all the Views with the information /// </summary> public void fillProfileInformation() { ContentPlaceHolder headerPlaceHolder = (ContentPlaceHolder)Master.FindControl("ContentPlaceHolderTitle"); ContentPlaceHolder headerNamePlaceHolder = (ContentPlaceHolder)Master.FindControl("contentPlaceholderContent").FindControl("contentPlaceholderWrapperTitle"); Table countTable = (Table)Master.FindControl("contentPlaceholderContent").FindControl("contentPlacepboxA").FindControl("profileMainInfo"); userCountDouble = dashboardCount.UserCounts; cvCountDouble = dashboardCount.CvCounts; companyCountDouble = dashboardCount.CompanyCounts; jobCountDouble = dashboardCount.JobCounts; matchCountDouble = dashboardCount.MatchCounts; userCount = userCountDouble.ToString(); cvCount = cvCountDouble.ToString(); companyCount = companyCountDouble.ToString(); jobCount = jobCountDouble.ToString(); matchCount = matchCountDouble.ToString(); ((Literal)headerPlaceHolder.FindControl("profielHeader")).Text = uppercaseWord(user.Email.Substring(0, user.Email.IndexOf("@"))); //((Literal)headerNamePlaceHolder.FindControl("profileHeaderName")).Text = uppercaseWord(user.Email); BatchMapping mapping = new BatchMapping(); MatchyBackend.Batch[] matchyBatch = service.GetBatch(0); batch = new Batch[matchyBatch.Length]; for (int i = 0; i < matchyBatch.Length; i++) batch[i] = mapping.mapFromService(matchyBatch[i]); ((Literal)countTable.FindControl("userCounts")).Text = userCount; ((Literal)countTable.FindControl("cvCounts")).Text = cvCount; ((Literal)countTable.FindControl("companyCounts")).Text = companyCount; ((Literal)countTable.FindControl("jobCounts")).Text = jobCount; ((Literal)countTable.FindControl("matchCounts")).Text = matchCount; BuildAlleGegevensChart(); BuildCvJobsChart(); BuildCvCompanyChart(); }