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

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

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

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