Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var folder  = new Folder("folder1");
            var listner = new FolderListner();

            folder.Added   += listner.Handle;
            folder.Removed += listner.Handle;

            var myData1     = new MyData1("data1");
            var myData2     = new MyData2("data2");
            var myDataFile1 = new MyDataFile1(myData1, "name1");
            var myDataFile2 = new MyDataFile2(myData2, "name2");

            folder.Add(myDataFile1);
            folder.Add(myDataFile2);
            folder.PrintAll();

            folder.Remove(myDataFile1);
            folder.PrintAll();

            //Console.WriteLine("Let`s try find myDataFile2 by name('name2') in the folder:");
            //folder.FindByName("name2");
        }
Exemplo n.º 2
0
 public MyDataFile2(MyData2 _myData2, string name)
 {
     myData2 = _myData2;
     Name    = name;
     Text    = myData2.Text;
 }