Esempio n. 1
0
        public static WeakAction <T> Create <T>(Action <T> action)
        {
            var weakDelegate = new WeakDelegate(action.Target, action.Method);

            return((arg) => weakDelegate.TryInvokeAction(arg));
        }
Esempio n. 2
0
        public static WeakAction <T1, T2, T3, T4> Create <T1, T2, T3, T4>(Action <T1, T2, T3, T4> action)
        {
            var weakDelegate = new WeakDelegate(action.Target, action.Method);

            return((arg1, arg2, arg3, arg4) => weakDelegate.TryInvokeAction(arg1, arg2, arg3, arg4));
        }
Esempio n. 3
0
        public static WeakAction Create(Action action)
        {
            var weakDelegate = new WeakDelegate(action.Target, action.Method);

            return(() => weakDelegate.TryInvokeAction());
        }