コード例 #1
0
ファイル: EventListener .cs プロジェクト: 3141592/vs
        static void CallSecond()
        {
            List2 list = new List2();
            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();
        }
コード例 #2
0
        static void CallSecond()
        {
            List2         list     = new List2();
            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();
        }