public static IMemberDefinition Convert(IIsPossibly <IWeakTypeReference> Type, IConversionContext context, bool ReadOnly, IKey Key) { var(def, builder) = MemberDefinition.Create(); var buildIntention = Type.GetOrThrow().TypeDefinition.GetOrThrow().GetValue().GetOrThrow().Cast <IConvertable <IVerifiableType> >().GetBuildIntention(context); buildIntention.Build(); builder.Build(Key, buildIntention.Tobuild, ReadOnly); return(def); }
public static IBuildIntention <IMemberDefinition> GetBuildIntention(IIsPossibly <IWeakTypeReference> Type, IConversionContext context, bool ReadOnly, IKey Key) { var(toBuild, maker) = MemberDefinition.Create(); return(new BuildIntention <IMemberDefinition>(toBuild, () => { maker.Build( Key, Type.GetOrThrow().TypeDefinition.GetOrThrow().GetValue().GetOrThrow().ConvertTypeOrThrow(context), ReadOnly); })); }
public static IBuildIntention <IVerifiableType> GetBuildIntention(IIsPossibly <IBox <IIsPossibly <IFrontendType> > > TypeDefinition, IConversionContext context) { if (TypeDefinition.GetOrThrow().GetValue().GetOrThrow() is IConvertableFrontendType <IVerifiableType> convertableType) { return(convertableType.GetBuildIntention(context)); } else { throw new Exception("can not be built, type is not convertable"); } }