Exemplo n.º 1
0
 private void Open_btn_Click(object sender, RoutedEventArgs e)
 {
     if (mainCollection.CollectionChangedAfterSave)
     {
         UnsavedChanges();
     }
     Microsoft.Win32.OpenFileDialog dialog = new Microsoft.Win32.OpenFileDialog();
     if ((bool)dialog.ShowDialog())
     {
         mainCollection = new V2MainCollection();
         mainCollection.Load(dialog.FileName);
         DataContext = mainCollection;
     }
     MessageError();
 }
Exemplo n.º 2
0
        private void OpenClick(object sender, RoutedEventArgs e)
        {
            if (MainCollection.IsSave || SaveDialog())
            {
                OpenFileDialog OpenDialog = new OpenFileDialog {
                    Filter      = "Binary data|*.dat|All|*.*",
                    FilterIndex = 1
                };

                if (OpenDialog.ShowDialog() == true)
                {
                    MainCollection = new V2MainCollection();
                    MainCollection.Load(OpenDialog.FileName);
                    Resources["MainCollection"] = MainCollection;
                }
            }
        }