Ejemplo n.º 1
0
 private void ButtonAddElement(object sender, RoutedEventArgs e)
 {
     try
     {
         var dlg    = new Microsoft.Win32.OpenFileDialog();
         var result = dlg?.ShowDialog();
         _main.AddFromFile(dlg.FileName);
     }
     catch (Exception)
     {
         MessageBox.Show("Add error");
     }
     finally
     {
         ErrorMsg();
     }
 }
Ejemplo n.º 2
0
 private void Add_FromFile_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         Microsoft.Win32.OpenFileDialog Dialog = new Microsoft.Win32.OpenFileDialog();
         if ((bool)Dialog.ShowDialog())
         {
             MainCollection.AddFromFile(Dialog.FileName);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Add From File error: " + ex.Message);
     }
     finally
     {
         ErrorMsg();
     }
 }