Example #1
0
        private void New_Click(object sender, RoutedEventArgs e)
        {
            Serializer serializer = new Serializer();
            SaveFileDialog saveFileDialog = new SaveFileDialog();

            if (saveFileDialog.ShowDialog() == true)
            {
                try
                {
                    serializer.CreateNewFile(saveFileDialog.FileName);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error: " + ex.Message);
                }
            }
        }
Example #2
0
        private void Open_Click(object sender, RoutedEventArgs e)
        {
            Serializer deserializer = new Serializer();
            OpenFileDialog openFileDialog = new OpenFileDialog();

            if (openFileDialog.ShowDialog() == true)
            {
                try
                {
                    deserializer.DeSerializeObject(openFileDialog.FileName);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error: " + ex.Message);
                }
            }
        }