示例#1
0
 public void Init(
     InterpetedMemberDefinition <TMethodIn> parameterDefinition,
     InterpetedMemberDefinition <TIn> contextDefinition,
     IInterpetedOperation <IInterpetedAnyType>[] methodBody,
     IInterpetedScopeTemplate scope,
     IImplementationType implementationType)
 {
     ParameterDefinition = parameterDefinition ?? throw new ArgumentNullException(nameof(parameterDefinition));
     ContextDefinition   = contextDefinition ?? throw new ArgumentNullException(nameof(contextDefinition));
     MethodBody          = methodBody ?? throw new ArgumentNullException(nameof(methodBody));
     Scope = scope ?? throw new ArgumentNullException(nameof(scope));
     ImplementationType = implementationType ?? throw new ArgumentNullException(nameof(implementationType));
 }
 internal static Func <IRunTimeAnyRoot, RunTimeAnyRootEntry> InterpetedImplementationIntention <TIn, TMethodIn, TMethodOut>(
     InterpetedMemberDefinition <TMethodIn> parameterDefinition,
     InterpetedMemberDefinition <TIn> contextDefinition,
     IInterpetedOperation <IInterpetedAnyType>[] body,
     InterpetedContext context,
     IInterpetedScopeTemplate scope,
     IImplementationType implementationType)
     where TIn : class, IInterpetedAnyType
     where TMethodIn : class, IInterpetedAnyType
     where TMethodOut : class, IInterpetedAnyType
 => root =>
 {
     var item = new InterpetedImplementation <TIn, TMethodIn, TMethodOut>(parameterDefinition, contextDefinition, body, context, scope, implementationType, root);
     return(new RunTimeAnyRootEntry(item, implementationType));
 };
 public InterpetedImplementation(
     InterpetedMemberDefinition <TMethodIn> parameterDefinition,
     InterpetedMemberDefinition <TIn> contextDefinition,
     IInterpetedOperation <IInterpetedAnyType>[] body,
     InterpetedContext context,
     IInterpetedScopeTemplate scope,
     IImplementationType implementationType,
     IRunTimeAnyRoot root) : base(root)
 {
     ParameterDefinition    = parameterDefinition ?? throw new ArgumentNullException(nameof(parameterDefinition));
     this.contextDefinition = contextDefinition ?? throw new ArgumentNullException(nameof(contextDefinition));
     Body = body ?? throw new ArgumentNullException(nameof(body));
     InterpetedContext  = context ?? throw new ArgumentNullException(nameof(context));
     Scope              = scope ?? throw new ArgumentNullException(nameof(scope));
     ImplementationType = implementationType ?? throw new ArgumentNullException(nameof(implementationType));
 }
 internal static IInterpetedImplementation <TIn, TMethodIn, TMethodOut> Implementation <TIn, TMethodIn, TMethodOut>(InterpetedMemberDefinition <TMethodIn> parameterDefinition,
                                                                                                                    InterpetedMemberDefinition <TIn> contextDefinition,
                                                                                                                    IInterpetedOperation <IInterpetedAnyType>[] body,
                                                                                                                    InterpetedContext context,
                                                                                                                    IInterpetedScopeTemplate scope,
                                                                                                                    IImplementationType implementationType)
     where TIn : class, IInterpetedAnyType
     where TMethodIn : class, IInterpetedAnyType
     where TMethodOut : class, IInterpetedAnyType
 => Root(new Func <IRunTimeAnyRoot, RunTimeAnyRootEntry>[] { InterpetedImplementationIntention <TIn, TMethodIn, TMethodOut>(parameterDefinition, contextDefinition, body, context, scope, implementationType) }).Has <IInterpetedImplementation <TIn, TMethodIn, TMethodOut> >();