public void Get_Message_Box_Should_Return_Null_When_Key_Not_Found() { var msg = FAMessageBoxManager.CreateMessageBox("Test"); FAMessageBoxManager.DeleteMessageBox("Test"); var msg2 = FAMessageBoxManager.GetMessageBox("Test"); Assert.Null(msg2); }
private void btnGetAdv_Click(object sender, EventArgs e) { FAMessageBox msg = FAMessageBoxManager.GetMessageBox(DEF_ADVBUTTON_MESSAGEBOX); if (msg == null || !msg.SavedResponse) { lblMessage.Text = "Advanced MessageBox is not shown yet or has not its value saved."; } else { lblMessage.Text = string.Format("You've selected {0} from Advanced MessageBox before.", msg.Show()); } }
private void button1_Click(object sender, EventArgs e) { FAMessageBox msg; msg = FAMessageBoxManager.GetMessageBox(DEF_BASIC_MESSAGEBOX); if (FAMessageBoxManager.GetMessageBox(DEF_BASIC_MESSAGEBOX) == null) { msg = FAMessageBoxManager.CreateMessageBox(DEF_BASIC_MESSAGEBOX, true); msg.AddButtons(MessageBoxButtons.YesNo); } msg.AllowSaveResponse = true; msg.SaveResponseText = "سوال را تکرار نکن"; msg.Text = "ایا موافق هستید"; msg.Caption = "سوال"; msg.Icon = FarsiMessageBoxExIcon.Exclamation; msg.PlaySound = true; string value = msg.Show(); lblMessage.Text = string.Format("You've selected {0} in Basic MessageBox.", value); }
private void btnCustom_Click(object sender, EventArgs e) { FAMessageBox msg; msg = FAMessageBoxManager.GetMessageBox(DEF_ADVBUTTON_MESSAGEBOX); if (FAMessageBoxManager.GetMessageBox(DEF_ADVBUTTON_MESSAGEBOX) == null) { msg = FAMessageBoxManager.CreateMessageBox(DEF_ADVBUTTON_MESSAGEBOX); msg.AddButton(new FAMessageBoxButton("Yes", "YES")); msg.AddButton(new FAMessageBoxButton("No", "NO")); msg.AddButton(new FAMessageBoxButton("Yes To All", "YESTOALL")); msg.AddButton(new FAMessageBoxButton("No To All", "NOTOALL")); } msg.AllowSaveResponse = true; msg.SaveResponseText = "Don't ask this question again."; msg.Text = "This file already exists. Overwrite?"; msg.Icon = FarsiMessageBoxExIcon.Question; string value = msg.Show(this); lblMessage.Text = string.Format("You've selected {0} in Advanced MessageBox.", value); }