public void Raise(EventKey key, Object sender, DictionaryEventArgs e) { Monitor.Enter(eventSet); Delegate d; eventSet.TryGetValue(key, out d); try { if(d!=null) d.DynamicInvoke(new object[] {this, e}); } catch (Exception ex) { } Monitor.Exit(eventSet); }
public void HandleEvent(object Sender, DictionaryEventArgs args) { }
/// <summary> /// This method is called when the resource somehow changed. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The event arguments.</param> public void ResourceChanged(DependencyObject sender, DictionaryEventArgs e) { UpdateNewValue(); }
protected void OnEvent(DictionaryEventArgs e) { eventDictionaryHandler.Raise(eventKey, this, e); }
void DictionaryChanged(object sender, DictionaryEventArgs e) { Invalid = true; }
public override void HandleState(object sender, DictionaryEventArgs e) { IMedreferralCrudService service = XapServiceMgr.find <IMedreferralCrudService>(); String eventCode = AssToolEx.EventCodeOfEventArgs(e); if (eventCode.Equals("MedReferralSaveAction")) { if (ViewModel.MedReferralDO.Dt_referralperiodbegin > ViewModel.MedReferralDO.Dt_referralperiodend) { EventDelegate.ShowInfo(OrdParam.MESSAGE_TIEMCHECK); return; } if ((ViewModel.MedReferralDO.Str_name_di != null && ViewModel.MedReferralDO.Str_name_di.Length > 300) || (ViewModel.MedReferralDO.Reason_referral != null && ViewModel.MedReferralDO.Reason_referral.Length > 300) || (ViewModel.MedReferralDO.Des_initialdiag != null && ViewModel.MedReferralDO.Des_initialdiag.Length > 300) || (ViewModel.MedReferralDO.Des_question != null && ViewModel.MedReferralDO.Des_question.Length > 300) || (ViewModel.MedReferralDO.Diagtreatment != null && ViewModel.MedReferralDO.Diagtreatment.Length > 300)) { EventDelegate.ShowInfo("填写内容超长!"); return; } if (String.IsNullOrWhiteSpace(ViewModel.MedReferralDO.Str_name_di) || String.IsNullOrWhiteSpace(ViewModel.MedReferralDO.Reason_referral) || String.IsNullOrWhiteSpace(ViewModel.MedReferralDO.Name_org_referral2)) { EventDelegate.ShowInfo("请填写必填项!"); return; } dataSource = service.save(new MedReferralDO[] { ViewModel.GetFormDataSource() as MedReferralDO })[0]; if (null != dataSource) { LogicEx.GetInstance().CopyTo <MedReferralDO>(dataSource, ViewModel.MedReferralDO); EventDelegate.SetStatusMsg("医保转诊单保存成功。"); } else { EventDelegate.ShowInfo("医保转诊单保存失败。"); } } else if (eventCode.Equals("MedReferralPrintAction")) { if (ViewModel.MedReferralDO == null || ViewModel.MedReferralDO.Id_medreferral == null) { return; } bool res = false; string strFile = "iih_report/461010_menzhenyishengzhan/YBZZD.xml"; Dictionary <string, string> qryParams = new Dictionary <string, string>(); qryParams.Add("$id_medreferral", ViewModel.MedReferralDO.Id_medreferral); res = this.rpt_viewer.PrintRptFile(strFile, qryParams, true); if (res) { ViewModel.MedReferralDO.Times_print += 1; ViewModel.MedReferralDO.Status = DOStatus.UPDATED; dataSource = service.save(new MedReferralDO[] { ViewModel.MedReferralDO })[0]; eventPrint(null, null); } } }
public void OnControllerStartProcess(object sender, DictionaryEventArgs args) { btnCancelProcess.Enabled = true; }
public void TestSetup() { eventArgs = new DictionaryEventArgs(); }
public override void HandleState(object sender, DictionaryEventArgs eventArgs) { string uiEvent = eventArgs.Data[UIConst.UI_EVENT] as string; if (null == model) { return; } switch (uiEvent) { case OpActionConstant.OP_REFRESH_ALL_ACTION: // 门诊刷新 case EventCodeType.EVENT_ORDI_SAVESUCCE: if (this.ent4BannerDTO != null && !string.IsNullOrEmpty(this.ent4BannerDTO.Id_ent)) { model.Reload(this.ent4BannerDTO.Id_ent); this.textBoxDi.Contentstr = model.GetPatDiDescription(); this.textBoxDi.Invalidate(); } break; case "EmrPer": model.Reload(this.ent4BannerDTO.Id_ent); String info = model.GetPatDiDescription(); AssToolEx.SentMessage(this, "PatDiDesc", "PatDiDesc", info); break; case OpActionConstant.OP_COMPLETE_DI_SEND_ACTION: if (RelativeUIParam.RELATIVERATIO <= RelativeUIParam.TEMPLETECHANGEDRATIO) { if (CheckDiEditable()) { Dictionary <string, object> dataDic = new Dictionary <string, object>(); dataDic.Add(OpActionConstant.OP_COMPLETE_DI_RECEIVE_ACTION, null); sentMessage(OpActionConstant.OP_COMPLETE_DI_RECEIVE_ACTION, dataDic, sender); } } break; case OpActionConstant.OP_DI_SEND_OR_SIGN_ACTION: if (RelativeUIParam.RELATIVERATIO <= RelativeUIParam.TEMPLETECHANGEDRATIO) { if (CheckDiEditable()) { Dictionary <string, object> dataDic = new Dictionary <string, object>(); dataDic.Add(OpActionConstant.OP_DI_RECEIVE_OR_SIGN_ACTION, null); sentMessage(OpActionConstant.OP_DI_RECEIVE_OR_SIGN_ACTION, dataDic, sender); } } break; case OpActionConstant.OP_DI_SEND_OR_OPEN_ACTION: if (RelativeUIParam.RELATIVERATIO <= RelativeUIParam.TEMPLETECHANGEDRATIO) { if (CheckDiEditable()) { Dictionary <string, object> dataDic = new Dictionary <string, object>(); dataDic.Add(OpActionConstant.OP_DI_RECEIVE_OR_OPEN_ACTION, null); sentMessage(OpActionConstant.OP_DI_RECEIVE_OR_OPEN_ACTION, dataDic, sender); } } break; } }
/// <summary> /// 事件状态处理方法 /// </summary> /// <param name="sender"></param> /// <param name="eventArgs"></param> public override bool OnEventHandle(object sender, DictionaryEventArgs e) { bool result = true; switch (AssToolEx.EventCodeOfEventArgs(e)) { /*执行新建医疗单操作*/ case EventCodeType.EVENT_EMS_CREATE: result = HandleCreateEms(AssToolEx.ObjectOfEventArgs(e, EmsCreatedParameter.TAGKEY) as EmsCreatedParameter, AssToolEx.ParameterOfEventArgs(e)); if (!result) { HandleCancelEmsEvent(); } break; /*执行编辑修改操作*/ case EventCodeType.EVENT_EMS_ORDER_EDIT: result = HandleEditOrder((AssToolEx.ObjectOfEventArgs(e, OrderEditParameter.TAGKEY) as OrderEditParameter).OrderItem); break; case EventCodeType.EVENT_EMS_DIRECT_EDIT: result = HandleEditEmsDTO((AssToolEx.ObjectOfEventArgs(e, EmsEditParameter.TAGKEY) as EmsEditParameter).EmsDTO); break; /*执行保存医疗单操作*/ case EventCodeType.EVENT_EMS_SAVE: result = HandleSaveEmsEvent(AssToolEx.ObjectOfEventArgs(e, "EmsOrDrugList")); break; /*执行保存医疗单操作*/ case EventCodeType.EVENT_EMS_SAVESUCCESS: result = HandleSaveSuccessEvent(); break; /*执行取消操作*/ case EventCodeType.EVENT_EMS_CLOSE: result = HandleCancelEmsEvent(); break; /*新增一行空数据*/ case EventCodeType.EVENT_EMS_APPEND: result = this.HandleAppendSrvEvent(); break; /*执行删除操作*/ case EventCodeType.EVENT_EMS_DELETE: result = HandleDeleteSrvEvent(); break; /*处理打开诊断对话框*/ case EventCodeType.EVENT_ORDI_EDIT: result = HandleOpenDIEvent(this, this.ent4BannerDTO); break; /*处理诊断证明*/ case EventCodeType.THIRD_EVENT_ORSRV_OPOD_OPEN: result = HandleProofOfDiagEvent(this.ent4BannerDTO); break; case EventCodeType.EVENT_ORDI_SAVESUCCE: HandleOrDiSaveSuccess(this.isFirstVisit, AssToolEx.ObjectOfEventArgs(e, "DIDTOLIST") as List <DIDTO>); break; case EventCodeType.EVENT_EMS_APBU_ADD: result = this.GetEmsView().OnEventHandle(sender, e); break; case EventCodeType.EVENT_EMS_ENSTATUS_FIRST: this.isFirstVisit = true; break; case EventCodeType.EVENT_EMS_ENSTATUS_RETURN: this.isFirstVisit = false; break; case EventCodeType.EVENT_EMS_REFRESH: result = HandleFreshEvent(); break; case EventCodeType.EVENT_EXPENSE_DATACHANGED: result = this.GetEmsView().OnEventHandle(sender, e); break; case EventCodeType.EVENT_EMS_DRUG_USAGE: result = this.GetEmsView().OnEventHandle(sender, e); break; case EventCodeType.EVENT_EMS_CARDFOCUS: result = this.GetEmsView().OnEventHandle(sender, e); break; default: result = base.OnEventHandle(sender, e); break; } return(result); }
private void HandleFire(object sender, DictionaryEventArgs eventArgs) { result = $"Event Fired at {DateTime.Now.ToShortTimeString()}\r\nEvent Args:{eventArgs.ToJson()}\r\n"; }
public override bool OnEventHandle(object sender, DictionaryEventArgs e) { // 当前未加载完成或者未创建完成 不进行消息事件的相应 if (this.IsLoading) { return(false); } if (!this.Created) { return(false); } if (!this.IsXapFormReady) { return(false); } switch (AssToolEx.EventCodeOfEventArgs(e)) { case EventCodeType.NM_EMS_ORSRV_SELECTCHANGED: if (this.GetViewModel() != null && this.GetViewModel().GetSelectedObject() != null) { this.updateDrugInfo(this.GetViewModel().GetSelectedObject() as EmsOrDrug); if (hpCanEdit()) { SetHpControlEnabled(); } else { this.setHpBaseUserRender(false); } return(true); } break; case EventCodeType.NM_EMS_ORSRV_DATACHANGED: var useDay = AssToolEx.ObjectOfEventArgs(e, "Use_days"); var frecq = AssToolEx.ObjectOfEventArgs(e, "Name_freq"); this.updateDrugInfo(this.GetViewModel().GetSelectedObject() as EmsOrDrug); if (hpCanEdit()) { SetHpControlEnabled(); } else { this.setHpBaseUserRender(false); } if (useDay != null || frecq != null) { var cardDataSource = (GetViewModel().GetFormDataSource() as EmsDrugItemDO); if (cardDataSource.Fg_mp_in != null && cardDataSource.Fg_mp_in.GetValueOrDefault()) { int totalCount = this.GetLogicEx().GetDrugUseTotalCount(this.GetViewModel().GetEmsUIDTO() as EmsUIDTO); if (totalCount > 0) { var mapinlabel = AssXapFormUtils.GetUserRender(this.GetXapFormControl(), "orcard.times_mp_in") as XLabelBaseUserRender; if (mapinlabel != null) { // 在院执行次数跟随总次数变化一致 var numRender = mapinlabel.UserRender as XNumbericUpDown; numRender.MaxValue = totalCount; // if (cardDataSource.Times_mp_in > totalCount) { cardDataSource.Times_mp_in = totalCount; } } } } } else { // 在院执行次数 HandleTimesMpInInfo(this.ciPharmMpInUsageScope, this.GetViewModel().GetFormDataSource() as EmsDrugItemDO); } break; case EventCodeType.EVENT_EXPENSE_DATACHANGED: handleExpenseDataChanged(sender, e); break; case EventCodeType.EVENT_EMS_DRUG_USAGE: (AssXapFormUtils.GetUserRender(this.GetXapFormControl(), "orcard.name_routedes") as XLabelBaseUserRender).UserRender.Focus(); break; case EventCodeType.EVENT_EMS_REFRESULT: drugHpShow(); break; default: break; } return(base.OnEventHandle(sender, e)); }
/// <summary> /// 发送事件 /// </summary> /// <param name="strCommond"></param> /// <param name="sender"></param> protected void onFireEventSent(string strCommond, object sender) { DictionaryEventArgs args = new DictionaryEventArgs(); args.Data.Add(UIConst.UI_EVENT, strCommond); this.FireEventSent(sender, args); }
public override void HandleState(object sender, DictionaryEventArgs eventArgs) { string uiEvent = eventArgs.Data[UIConst.UI_EVENT] as string; string newState = eventArgs.Data[UIConst.NEW_STATE] as string; switch (uiEvent) { case UIEvent.SAVE_SUCCESS: if (Created) { this.LoadData(); } break; case UIEvent.LOAD: Dictionary <string, object> dic = eventArgs.Data[UIConst.DATA] as Dictionary <string, object>; if (dic != null) { if (dic.Keys.Contains("PatientData")) { ent4BanerDto = (dic["PatientData"] as BannerData).Ent4BannerDTO; } if (dic.Keys.Contains("EncounterID")) { // patDo.Id_ent = dic["EncounterID"].ToString(); } } break; case "Cipres": OrderPresSplitDTO[] PRESS = this.xapFormControl1.GetSelected <OrderPresSplitDTO>(); if (PRESS != null || PRESS.Count() > 0) { OpOrderPresPrinForm printview = new OpOrderPresPrinForm(); printview.presdto = PRESS[0]; printview.printPres(); printview.Size = new Size(1000, 700); printview.ShowDialog(); } break; case UIEvent.PRINT: // this.OnPrint(); break; case UIEvent.ADD: //this.OnAdd(); break; case UIEvent.DELETE: //this.Delete(); break; case UIEvent.DISABLE: // this.UpdateActivestate(ActiveStateEnum.STOP); break; case UIEvent.ENABLE: //this.UpdateActivestate(ActiveStateEnum.ACTIVE); break; default: break; } }
/// <summary> /// Fire the event. /// </summary> /// <param name="sender">The sender of the event.</param> /// <param name="args">The event arguments.</param> internal static void Invoke(DependencyObject sender, DictionaryEventArgs args) { List<WeakReference> purgeList = new List<WeakReference>(); for (int i = 0; i < listeners.Count; i++) { WeakReference wr = listeners[i]; if (wr.IsAlive) ((IDictionaryEventListener)wr.Target).ResourceChanged(sender, args); else purgeList.Add(wr); } foreach (WeakReference wr in purgeList) listeners.Remove(wr); purgeList.Clear(); }
public void HandleEvent(object Sender, DictionaryEventArgs args) { File.WriteAllText(args.Values["FileName"].ToString(), args.Values["Contents"].ToString()); }
public override void HandleState(object sender, DictionaryEventArgs eventArgs) { string uiEvent = eventArgs.Data[UIConst.UI_EVENT] as string; //string newState = eventArgs.Data[UIConst.NEW_STATE] as string; switch (uiEvent) { case UIEvent.LOAD: Dictionary <string, object> dic = eventArgs.Data["Data"] as Dictionary <string, object>; string str = dic["BeanConfigFilePath"].ToString(); string[] strs = str.Split('\\'); string xml = strs[strs.Length - 1]; switch (xml) { case CiDictCodeTypeConst.CICONS_RESPONSE: this.type = CiDictCodeConst.CONS_RESPONSE; this.funId = CiDictCodeTypeConst.CICONS_RESPONSE_ID; break; case CiDictCodeTypeConst.CICONS_REVIEW_ADM: this.type = CiDictCodeConst.CONS_MADREVIEW; this.funId = CiDictCodeTypeConst.CICONS_REVIEW_ADM_ID; break; case CiDictCodeTypeConst.CICONS_REVIEW_DEP: this.type = CiDictCodeConst.CONS_DEPREVIEW; this.funId = CiDictCodeTypeConst.CICONS_REVIEW_DEP_ID; break; case CiDictCodeTypeConst.CICONS_RESPONSE_DIAG: this.funId = CiDictCodeTypeConst.CICONS_RESPONSE_DIAG_ID; this.id_ent = dic["Id_ent"].ToString(); this.model.GetConsByIdent(UserManager.getInstance().CurrentDept.Id_dep, id_ent); if (this.patvView != null && this.patvView.Created) { this.patvView.model = this.model; this.patvView.LoadData(); } //this.LoadData(); break; default: break; } break; case "AgreeSuccess": this.model.ConsDto = null; //if (patvView.ViewFile!=null) this.patvView.ClearForm(); this.xapFormControl.ClearFormData(); this.OnLoadData(); break; case "Query": this.patvView.ClearForm(); this.patvView.btnEmr.Enabled = false; this.xapFormControl.ClearFormData(); this.btnEdit.Enabled = false; this.btSave.Enabled = false; this.btnCancle.Enabled = false; string[] str1 = { "dt_plan", "fg_urgent", "des_psp", "des_emr", "place" }; this.ConsApContrlsEnable(str1, false); break; default: break; } }
public static object ParameterOfEventArgs(DictionaryEventArgs eventArgs) { return(ObjectOfEventArgs(eventArgs, "param")); }
public override void HandleState(object sender, DictionaryEventArgs eventArgs) { DictionaryEventArgs de = new DictionaryEventArgs(); string uiEvent = eventArgs.Data[UIConst.UI_EVENT] as string; string newState = eventArgs.Data[UIConst.NEW_STATE] as string; switch (uiEvent) { case UIEvent.LOAD: break; //case UIEvent.SAVE:// 点击保存按钮 // //case OpActionConstant.OP_SUSPEND_ACTION: // 点击待回诊按钮 // this.fireCiEmrSaveEvent(new Dictionary<string, object>()); // break; //case OpActionConstant.EMR_PRINT_ACTION:// 打印病历事件 // de.Data.Add(UIConst.UI_EVENT, AssistantConstant.CI_EMR_PRINT_EVENT); // this.FireEventSent(this, de); // break; //case OpActionConstant.EMR_PRINT_VIEW_ACTION:// 病历打印预览事件 // de.Data.Add(UIConst.UI_EVENT, AssistantConstant.CI_EMR_PRINT_PRIVEW_EVENT); // this.FireEventSent(this, de); // break; case EventCodeType.EVENT_ORDI_SAVESUCCE: // 诊断保存成功事件 Dictionary <string, Object> dict = eventArgs.Data[UIConst.DATA] as Dictionary <string, Object>; object dataObj = dict["DIDTOLIST"]; DIDTO[] didtos = dataObj == null ? null : (dataObj as List <DIDTO>).ToArray(); this.fireCidiWriteToEmrEvent(didtos); break; case OpActionConstant.EMR_SYNC_CIDI_CIORD_ACTION: // 诊断处置同步到病历 //this.fireCidiWriteToEmrEvent(emrViewModel.GetDIDTO(ent4BannerDTO.Id_ent));//诊断回写到病历 if (null != emrViewModel && null != ent4BannerDTO && !string.IsNullOrEmpty(ent4BannerDTO.Id_ent)) { this.sendCiOrdersToEmr(emrViewModel.GetCiOrderDOs(ent4BannerDTO.Id_ent), true); } break; case OpActionConstant.EMR_SYNC_CIDI_ACTION: this.fireCidiWriteToEmrEvent(emrViewModel.GetDIDTO(ent4BannerDTO.Id_ent)); //诊断回写到病历 break; case OpActionConstant.EMR_SYNC_CIORD_ACTION: this.sendCiOrdersToEmr(emrViewModel.GetCiOrderDOs(ent4BannerDTO.Id_ent), false); //处置回写到病历 break; case AssistantConstant.CI_EMR_WRITE_BACK_EVENT: // 就诊历史、组套病历段落回写触发事件 Dictionary <string, object> dataIdc = eventArgs.Data[UIConst.DATA] as Dictionary <string, object>; this.fireCiEmrWriteBackEvent(dataIdc); break; case EmrEditorConst.OP_REVOKEEN_ACTION: // 点击撤回按钮,设置病历的可编辑状态 this.SentModel2PubCiMrReadOnlyEvent(); break; } }
public static void SentMessage(XapBaseControl owner, DictionaryEventArgs args) { owner.FireEventSent(owner, args); }
/// <summary> /// This method is called when the resource somehow changed. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The event arguments.</param> public void ResourceChanged(DependencyObject sender, DictionaryEventArgs e) { ClearItemFromResourceBuffer(e); if (sender == null) { UpdateNewValue(); return; } // Update, if this object is in our endpoint list. var targetDOs = (from p in GetTargetPropertyPaths() select p.EndPoint.TargetObject as DependencyObject); foreach (var dObj in targetDOs) { #if !SILVERLIGHT if (LocalizeDictionary.Instance.DefaultProvider is InheritingResxLocalizationProvider) { UpdateNewValue(); break; } #endif var doParent = dObj; while (doParent != null) { if (sender == doParent) { UpdateNewValue(); break; } #if !SILVERLIGHT if (!(doParent is Visual) && !(doParent is Visual3D) && !(doParent is FrameworkContentElement)) { UpdateNewValue(); break; } #endif try { DependencyObject doParent2; #if !SILVERLIGHT if (doParent is FrameworkContentElement) { doParent2 = ((FrameworkContentElement)doParent).Parent; } else #endif doParent2 = VisualTreeHelper.GetParent(doParent); if (doParent2 == null && doParent is FrameworkElement) { doParent2 = ((FrameworkElement)doParent).Parent; } doParent = doParent2; } catch { UpdateNewValue(); break; } } } }
public static string EventCodeOfEventArgs(DictionaryEventArgs eventArgs) { return(eventArgs.Data[UIConst.UI_EVENT] as string); }
private static void WriteHelloWorld2(object sender, DictionaryEventArgs e) { Console.WriteLine("hello, world!!!2222"); }
public static DictionaryEventArgs ResetDataOfEventArgs(DictionaryEventArgs eventArgs, object dataObj) { eventArgs.Data[UIConst.DATA] = dataObj; return(eventArgs); }
public static DictionaryEventArgs ResetEventOfEventArgs(DictionaryEventArgs eventArgs, object eventCode) { eventArgs.Data[UIConst.UI_EVENT] = eventCode; return(eventArgs); }
public override void HandleState(object sender, DictionaryEventArgs eventArgs) { }
/// <summary> /// Fire the event. /// </summary> /// <param name="sender">The sender of the event.</param> /// <param name="args">The event arguments.</param> internal static void Invoke(DependencyObject sender, DictionaryEventArgs args) { lock (listenersLock) { foreach (var wr in listeners.ToList()) { if (wr.IsAlive) ((IDictionaryEventListener)wr.Target).ResourceChanged(sender, args); else listeners.Remove(wr); } } }
public void UpdatePatientInfo(object sender, DictionaryEventArgs eventArgs) { }