Example #1
0
 public EventListener(ListWithChangedEvent list)
 {
     List = list;
     //List.Changed += new ChangedEventHandler(ListChanged);
     List.Changed2 += new ChangedEventHandler(ListChanged);
     List.Changed2 += new ChangedEventHandler(ListChanged);
 }
Example #2
0
 public EventListener(ListWithChangedEvent list)
 {
     List = list;
     //List.Changed += new ChangedEventHandler(ListChanged);
     List.Changed2 += new ChangedEventHandler(ListChanged);
     List.Changed2 += new ChangedEventHandler(ListChanged);
 }
Example #3
0
        static void CallFirst()
        {
            ListWithChangedEvent list = new ListWithChangedEvent();
            EventListener listener = new EventListener(list);

            Console.WriteLine("Length of invocation list: {0}.", list.GetInvocationListLength());

            list.Add("item 1");
            list.Clear();
            listener.Detach();

            Console.WriteLine("Length of invocation list: {0}.", list.GetInvocationListLength());

            Console.ReadKey();
        }
Example #4
0
        static void CallFirst()
        {
            ListWithChangedEvent list     = new ListWithChangedEvent();
            EventListener        listener = new EventListener(list);

            Console.WriteLine("Length of invocation list: {0}.", list.GetInvocationListLength());

            list.Add("item 1");
            list.Clear();
            listener.Detach();

            Console.WriteLine("Length of invocation list: {0}.", list.GetInvocationListLength());

            Console.ReadKey();
        }
Example #5
0
 public void Detach()
 {
     List.Changed -= new ChangedEventHandler(ListChanged);
     List = null;
 }
Example #6
0
 public void Detach()
 {
     List.Changed -= new ChangedEventHandler(ListChanged);
     List          = null;
 }