示例#1
0
        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));
        }
示例#2
0
 public HandlerType(object handlerType, MethodRef method)
     : base(GraphUnit.NewType(handlerType), ((CodeMethodReferenceExpression)method.Expression).TargetObject,
            ((CodeMethodReferenceExpression)method.Expression).MethodName)
 {
 }
示例#3
0
        public CodeRemoveEventStatement detach(EventRef eventRef, object handlerType, MethodRef methodRef)
        {
            CodeRemoveEventStatement stat = new CodeRemoveEventStatement(eventRef, newHandler(handlerType, methodRef));

            _enter(stat);
            return(stat);
        }
示例#4
0
        public CodeRemoveEventStatement detach(CodeExpression targetObject, string eventName, object handlerType, MethodRef methodRef)
        {
            EventRef e = new EventRef(targetObject, eventName);

            return(detach(e, handlerType, methodRef));
        }
示例#5
0
        public static CodeDelegateCreateExpression newHandler(object delegateType, MethodRef method)
        {
            CodeMethodReferenceExpression m = (CodeMethodReferenceExpression)method.Expression;

            return(new CodeDelegateCreateExpression(NewType(delegateType), m.TargetObject, m.MethodName));
        }