void OnMergeItems() { var vm = new MergeViewModel(); var v = new MergeWindow(); v.DataContext = vm; v.Show(); }
private static void MergeTwo(long[] source, long[] buffer, MergeWindow window) { var iter_a = window.bound_a; var have_a = true; var iter_b = window.bound_b; var have_b = true; int i = window.bound_a; while (have_a && have_b) { var time_a = source[iter_a]; var time_b = source[iter_b]; var time_d = time_a - time_b; if (time_d > 0) { buffer[i++] = time_b; have_b = ++iter_b < window.bound_c; continue; } if (time_d < 0) { buffer[i++] = time_a; have_a = ++iter_a < window.bound_b; continue; } if (time_d == 0) { buffer[i++] = time_a; buffer[i++] = time_b; have_a = ++iter_a < window.bound_b; have_b = ++iter_b < window.bound_c; continue; } } while (have_a) { var time_a = source[iter_a]; buffer[i++] = time_a; have_a = ++iter_a < window.bound_b; } while (have_b) { var time_b = source[iter_b]; buffer[i++] = time_b; have_b = ++iter_b < window.bound_c; } }
private async Task ShowMergeWindowAsync() { await Task.Run(() => { Application.Current.Dispatcher.Invoke((Action) delegate { MergeWindow mergeWindow = new MergeWindow(_repositoryId); mergeWindow.ShowDialog(); }); }); }
private void btnMerge_Click(object sender, RoutedEventArgs e) { Status("Merging the fields started...please wait."); MergeWindow Mgwind = new MergeWindow(Dgv.FieldNamesAsDisplayed); Mgwind.ShowDialog(); if (Mgwind.DialogResult == true) { Db.Connect.MergeColumns(this.TableName, Mgwind.cmbFirst.SelectedItem.ToString(), Mgwind.txtBetween.Text.ToString(), Mgwind.cmbSecond.SelectedItem.ToString(), Mgwind.cmbResult.SelectedItem.ToString()); } Status("Merging is done...please refresh your window."); }