private void btnStart_click(object sender, RoutedEventArgs e) { if (!CheckInput()) { return; } var sb = new StringBuilder(); sb.Append("threshold".ElementText(txtthreshold.Text)); sb.Append("rtspId".ElementText(txtrtspId.Text)); sb.Append("rtspPath".ElementImage(txtrtsp.Text)); sb.Append("responseType".ElementBegin()); var messageType = ((ComboBoxItem)cmbMessageType.SelectedItem).Content.ToString(); if (messageType == callback) { sb.Append("type".ElementText("callback")); } else { sb.Append("type".ElementText("messageQueue")); } sb.Append("size".ElementText(txtsize.Text)); sb.Append("responseType".ElementEnd()); sb.Append("maxImageCount".ElementText("3")); sb.Append("frames".ElementText(txtframe.Text)); var data = sb.ToString(); var xml = XmlParse.GetXml("dynamicDetect", data); var content = FaceServices.FaceProxy.send(xml); if (content.IsEmpty()) { WarnDialog(community_error); return; } var doc = XmlParse.LoadXml(content); var code = doc.GetNodeText("code"); Item("code->" + code); if (code.ToInt32() == status_ok) { if (messageType == callback) { Setcallback(); } else { stopPool = false; Loopquery(); } btnStart.IsEnabled = false; } else { CustomDialog.Show("操作返回错误!"); } }
public async Task createDialogAsync(string tagId, string TagTechs, string ndefMessage) { //make dialog accept the id and data var dialog = new CustomDialog(this, tagId, TagTechs, ndefMessage); dialog.Show(); await Task.Delay(2000); dialog.Dismiss(); this.Finish(); }
private async void InsertQuote() { var quote = await CustomDialog.Show <Quote>(_currentWindow, "Insert quote"); if (quote is null) { return; } var table = QuoteFormat.Create(quote); _currentWindow.TextEditor.InsertBlock(table); }
private void ShowXmlDialog(string xml) { CustomDialog dialog = new CustomDialog(); XmlViewSingleContent content = new XmlViewSingleContent(); SingleDirectionData data = new SingleDirectionData(); content.DataContext = data; XmlDocument doc = new XmlDocument(); doc.LoadXml(xml); data.Document = doc; dialog.Content = content; dialog.MaxWidth = 800; dialog.AddOkButton(); dialog.AddButton("reformat", Reformat, System.Windows.Input.Key.R, System.Windows.Input.ModifierKeys.Alt, "Reformat"); dialog.Show(); }
/// <summary> /// Show Alert Dialog /// </summary> /// <param name="activity">Activity instance</param> /// <param name="title">title of alert dialog</param> /// <param name="messsage">message to show alert dialog</param> /// <returns>Dialog</returns> public Dialog ShowAlertDialog(string title, string messsage, string positivebtn, string negativeBtn) { try { Dialog dialog = null; dialog = new CustomDialog().CreateDialog(mActivity, title, messsage, negativeBtn, positivebtn, new EventHandler(async delegate(Object o, EventArgs a) { if (dialog != null) { dialog.Dismiss(); dialog = null; } bool isDeleted = await DeleteCRMNotes(); if (isDeleted) { CallBackScreen(); } }), new EventHandler(delegate(Object o, EventArgs a) { if (dialog != null) { dialog.Dismiss(); dialog = null; } }), true, true); dialog.SetCancelable(true); dialog.Show(); return(dialog); } catch (Exception e) { return(null); } }
/// <summary> /// Show Alert Dialog /// </summary> /// <param name="activity">Activity instance</param> /// <param name="title">title of alert dialog</param> /// <param name="messsage">message to show alert dialog</param> /// <returns>Dialog</returns> public Dialog ShowAlertDialog(Activity activity, string title, string messsage, string positivebtn, string negativeBtn) { try { Dialog dialog = null; dialog = new CustomDialog().CreateDialog(activity, title, messsage, negativeBtn, positivebtn, new EventHandler(delegate(Object o, EventArgs a) { if (dialog != null) { dialog.Dismiss(); dialog = null; } }), new EventHandler(delegate(Object o, EventArgs a) { if (dialog != null) { dialog.Dismiss(); dialog = null; } }), true, false); dialog.SetCancelable(true); dialog.Show(); return(dialog); } catch (Exception e) { return(null); } }