Exemplo n.º 1
0
        private static void SaveData()
        {
            ItemsCollection ic = new ItemsCollection();

            //itemsC.SuperAdmin = new User("Admin", "12345678910");
            //itemsC.SuperAdmin.UserType = User.eUserType.SuperAdmin;
            ic.Items.Add(new Book
                             ("Book of Treasures",
                             DateTime.Now.AddYears(-8),
                             eBaseCategory.Cooking,
                             eInnerCategory.Soups,
                             "Ann Geronulasoftred"));
            ic.Items.Add(new Journal
                             ("Some Journal",
                             DateTime.Now.AddYears(-1),
                             eBaseCategory.Kids,
                             eInnerCategory.Comics,
                             6));

            ic.SaveData(ic);
        }
Exemplo n.º 2
0
 private void ClosingMainWindow(object sender, System.ComponentModel.CancelEventArgs e)
 {
     //Serialize all the data on exit -
     //save the whole Library to Data File
     mainLibrary.SaveData(mainLibrary);
 }