コード例 #1
0
 public MethodBuilderInfoItem(AttributedMethod attribute, T @interface)
 {
     this.Attribute                  = attribute;
     this.Interface                  = @interface;
     this.HasSyncRootInterface       = attribute.Attribute.Type.Implements(__ISyncRoot.Type.Fullname);
     this.AssignMethodAttributeInfos = AssignMethodAttributeInfo.GetAllAssignMethodAttributedFields(attribute);
     this.InterceptorInfo            = new InterceptorInfo(this.Attribute.Attribute.Type);
 }
コード例 #2
0
    public MethodBuilderInfoItem(AttributedMethod attribute, T1 interfaceA, T2 interfaceB)
    {
        this.Attribute  = attribute;
        this.InterfaceA = interfaceA;
        this.InterfaceB = interfaceB;
        this.AssignMethodAttributeInfos = AssignMethodAttributeInfo.GetAllAssignMethodAttributedFields(attribute);
        this.InterceptorInfo            = new InterceptorInfo(this.Attribute.Attribute.Type);
        this.HasSyncRootInterface       = attribute.Attribute.Type.Implements(BuilderTypes.ISyncRoot);
        this.HasInterfaceA      = this.Attribute.Attribute.Type.Implements(this.InterfaceA.BuilderType);
        this.HasInterfaceB      = this.Attribute.Attribute.Type.Implements(this.InterfaceB.BuilderType);
        this.HasOnExitInterface = this.Attribute.Attribute.Type.Implements(BuilderTypes.IMethodInterceptorOnExit);

        var name           = $"<{attribute.Method.Name}>_{attribute.Identification}";
        var newInterceptor = this.InterceptorInfo.AlwaysCreateNewInstance ?
                             attribute.Method.GetOrCreateVariable(this.InterfaceType) as CecilatorBase :
                             attribute.Method.DeclaringType.CreateField(attribute.Method.Modifiers.GetPrivate(), this.InterfaceType, name);

        this.Interceptor     = newInterceptor;
        this.FieldOrVariable = attribute.Method.IsAsync ? attribute.Method.AsyncMethodHelper.InsertFieldToAsyncStateMachine(name, this.InterfaceType, z => newInterceptor) : newInterceptor;
        (newInterceptor as Field)?.CustomAttributes.AddNonSerializedAttribute();
    }
コード例 #3
0
 public static AssignMethodAttributeInfo[] GetAllAssignMethodAttributedFields(AttributedMethod attributedMethod) =>
 GetAllAssignMethodAttributedFields(attributedMethod.Method, attributedMethod.Attribute, attributedMethod.Method.OriginType, attributedMethod.Method.Name, GetDelegateType(attributedMethod.Method.ReturnType));
コード例 #4
0
ファイル: MethodBuilderInfo.cs プロジェクト: Kazpers/Cauldron
 public MethodBuilderInfoItem(AttributedMethod attribute, T @interface)
 {
     this.Attribute            = attribute;
     this.Interface            = @interface;
     this.HasSyncRootInterface = attribute.Attribute.Type.Implements(__ISyncRoot.TypeName);
 }
コード例 #5
0
 public BooleanExpressionCallCoder NewObj(AttributedMethod attributedMethod)
 {
     this.NewObj(attributedMethod.customAttribute);
     return(new BooleanExpressionCallCoder(this, attributedMethod.Attribute.Type));
 }