/// <summary> /// 更新菜单实例信息 /// </summary> /// <param name="instanceId">菜单实例地址 </param> /// <param name="instanceKey">该实例菜单关键字 </param> /// <param name="lst">所有菜单实例信息的集合,必须包含一个节点信息为 fatherId=0的根节点</param> public void UpdateMenuInstanceRelation(int instanceId, string instanceKey, IEnumerable <Wlst.Sr.Menu.Models.MenuInstancesRelation> lst) { if (DicInstanceRelation.ContainsKey(instanceId)) { DicInstanceRelation[instanceId].Clear(); } else { DicInstanceRelation.Add(instanceId, new Dictionary <Tuple <int, int>, Wlst.Sr.Menu.Models.MenuInstancesRelation>()); } foreach (var t in lst) { this.AddMenuInstanceRelation(t.FatherId, t.Id, t.SortIndex, t.Name, t.InstancesId); } var args = new PublishEventArgs() { EventType = PublishEventType.Core, EventId = EventIdAssign.MenuInstanceRelationUpdate }; args.AddParams(instanceId); args.AddParams(instanceKey); EventPublish.PublishEvent(args); WriteUpdateDbByPrivate(instanceId); }
public override void OnNodeSelectActive() { //base.OnNodeSelectActive(); var args = new PublishEventArgs { EventType = PublishEventType.Core, EventId = Sr.EquipmentInfoHolding.Services.EventIdAssign.EquipmentSelected, }; args.AddParams(FatherId); args.AddParams(NodeId); EventPublisher.EventPublish(args); }
private void ExDeleteFolderFolder() { int nodid = this.NodeId; if (NodeId != 0 && _father != null)//todo youhua { if (NodeType == TreeNodeType.IsGrp) { //int fatherId = _father.NodeId; //getGrpsInfoForUse.DeleteGrpInfo(NodeId, fatherId); if (_father != null) { _father._ChildTreeItems.Remove(this); var args = new PublishEventArgs() { EventType = PublishEventTypeLocal.Name, EventId = PublishEventTypeLocal.GrpSingleReloadTmlGroup }; args.AddParams(nodid); args.AddParams(0); EventPublish.PublishEvent(args); } } else if (NodeType == TreeNodeType.IsTml) { //if (getGrpsInfoForUse.GrpInfoDictionary.ContainsKey(this.Father.NodeId)) //{ // if (getGrpsInfoForUse.GrpInfoDictionary[this.Father.NodeId].LstTml.Contains(this.NodeId)) // { // getGrpsInfoForUse.GrpInfoDictionary[this.Father.NodeId].LstTml.Remove(this.NodeId); // } //} this._father.ChildTreeItems.Remove(this); var args = new PublishEventArgs() { EventType = PublishEventTypeLocal.Name, EventId = PublishEventTypeLocal.GrpSingleReloadTmlGroup }; args.AddParams(nodid); args.AddParams(1); EventPublish.PublishEvent(args); } } // if (_father != null) _father.AddChild(); }
private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e) { var args = new PublishEventArgs() { EventType = "TabControlChanged", EventId = 3333 }; args.AddParams(openorclose.IsSelected, this); args.AddParams(fault.IsSelected, this); args.AddParams(energy.IsSelected, this); args.AddParams(online.IsSelected, this); EventPublish.PublishEvent(args); }
/// <summary> /// 当选择的终端发送变化时,如果 /// </summary> public override void OnNodeSelectActive() { //ResetContextMenu(); var ar = new PublishEventArgs() { EventId = Sr.EquipmentInfoHolding.Services.EventIdAssign.EquipmentSelected, EventType = PublishEventType.Core }; ar.AddParams(this.Father.Father.NodeId); //终端地址 ar.AddParams(this.Father.NodeId); //集中器地址 ar.AddParams(this.NodeId); //线路ID EventPublisher.EventPublish(ar); }
/// <summary> /// 更新快捷键信息,立即回写数据库并发布事件 /// </summary> /// <param name="menuId">菜单部件唯一标示</param> /// <param name="shortcut"></param> public void UpdateShortCut(int menuId, string shortcut) { if (string.IsNullOrEmpty(shortcut)) { if (DicClassic.ContainsKey(menuId)) { DicClassic.Remove(menuId); } } else { if (!DicClassic.ContainsKey(menuId)) { DicClassic.Add(menuId, shortcut); } else { DicClassic[menuId] = shortcut; } } var args = new PublishEventArgs() { EventType = PublishEventType.Core, EventId = EventIdAssign.MenuShourtCutsUpdate, }; args.AddParams(menuId); EventPublish.PublishEvent(args); this.WriteUpdateDbByPrivate(menuId); }
/// <summary> /// 更新菜单基础部件 有则更新无则增加 /// </summary> /// <param name="menuItem">基础部件</param> public void UpdateMenuItem(IIMenuItem menuItem) { if (_dictionaryMenuItems.ContainsKey(menuItem.Id)) { _dictionaryMenuItems[menuItem.Id] = menuItem; var args = new PublishEventArgs() { EventType = PublishEventType.Core, EventId = EventIdAssign.MenuComponentUpdate, }; args.AddParams(menuItem.Id); EventPublish.PublishEvent(args); } else { _dictionaryMenuItems.Add(menuItem.Id, menuItem); var args = new PublishEventArgs() { EventType = PublishEventType.Core, EventId = EventIdAssign.MenuComponentAdd, }; args.AddParams(menuItem.Id); EventPublish.PublishEvent(args); } }
/// <summary> /// 当选择的终端发送变化时,如果 /// </summary> public override void OnNodeSelectActive() { if (NodeType != TypeOfTabTreeNode.IsGrp && NodeType != TypeOfTabTreeNode.IsAll) { return; } if (NodeType == TypeOfTabTreeNode.IsGrp) { var info = Wlst.Sr.EquipmentInfoHolding.Services.ServicesGrpSingleInfoHold.GetGroupInfomation(AreaId, NodeId); if (info == null) { return; } } //base.OnNodeSelect(); //发布事件 选中当前节点 var args = new PublishEventArgs { EventType = PublishEventType.Core, EventId = Sr.EquipmentInfoHolding.Services.EventIdAssign.GroupSelected, }; args.AddParams(new Wlst.Sr.EquipmentInfoHolding.Model.SelectedInfo(AreaId, NodeId, SelectedInfo.SelectType.SingleGrp)); EventPublish.PublishEvent(args); // base.OnNodeSelectActive(); TreeNodeItemSingleGroupViewModel.CurrentSelectGroupNode = this; // ResetContextMenu(); }
/// <summary> /// 更新基础部件 有则更新无则增加 /// </summary> /// <param name="item">基础部件</param> public void UpdateEventSchduleTaskItem(IIEventSchduleTask item) { if (_dicItems.ContainsKey(item.EventSchduleClassId)) { _dicItems[item.EventSchduleClassId] = item; var args = new PublishEventArgs() { EventType = PublishEventType.Core, EventId = Services.EventIdAssign.EventSchduleTaskComponentUpdate, }; args.AddParams(item.EventSchduleClassId); EventPublish.PublishEvent(args); } else { _dicItems.Add(item.EventSchduleClassId, item); var args = new PublishEventArgs() { EventType = PublishEventType.Core, EventId = Services.EventIdAssign.EventSchduleTaskComponentAdd, }; args.AddParams(item.EventSchduleClassId); EventPublish.PublishEvent(args); } }
/// <summary> /// 当选择的终端发送变化时,如果 /// </summary> public override void OnNodeSelectActive() { if (IsSelectedByCode == false) { //base.OnNodeSelect(); //发布事件 选中当前节点 var args = new PublishEventArgs { EventType = PublishEventType.Core, EventId = Sr.EquipmentInfoHolding.Services.EventIdAssign.EquipmentSelected, EventAttachInfo = NodeId != TreeSelectedOne ? "Tree" : "TreeSelf",//如果点击的是联动查询框中的节点则发送Treeaa,在事件接收处屏蔽相应操作。 }; args.AddParams(NodeId); EventPublish.PublishEvent(args); //lvf 2018年5月22日14:40:48 记录当前点击终端 Wlst.Sr.EquipmentInfoHolding.Services.Others.CurrentSelectRtuId = NodeId; } if (this.ChildTreeItems.Count > 0) { this.ChildTreeItems.Clear(); } if (UxTreeSetting.IsShowGrpInTreeModelShowTmlChildNode) { // this.ThisNodeAddLoopsNode(); this.ThisNodeAddPartsNode(); this.IsExpanded = true; } TreeNodeItemTmlViewModel.CurrentSelectedTreeNode = this; //ResetContextMenu(); }
/// <summary> /// 当选择的终端发送变化时,如果 /// </summary> public override void OnNodeSelectActive() { if (IsSelectedByCode == false) { //base.OnNodeSelect(); //发布事件 选中当前节点 var args = new PublishEventArgs { EventType = PublishEventType.Core, EventId = Sr.EquipmentInfoHolding.Services.EventIdAssign.EquipmentSelected, }; args.AddParams(NodeId); EventPublish.PublishEvent(args); } if (this.ChildTreeItems.Count > 0) { this.ChildTreeItems.Clear(); } if (UxTreeSetting.IsShowGrpInTreeModelShowTmlChildNode) { // this.ThisNodeAddLoopsNode(); this.ThisNodeAddPartsNode(); this.IsExpanded = true; } TreeNodeItemTmlViewModel.CurrentSelectedTreeNode = this; //ResetContextMenu(); }
//#endregion private void ExAsynTime(string session, Wlst.mobile.MsgWithMobile args) { if (args.WstRtuOrders == null || args.WstRtuOrders.Op != 21) { return; } var lst = args.WstRtuOrders.RtuIds; if (lst == null) { return; } var ar = new PublishEventArgs { EventId = Cr.CoreOne.CoreIdAssign.EventIdAssign.AsyncTimeEventId, EventType = PublishEventType.Core }; ar.AddParams(lst); EventPublish.PublishEvent(ar); foreach (var f in lst) { string tmlName = "Reserve"; var g = Wlst.Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.GetInfoById(f); if (g != null) { tmlName = g.RtuName; } Wlst.Cr.CoreMims.ShowMsgInfo.ShowNewMsg.AddNewShowMsg( f, tmlName, Wlst.Cr.CoreMims.ShowMsgInfo.OperatrType.ServerReply, "对时成功"); } }
private void ExDeleteFolderFolder() { if (NodeType == TreeNodeType.IsGrp) { if (RootChilds != null && RootChilds.Contains(this)) { RootChilds.Remove(this); } } else if (NodeType == TreeNodeType.IsTml) { if (NodeId != 0 && _father != null) { var father = this._father; string pathArg = "" + NodeId; while (father != null) { pathArg = father.NodeId + "-" + father.NodeName + "/" + pathArg; father = father._father; } var args = new PublishEventArgs() { EventType = PublishEventTypeLocal.Name, EventId = PublishEventTypeLocal.DeleteGrpPathByCommandBasicShowGroupManage }; args.AddParams(NodeId, pathArg); EventPublish.PublishEvent(args); } } // if (_father != null) _father.AddChild(); }
public static void CurrentSelectedGrpIdChanged(TreeNodeBaseNode info) { int xg = xyrdsfd(info); if (xg == 0) { return; } if (CurrentSelectedGrpId == xg) { return; } CurrentSelectedGrpId = xg; TreeTabRtuSet.TabRtuHolding.GetRtuLstByIdx(CurrentSelectedGrpId); var ins = new PublishEventArgs() { EventType = PublishEventType.Core, EventId = Wlst.Sr.EquipmentInfoHolding.Services.EventIdAssign.RtuGroupSelectdWantedMapUp }; ins.AddParams(TreeTabRtuSet.TabRtuHolding.GetRtuLstByIdx(CurrentSelectedGrpId)); lastsndeventtime = DateTime.Now.Ticks; EventPublisher.EventPublish(ins); }
private void ExDelete() { var args = new PublishEventArgs() { EventType = PublishEventTypeLocal.Name, EventId = PublishEventTypeLocal.DeleteGrpPathByCommandBasicShowGroupManage }; args.AddParams(Id, GrpId, GrpName, AreaId); EventPublish.PublishEvent(args); }
private void InitEvent(int i) { var args = new PublishEventArgs() { EventType = "Wlst.Ux.Nr6005Module.Wj3005TmlInfoSetViewModel.ViewModel.RtuLoopInfoVm", EventId = 20161012 }; args.AddParams(i, this); EventPublish.PublishEvent(args); }
public override void OnNodeSelectActive() { if (NodeType == NodeTypeEnmu.ConNode) { var args = new PublishEventArgs { EventType = PublishEventType.Core, EventId = Sr.EquipmentInfoHolding.Services.EventIdAssign.EquipmentSelected, }; args.AddParams(Sluid); args.AddParams(NodeId); EventPublish.PublishEvent(args); ResetContextMenu(); } if (NodeType == NodeTypeEnmu.ConGrp || NodeType == NodeTypeEnmu.ConGrpSpecial1 || NodeType == NodeTypeEnmu.ConGrpSpecial2) { ResetContextMenu(); } }
public override void OnNodeSelect() { var para = Wlst.Sr.SlusglInfoHold.Services.SluSglInfoHold.MySlef.GetCtrlField(NodeId); var tu = new Tuple <int, int>(para, NodeId); CmItems = MenuBuilding.BulidCm("20962", false, tu); base.OnNodeSelect(); var args = new PublishEventArgs { EventType = PublishEventType.Core, EventId = Sr.EquipmentInfoHolding.Services.EventIdAssign.EquipmentSelected, }; //var para = Wlst.Sr.SlusglInfoHold.Services.SluSglInfoHold.MySlef.GetCtrlField(NodeId); args.AddParams(para); args.AddParams(NodeId); EventPublish.PublishEvent(args); }
public override void OnNodeSelectActive() { var args = new PublishEventArgs { EventType = PublishEventType.Core, EventId = Sr.EquipmentInfoHolding.Services.EventIdAssign.EquipmentSelected, }; args.AddParams(NodeId); EventPublish.PublishEvent(args); ResetContextMenu(); }
/// <summary> /// 当选择的终端发送变化时,如果 /// </summary> public override void OnNodeSelectActive() { //base.OnNodeSelect(); //发布事件 选中当前节点 var args = new PublishEventArgs { EventType = PublishEventType.Core, EventId = EventIdAssign.EquipmentSelected, }; args.AddParams(NodeId); EventPublisher.EventPublish(args); }
/// <summary> /// 当节点被选中的时候调用,实现了刷新右键菜单; /// 是否需要发送事件需要在此实现;以及其他的需要处理的事件; /// 动态加载子节点 /// </summary> public void OnNodeSelect() { if (ViewId > 1000) { //发布事件 选中当前节点 var args = new PublishEventArgs { EventType = SettingViewModel.EventType, EventId = SettingViewModel.EventId, }; args.AddParams(ViewId); EventPublish.PublishEvent(args); } }
/// <summary> /// 删除部件 /// </summary> /// <param name="menuItem">需要删除的部件</param> public void DeleteMenuItem(IISetting menuItem) { if (_dictionaryMenuItems.ContainsKey(menuItem.Id)) { _dictionaryMenuItems.Remove(menuItem.Id); var args = new PublishEventArgs() { EventType = PublishEventType.Core, EventId = Services.EventIdAssign.SettingModuleComponentDelete, }; args.AddParams(menuItem.Id); EventPublish.PublishEvent(args); } }
/// <summary> /// 删除部件 /// </summary> /// <param name="id">需要删除的部件id</param> public void DeleteMenuItem(int id) { if (_dictionaryMenuItems.ContainsKey(id)) { _dictionaryMenuItems.Remove(id); var args = new PublishEventArgs() { EventType = PublishEventType.Core, EventId = EventIdAssign.MenuComponentDelete, }; args.AddParams(id); EventPublish.PublishEvent(args); } }
public override void OnDoubleClick() { base.OnDoubleClick(); //发布事件 选中当前节点 var args = new PublishEventArgs { EventType = PublishEventType.Core, EventId = Sr.EquipmentInfoHolding.Services.EventIdAssign.EquipmentSelected, }; args.AddParams(NodeId); EventPublish.PublishEvent(args); }
/// <summary> /// 删除部件 /// </summary> /// <param name="id">需要删除的部件id</param> public void DeleteEventSchduleTaskItem(int id) { if (_dicItems.ContainsKey(id)) { _dicItems.Remove(id); var args = new PublishEventArgs() { EventType = PublishEventType.Core, EventId = Services.EventIdAssign.EventSchduleTaskComponentDelete, }; args.AddParams(id); EventPublish.PublishEvent(args); } }
/// <summary> /// 删除实例关系,立即回写数据库并发布事件 /// </summary> /// <param name="instancesId"></param> public void DeleteMenuInstanceRelation(int instancesId) { if (DicInstanceRelation.ContainsKey(instancesId)) { DicInstanceRelation.Remove(instancesId); var args = new PublishEventArgs() { EventType = PublishEventType.Core, EventId = EventIdAssign.MenuInstanceRelationUpdate }; args.AddParams(instancesId); EventPublish.PublishEvent(args); } WriteDeleteDbByPrivate(instancesId); }
/// <summary> /// 当节点被选中的时候调用,实现了刷新右键菜单; /// 是否需要发送事件需要在此实现;以及其他的需要处理的事件; /// 动态加载子节点 /// </summary> public void OnEquipmentSelected() { IsCanRefreshMenu = true; this.RaisePropertyChanged(() => this.Cm); IsCanRefreshMenu = false; //发布事件 选中当前节点 var args = new PublishEventArgs { EventId = Sr.EquipmentInfoHolding.Services.EventIdAssign.EquipmentSelected, EventType = PublishEventType.Core, }; args.AddParams(EquipmentRtuId); EventPublisher.EventPublish(args); }
/// <summary> /// 删除快捷键信息,立即回写数据库并发布事件 /// </summary> /// <param name="menuId"></param> public void DeleteShortCut(int menuId) { if (DicClassic.ContainsKey(menuId)) { DicClassic.Remove(menuId); var args = new PublishEventArgs() { EventType = PublishEventType.Core, EventId = EventIdAssign.MenuShourtCutsUpdate, }; args.AddParams(menuId); EventPublish.PublishEvent(args); this.WriteDeleteDbByPrivate(menuId); } }
/// <summary> /// 当选择的终端发送变化时,如果 /// </summary> public override void OnNodeSelectActive() { ////base.OnNodeSelect(); ////发布事件 选中当前节点 //var args = new PublishEventArgs //{ // EventType = PublishEventType.Core, // EventId = Sr.EquipmentGroupInfoHolding.Services.EventIdAssign.MainSingleTreeNodeActive, //}; //args.AddParams(NodeId); //args.AddParams(2); //EventPublisher.EventPublish(args); if (this.ChildTreeItems.Count > 0) { this.ChildTreeItems.Clear(); } // this.ThisNodeAddLoopsNode(); this.ThisNodeAddPartsNode(); this.IsExpanded = true; TreeNodeConcentratorViewModel.CurrentSelectedTreeNode = this; //ResetContextMenu(); var ar = new PublishEventArgs() { EventId = Sr.EquipmentInfoHolding.Services.EventIdAssign.EquipmentSelected, EventType = PublishEventType.Core }; ar.AddParams(this.Father.NodeId); //终端地址 ar.AddParams(this.NodeId); //集中器地址 ar.AddParams(0); //线路ID,0表示全部线路 EventPublisher.EventPublish(ar); }
public void CurrentSelectItemDoubleClicked() { try { if (DateTime.Now.Ticks - dtLast.Ticks < 50000000) { count++; } else { count = 0; } if (count > 3) { _isfilter = true; } else { _isfilter = false; } dtLast = DateTime.Now; if (CurrentItem == null) { return; } if (CurrentItem.RtuId < 100) { return; } if (CurrentItem.RtuId < 1000000) { return; } //if (CurrentItem.RtuId > 1100000) return; //发布事件 选中当前节点 var args = new PublishEventArgs { EventType = PublishEventType.Core, EventId = Sr.EquipmentInfoHolding.Services.EventIdAssign.EquipmentSelected, }; args.AddParams(CurrentItem.RtuId); EventPublish.PublishEvent(args); } catch (Exception ex) {} }