public bool ShowDialogWarningMsg(string text) { if (_msgBox != null) { bool ret = false; SystemContext.Instance.AsyncOperation.SynchronizationContext.Post( state => { ret = _msgBox.ShowDialogWarningMsg(text); }, null); return(ret); } else { MessageBoxResult result = MessageBox.Show(text, "提示"); return(result == MessageBoxResult.OK); } }
private void ShutdownProgramCallback(SysCommonMsgArgs <string> args) { IMessageBox _msgBox = IocManagerSingle.Instance.GetPart <IMessageBox>(); if (!string.IsNullOrWhiteSpace(args.Parameters)) { if (_msgBox.ShowDialogWarningMsg(args.Parameters)) { Application.Current.Shutdown(); } } else { Application.Current.Shutdown(); } }