コード例 #1
0
ファイル: Event_test.cs プロジェクト: NaugolnyhN/csharp
        static void Main(string[] args)
        {
            Family father = new Family();

            father.Age  = 40;
            father.Name = "John";
            Family mother = new Family();

            mother.Age  = 36;
            mother.Name = "JAnna";
            ChangedList   l        = new ChangedList();
            EventListener listener = new EventListener(l);

            l.Add(father);
            l.Add(mother);
        }
コード例 #2
0
ファイル: Event_test.cs プロジェクト: NaugolnyhN/csharp
 public EventListener(ChangedList list)
 {
     List        = list;
     List.Event += new EventHandler(ListChanged);
 }