Esempio n. 1
0
        private void ButtonImport_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();

            dialog.CheckFileExists = true;
            dialog.CheckPathExists = true;
            dialog.Multiselect     = false;
            var result = dialog.ShowDialog();

            if (result.HasValue && result.Value)
            {
                var database = CarDatabaseXmlParser.DeserializeFromFile(dialog.FileName.Trim());
            }
        }
Esempio n. 2
0
        private void ButtonExport_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();

            dialog.CheckFileExists = false;
            dialog.CheckPathExists = false;
            dialog.Multiselect     = false;
            var result = dialog.ShowDialog();

            if (result.HasValue && result.Value)
            {
                CarDatabaseXmlParser.SerializeToFile(dialog.FileName.Trim(), dummyDatabase);
            }
        }