internal void MakeResources() { ValidateEntityResourceProviders(); foreach (var provider in EntityResourceProviders.Values) { provider.TypeCache = TypeCache; provider.ResourceCollection = ResourceCollection; provider.ResourceValidator = ResourceValidator; } ValidateAndBuildTypeLists ( out var regularTypes, out var wrapperTypes, out var terminalTypes, out var binaryTypes, out _ ); foreach (var provider in EntityResourceProviders.Values) { var claim = regularTypes.Where(provider.Include).ToList(); regularTypes = regularTypes.Except(claim).ToList(); provider.MakeClaimRegular(claim); } foreach (var provider in EntityResourceProviders.Values) { var claim = wrapperTypes.Where(provider.Include).ToList(); wrapperTypes = wrapperTypes.Except(claim).ToList(); provider.MakeClaimWrapped(claim); } foreach (var provider in EntityResourceProviders.Values) { provider.ReceiveClaimed(ResourceCollection.OfType <IEntityResource>() .Where(r => r.Provider == provider.Id) .ToList()); if (provider is IProceduralEntityResourceProvider) { provider.MakeClaimProcedural(); } } TerminalProvider.RegisterTerminalTypes(terminalTypes); BinaryProvider.RegisterBinaryTypes(binaryTypes); ValidateInnerResources(); }
internal static void MakeResources(IEntityResourceProvider[] externalProviders) { ValidateEntityResourceProviders(externalProviders); ValidateAndBuildTypeLists ( out var regularTypes, out var wrapperTypes, out var terminalTypes, out var binaryTypes, out var eventTypes ); foreach (var provider in EntityResourceProviders.Values) { var claim = regularTypes.Where(provider.Include).ToList(); regularTypes = regularTypes.Except(claim).ToList(); provider.MakeClaimRegular(claim); } foreach (var provider in EntityResourceProviders.Values) { var claim = wrapperTypes.Where(provider.Include).ToList(); wrapperTypes = wrapperTypes.Except(claim).ToList(); provider.MakeClaimWrapped(claim); } foreach (var provider in EntityResourceProviders.Values) { provider.ReceiveClaimed(Resource.ClaimedBy(provider)); if (provider is IProceduralEntityResourceProvider) { provider.MakeClaimProcedural(); } } TerminalProvider.RegisterTerminalTypes(terminalTypes); BinaryProvider.RegisterBinaryTypes(binaryTypes); EventProvider.RegisterEventTypes(eventTypes); ValidateInnerResources(); }