private void autogenerateTimer_Tick(object sender, EventArgs e) { var result = AutoGenerate.autoGenerateTasks(); if (result && (listview1.Visibility == Visibility.Visible)) { ExecuteFirstSelectTable(); } }
private void AutoGenerateEditButton_Click(object sender, RoutedEventArgs e) { AutoGenerateEditWindow dlg = new AutoGenerateEditWindow(); dlg.Owner = this; dlg.WindowStartupLocation = WindowStartupLocation.CenterOwner; //dlg.descriptionString = tmpDescription; if (dlg.ShowDialog() == true) { AutoGenerate.autoGenerateTasks(); ExecuteFirstSelectTable(); } }
/// <summary> /// MainWindow /// </summary> public MainWindow() { MainWindowUtil.setLanguageSettings(); InitializeComponent(); if (string.IsNullOrEmpty(Properties.Settings.Default.Database_Folder)) { ShowWelcomeWindow(); } if (!setDBFolderSettings()) { MessageBox.Show("database folder is not selected."); Environment.Exit(1); } if (!setWorkFolderSettings()) { MessageBox.Show("work folder is not selected."); Environment.Exit(2); } Microsoft.Win32.SystemEvents.PowerModeChanged += new Microsoft.Win32.PowerModeChangedEventHandler(PowerModeChanged); if (!SQLiteClass.TouchDB(SQLiteClass.dbdirectory, SQLiteClass.dbpath)) { MessageBox.Show("database creation error."); Environment.Exit(3); } RecoverWindowSize(); AutoGenerate.autoGenerateTasks(); this.DataContext = MainViewModel.mv; ExecuteFirstSelectTable(); autogenerateTimer_start(); }