private void ReloadVBComponents() { DialogResultEx result = DialogResultEx.None; _changedFiles.ForEach(repoFile => { var fileInfo = new FileInfo(repoFile.FilePath); var name = Path.GetFileNameWithoutExtension(fileInfo.Name); var project = repoFile.Project; if (project != null && project.Contains(name)) { switch (fileInfo.Extension) { case VBComponentExtensions.ClassExtesnion: case VBComponentExtensions.DocClassExtension: case VBComponentExtensions.FormExtension: case VBComponentExtensions.StandardExtension: { switch (result) { case DialogResultEx.Yes: case DialogResultEx.No: case DialogResultEx.None: { using (ReloadFileForm form = new ReloadFileForm(fileInfo.FullName)) { NativeWindow window = new NativeWindow(); window.AssignHandle(new IntPtr(_vbe.MainWindow.HWnd)); result = form.ShowDialog(window); window.ReleaseHandle(); switch (result) { case DialogResultEx.Yes: case DialogResultEx.YesToAll: ReloadVBComponent(project, name, fileInfo.FullName); break; } } } break; case DialogResultEx.YesToAll: ReloadVBComponent(project, name, fileInfo.FullName); break; } } break; } } }); _changedFiles.Clear(); }
protected override bool ProcessDialogKey(Keys keyData) { if (keyData == Keys.Escape) { _Dialog_Result = DialogResultEx.取消操作; this.DialogResult = System.Windows.Forms.DialogResult.OK; } return base.ProcessDialogKey(keyData); }
public ReloadFileForm(string filePath) { InitializeComponent(); LabelInfo.Text = string.Format(VBAGitUI.ReloadFileForm_Info, filePath); Yes.Text = VBAGitUI.Yes; YesToAll.Text = VBAGitUI.YesToAll; No.Text = VBAGitUI.No; NoToAll.Text = VBAGitUI.NoToAll; _dialogResult = DialogResultEx.None; }
private Boolean ValidaFiles() { foreach (FileInfo file in this.MissedAttachments) { DialogResultEx valueres = MessageBoxWB4.Show("Publicación de contenido", "El archivo incrustado " + file.FullName + " no se encontró,¿Desea continuar?"); if (valueres == DialogResultEx.CANCEL) { return(false); } if (valueres == DialogResultEx.YESALL) { return(true); } } return(true); }
private void Button_Click(object sender, EventArgs e) { String text = (sender as Button).Text; switch (text) { case "OK": dialogResult = DialogResultEx.OK; break; case "NO": dialogResult = DialogResultEx.No; break; case "Yes": dialogResult = DialogResultEx.Yes; break; case "Retry": dialogResult = DialogResultEx.Retry; break; case "Cancel": dialogResult = DialogResultEx.Cancel; break; case "GetInfo": dialogResult = DialogResultEx.GetInfo; break; case "Delete": dialogResult = DialogResultEx.Delete; break; case "Updata": dialogResult = DialogResultEx.Updata; break; default: break; } this.Close(); }
private void Return_Click(object sender, EventArgs e) { if (EditManager.EditShouldPadInfoList.Count > 1) { DialogResultEx dialogResultEx = MessageBoxEX.Show("图形已经被修改,是否进行保存!", MessageBoxButtonType.YesCancel); if (dialogResultEx == DialogResultEx.Yes) { if (EditManager.HaveIrregularPoint) { MessageBoxEX.Show("图中存在无效点,请重新编辑!"); } else if (EditManager.GetShapePointLength > 300) { MessageBoxEX.Show("花型针数超过300针,请重新编辑!"); } else { EditManager.Edit_SaveAllParam(); EditManager.ShouldPadShapeInfo = EditManager.EditShouldPadInfoList[EditManager.EditShouldPadInfoList.Count - 1].ShouldPadShapeInfo; LowerMachineStatueData.LowerMachineStatueDateEx.EditStatue = false; this.Close(); } } else { EditManager.ShouldPadShapeInfo = EditManager.EditShouldPadInfoList[0].ShouldPadShapeInfo; LowerMachineStatueData.LowerMachineStatueDateEx.EditStatue = false; this.Close(); } } else { this.Close(); LowerMachineStatueData.LowerMachineStatueDateEx.EditStatue = false; } }
private void NoToAll_Click(object sender, EventArgs e) { _dialogResult = DialogResultEx.NoToAll; Close(); }
private void Yes_Click(object sender, EventArgs e) { _dialogResult = DialogResultEx.Yes; Close(); }
private void btnSaveDJ_Click(object sender, EventArgs e) { _Dialog_Result = DialogResultEx.保存单据; this.DialogResult = System.Windows.Forms.DialogResult.OK; }
private void btnFQTC_Click(object sender, EventArgs e) { _Dialog_Result = DialogResultEx.废弃退出; this.DialogResult = System.Windows.Forms.DialogResult.OK; }
private void buttonCancel_Click(object sender, System.EventArgs e) { this.res = DialogResultEx.CANCEL; this.Close(); }
private void buttonYes_Click(object sender, System.EventArgs e) { this.res = DialogResultEx.YES; this.Close(); }
private void buttonYesAll_Click(object sender, System.EventArgs e) { this.res = DialogResultEx.YESALL; this.Visible = false; this.Close(); }