Beispiel #1
0
        private void FileSave_Click(object sender, RoutedEventArgs e)
        {
            //Here you can chose either XMLSerializer needed or BinarySerializer one
            SaverLoader saver = new SaverLoader(new BinarySerializer());

            saver.Save <List <Employee> >((List <Employee>)dgEmployees.ItemsSource);
        }
Beispiel #2
0
        //all the try/catch logics are implementing within thw SaveLoader class
        private void FileLoad_Click(object sender, RoutedEventArgs e)
        {
            //Here you can chose either XMLSerializer needed or BinarySerializer one
            SaverLoader loader = new SaverLoader(new BinarySerializer());

            listOfEmployes          = loader.Load <List <Employee> >();
            dgEmployees.ItemsSource = listOfEmployes;
        }