public GenericSpecializationPartCreationInfo(IReflectionPartCreationInfo originalPartCreationInfo, ReflectionComposablePartDefinition originalPart, Type[] specialization) { Assumes.NotNull(originalPartCreationInfo); Assumes.NotNull(specialization); Assumes.NotNull(originalPart); this._originalPartCreationInfo = originalPartCreationInfo; this._originalPart = originalPart; this._specialization = specialization; this._specializationIdentities = new string[this._specialization.Length]; for (int i = 0; i < this._specialization.Length; i++) { this._specializationIdentities[i] = AttributedModelServices.GetTypeIdentity(this._specialization[i]); } this._lazyPartType = new Lazy<Type>( () => this._originalPartCreationInfo.GetPartType().MakeGenericType(specialization), LazyThreadSafetyMode.PublicationOnly); }
internal bool TryMakeGenericPartDefinition(Type[] genericTypeParameters, out ComposablePartDefinition genericPartDefinition) { genericPartDefinition = null; if (!GenericSpecializationPartCreationInfo.CanSpecialize(this.Metadata, genericTypeParameters)) { return false; } genericPartDefinition = new ReflectionComposablePartDefinition(new GenericSpecializationPartCreationInfo(this._creationInfo, this, genericTypeParameters)); return true; }
public DisposableReflectionComposablePart(ReflectionComposablePartDefinition definition) : base(definition) { }