Example #1
0
 private void SelectFile_Click(object sender, RoutedEventArgs e)
 {
     try {
         var of = new OFWindow(true)
         {
             AppendErrorDelegate   = AppBehind.Get.AppendError,
             RowHeightPlus         = AppBehind.Get.DataGridRowHeightPlus,
             OpenButtonCaption     = AppBehind.Get.OFWindowCaptions.OpenDatabaseButton,
             NewFileButtonCaption  = AppBehind.Get.OFWindowCaptions.NewDatabaseButton,
             FileNameColumnCaption = AppBehind.Get.OFWindowCaptions.FileNameColumn,
             OverwriteDialogTitle  = AppBehind.Get.OFWindowCaptions.OverwriteDialogTitle,
             OverwriteMessage      = AppBehind.Get.OFWindowCaptions.OverwriteMessage,
             Title = AppBehind.Get.OFWindowCaptions.CloneDatabaseTitle
         };
         of.Init();
         of.ShowDialog();
         if (null == of.SelectedPath || @"".Equals(of.SelectedPath))
         {
             return;
         }
         FilePathOutput.Content = of.SelectedPath;
         dataSourceTo           = of.SelectedPath;
     }
     catch (Exception ex) {
         AppBehind.Get.AppendError(ex.Message, ex);
     }
 }
 private void NewFile_Click(object sender, RoutedEventArgs e)
 {
     try {
         var of = new OFWindow(true)
         {
             AppendErrorDelegate   = AppBehind.Get.AppendError,
             RowHeightPlus         = AppBehind.Get.DataGridRowHeightPlus,
             OpenButtonCaption     = AppBehind.Get.OFWindowCaptions.OpenDatabaseButton,
             NewFileButtonCaption  = AppBehind.Get.OFWindowCaptions.NewDatabaseButton,
             FileNameColumnCaption = AppBehind.Get.OFWindowCaptions.FileNameColumn,
             OverwriteDialogTitle  = AppBehind.Get.OFWindowCaptions.OverwriteDialogTitle,
             OverwriteMessage      = AppBehind.Get.OFWindowCaptions.OverwriteMessage,
             Title = AppBehind.Get.OFWindowCaptions.NewDatabaseTitle
         };
         of.Init();
         of.ShowDialog();
         if (null == of.SelectedPath || @"".Equals(of.SelectedPath))
         {
             return;
         }
         AppBehind.Get.DBFilePath = of.SelectedPath;
         FilePathOutput.Content   = AppBehind.Get.DBFilePath;
         AppBehind.Get.Password   = PasswordInput.Text;
         DataBaseInitializer.Run();
         AppBehind.Get.Reload();
     }
     catch (Exception ex) {
         AppBehind.Get.AppendError(ex.Message, ex);
     }
 }