예제 #1
0
        public EventData()
        {
            var func = new DelegateData();

            func.returnType = typeof(void);
            var sender = new ParameterData();

            sender.name = "sender";
            sender.type = typeof(object);
            func.parameters.Add(sender);
            var args = new ParameterData();

            args.name = "args";
            args.type = typeof(EventArgs);
            func.parameters.Add(args);
            @delegate = func;
        }
예제 #2
0
        public static DelegateData fromExisting(Delegate d)
        {
            DelegateData pointer = new DelegateData();
            var          func    = d.Method;

            pointer.name       = func.Name;
            pointer.returnType = func.ReturnType;
            var param = func.GetParameters();

            foreach (var paremeter in param)
            {
                var input = new ParameterData();
                input.name = paremeter.Name;
                input.type = paremeter.ParameterType;
                pointer.parameters.Add(input);
            }
            return(pointer);
        }