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); } }
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 OpenFile() { OFWindow w = new OFWindow(); w.ShowDialog(); string path = w.GetPath(); SettingReader reader = new SettingReader(); reader.SetDirectory(System.IO.Path.GetDirectoryName(path)); reader.SetFileName(System.IO.Path.GetFileName(path)); reader.Parse(); top.Tree(reader.GetNode()); }