Esempio n. 1
0
 public EventListener(ListWithChangedEvent list)
 {
     List = list;
     //List.Changed += new ChangedEventHandler(ListChanged);
     List.Changed2 += new ChangedEventHandler(ListChanged);
     List.Changed2 += new ChangedEventHandler(ListChanged);
 }
Esempio n. 2
0
 public EventListener(ListWithChangedEvent list)
 {
     List = list;
     //List.Changed += new ChangedEventHandler(ListChanged);
     List.Changed2 += new ChangedEventHandler(ListChanged);
     List.Changed2 += new ChangedEventHandler(ListChanged);
 }
Esempio n. 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();
        }
Esempio n. 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();
        }
Esempio n. 5
0
 public void Detach()
 {
     List.Changed -= new ChangedEventHandler(ListChanged);
     List = null;
 }
Esempio n. 6
0
 public void Detach()
 {
     List.Changed -= new ChangedEventHandler(ListChanged);
     List          = null;
 }