public CodeRemoveEventStatement detach(CodeExpression targetObject, string eventName, object handlerType, CodeExpression methodTarget, string methodName) { EventRef e = new EventRef(targetObject, eventName); CodeDelegateCreateExpression dce = newHandler(handlerType, methodTarget, methodName); MethodRef m = new MethodRef(methodTarget, methodName); return(detach(e, handlerType, m)); }
public HandlerType(object handlerType, MethodRef method) : base(GraphUnit.NewType(handlerType), ((CodeMethodReferenceExpression)method.Expression).TargetObject, ((CodeMethodReferenceExpression)method.Expression).MethodName) { }
public CodeRemoveEventStatement detach(EventRef eventRef, object handlerType, MethodRef methodRef) { CodeRemoveEventStatement stat = new CodeRemoveEventStatement(eventRef, newHandler(handlerType, methodRef)); _enter(stat); return(stat); }
public CodeRemoveEventStatement detach(CodeExpression targetObject, string eventName, object handlerType, MethodRef methodRef) { EventRef e = new EventRef(targetObject, eventName); return(detach(e, handlerType, methodRef)); }
public static CodeDelegateCreateExpression newHandler(object delegateType, MethodRef method) { CodeMethodReferenceExpression m = (CodeMethodReferenceExpression)method.Expression; return(new CodeDelegateCreateExpression(NewType(delegateType), m.TargetObject, m.MethodName)); }