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); }
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(); }
public static AssignMethodAttributeInfo[] GetAllAssignMethodAttributedFields(AttributedMethod attributedMethod) => GetAllAssignMethodAttributedFields(attributedMethod.Method, attributedMethod.Attribute, attributedMethod.Method.OriginType, attributedMethod.Method.Name, GetDelegateType(attributedMethod.Method.ReturnType));
public MethodBuilderInfoItem(AttributedMethod attribute, T @interface) { this.Attribute = attribute; this.Interface = @interface; this.HasSyncRootInterface = attribute.Attribute.Type.Implements(__ISyncRoot.TypeName); }
public BooleanExpressionCallCoder NewObj(AttributedMethod attributedMethod) { this.NewObj(attributedMethod.customAttribute); return(new BooleanExpressionCallCoder(this, attributedMethod.Attribute.Type)); }