private void add_btn_OnClick(object sender, RoutedEventArgs e) { ImportWindow importWindow = new ImportWindow(album); importWindow.Show(); importWindow.FilesImported += OnFilesImported; }
private void ButtonImport_OnClick(object sender, RoutedEventArgs e) { try { var importWindow = new ImportWindow(_streamDeckPanel.BindingHash); importWindow.Show(); SetFormState(); } catch (Exception ex) { Common.LogError(ex); } }
/// <summary> /// 支出管理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tsbExpenditure_Click(object sender, EventArgs e) { if (null == importWindow || importWindow.IsDisposed) { importWindow = new ImportWindow(); importWindow.MdiParent = this; importWindow.StartLoad += (obj, ev) => { StartLoad(obj); }; importWindow.StopLoad += (obj, ev) => { StopLoad(obj); }; importWindow.Show(); } SetSelect(tsbExpenditure, tsmiExpenditure); importWindow.Activate(); }
/// <summary> /// Command callback /// Opens the import window. /// </summary> private void OnImport() { ImportWindow wnd = new ImportWindow(); wnd.Show(); }
/// <summary> /// 点击 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void ButtonClick(object sender, RoutedEventArgs e) { if (!(sender is Button btn)) { return; } if (btn.Name.Equals(BtnChoose.Name)) { var dialog = new OpenFileDialog { Filter = "文本文件 (*.txt)|*.txt", RestoreDirectory = true }; if (dialog.ShowDialog() == true) { _vm.LogText = $"用户选择了账号文件:{dialog.FileName}"; _vm.Status.AccountFile = dialog.FileName; LoadUsers(_vm.Status.AccountFile); } } if (btn.Name.Equals(BtnSave.Name)) { if (_vm.Goods != null) { //验证字段是否 SaveGoods(_vm.Goods); } } if (btn.Name.Equals(BtnImport.Name)) { var im = new ImportWindow(this); im.Closed += ImportWindowClosed; im.Show(); } if (btn.Name.Equals(BtnRefresh.Name)) { //查询 _loadList(); } if (btn.Name.Equals(BtnRestart.Name)) { RestartTask(); } if (btn.Name.Equals(BtnStartRelease.Name)) { StartTask(); } if (btn.Name.Equals(BtnStopRelease.Name)) { StopTask(); } //保存配置文件 if (btn.Name.Equals(BtnSaveConfig.Name)) { SaveConfig(); Api.EnableProxy = _vm.Status.UseProxy; } }