Ejemplo n.º 1
0
 public static WeakMulticastDelegate CombineUnique(WeakMulticastDelegate weakDelegate, Delegate realDelegate)
 {
     if (realDelegate == null)
     {
         return(null);
     }
     if (weakDelegate != null)
     {
         return(weakDelegate.CombineUnique(realDelegate));
     }
     return(new WeakMulticastDelegate(realDelegate));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Combines a weak multicast delegate with a normal delegate
 /// and makes sure the normal delegate has not been added yet.
 /// </summary>
 /// <param name="weakDelegate">the weak multicast delegate</param>
 /// <param name="realDelegate">the normal delegate</param>
 /// <returns>the new combined weak multicast delegate</returns>
 public static WeakMulticastDelegate CombineUnique(WeakMulticastDelegate weakDelegate, Delegate realDelegate)
 {
     if (realDelegate == null)
         return null;
     return (weakDelegate == null) ? new WeakMulticastDelegate(realDelegate) : weakDelegate.CombineUnique(realDelegate);
 }
Ejemplo n.º 3
0
        public static WeakMulticastDelegate CombineUnique(WeakMulticastDelegate weakDelegate, Delegate realDelegate)
        {
            WeakMulticastDelegate result;

            if (realDelegate == null)
            {
                result = null;
            }
            else
            {
                result = ((weakDelegate == null) ? new WeakMulticastDelegate(realDelegate) : weakDelegate.CombineUnique(realDelegate));
            }
            return(result);
        }