Beispiel #1
0
    static void Main(string[] args)
    {
        dynamic obj  = new SomeObject();
        var     meth = obj.GetType().GetMethod("someMethodName");

        meth.Invoke(obj, new object[1] {
            "hello"
        });
    }
Beispiel #2
0
        public void Workaround_3682()
        {
            var so = new SomeObject();
            var e  = so.GetType().GetEvent("Event");

            if (e != null)
            {
                var add = e.GetAddMethod();
                add.Invoke(so, new object[] { new EventHandler(OnEvent) });
            }
        }
Beispiel #3
0
        public void EventInfo_3682()
        {
            var so = new SomeObject();

            var e = so.GetType().GetEvent("Event");

            if (e != null)
            {
                e.AddEventHandler(so, new EventHandler(OnEvent));
            }
        }