public void ResetCm() { ObservableCollection <IIMenuItem> t = null; if (Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems.ContainsKey(NodeId)) { var tt = Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems[NodeId]; t = MenuBuilding.BulidCm(tt.RtuModel.ToString(), false, tt); } CmItems = t; }
/// <summary> /// 菜单 /// </summary> public ContextMenu GetCm(int rtuId) { if (Cm == null) { Cm = new ContextMenu(); Cm.BorderThickness = new Thickness(0); } Cm.Items.Clear(); string rtuName = "" + rtuId; if ( Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems.//).EquipmentInfoDictionary. ContainsKey(rtuId)) { var s = Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems[ //.EquipmentInfoDictionary[ rtuId]; rtuName = s.RtuName; var t = MenuBuilding.BulidCm(((int)s.RtuModel).ToString(), false, s);//(s.RtuModel.ToString(CultureInfo.InvariantCulture), false, s); HelpCmm(t); } else if (rtuId < 1600000000 && rtuId > 1500000000) { int sluId = Convert.ToInt32(rtuId / 1000); int CtrlId = rtuId % 1000; if ( Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems.//).EquipmentInfoDictionary. ContainsKey(sluId)) { var s = Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems [//.EquipmentInfoDictionary[ sluId]; rtuName = s.RtuName + "--" + CtrlId; var t = MenuBuilding.BulidCm("20900", false, new Tuple <int, int>(sluId, CtrlId)); HelpCmm(t); } } var mi = new MenuItem(); mi.Header = rtuName; mi.IsEnabled = false; if (Cm.Items.Count > 0) { Cm.Items.Insert(0, mi); } else { Cm.Items.Add(mi); } return(Cm); }
public void ResetCm() { ObservableCollection <IIMenuItem> t = null; if (Sr.EquipmentInfoHolding.Services.ServicesGrpMulitInfoHold.ItemsMultGrp.ContainsKey(NodeId)) { t = MenuBuilding.BulidCm("RightMenuMulit", false, Sr.EquipmentInfoHolding.Services.ServicesGrpMulitInfoHold.ItemsMultGrp[NodeId]); } this.CmItems = t; }
public void ResetCm() { ObservableCollection <IIMenuItem> t = null; var attachEquipment = Wlst.Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold .GetInfoById(this.NodeId); if (attachEquipment != null) { t = MenuBuilding.BulidCm(((int )attachEquipment.RtuModel).ToString(), false, attachEquipment); } CmItems = t; }
public ObservableCollection <IIMenuItem> ResetCm() { if (Father == null) { return(new ObservableCollection <IIMenuItem>()); } ObservableCollection <IIMenuItem> t = null; var xxx = new int[2] { Father.NodeId, NodeId }; t = MenuBuilding.BulidCm(RightMenuKey, false, xxx); return(t); }
public void ResetCm() { ObservableCollection <IIMenuItem> t = null; if (NodeType != TypeOfTabTreeNode.IsGrp) { return; } var info = Wlst.Sr.EquipmentInfoHolding.Services.ServicesGrpMultiInfoHoldNew.GetGroupInfomation(AreaId, NodeId); if (info == null) { return; } this.CmItems = MenuBuilding.BulidCm("RightMenuMulit", false, info); }
public void ResetCm() { ObservableCollection <IIMenuItem> t = null; if ( Wlst.Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold. InfoItems.ContainsKey(NodeId)) { var s = Wlst.Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold. InfoItems[NodeId]; t = MenuBuilding.BulidCm(((int)s.RtuModel).ToString(), false, s); } this.CmItems = t; }
public ObservableCollection <IIMenuItem> ResetCm() { ObservableCollection <IIMenuItem> t = null; if ( Wlst.Sr.EquipmentInfoHolding.Services.ServicesEquipemntInfoHold. EquipmentInfoDictionary.ContainsKey(NodeId)) { var s = Wlst.Sr.EquipmentInfoHolding.Services.ServicesEquipemntInfoHold. EquipmentInfoDictionary[NodeId]; t = MenuBuilding.BulidCm(s.RtuModel.ToString(), false, s); } return(t); }
public void UpdateCm(int rtuId) { var TerInfo = Wlst.Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.GetInfoById(NodeId); if (TerInfo == null) { return; } //添加集中器右击菜单 西安需求 2019年5月23日13:54:21 读取 292.xml_1003 GetOptionIsThisValue CmItems = MenuBuilding.BulidCm(((int)TerInfo.RtuModel).ToString(), false, TerInfo);; //不是默认值,则要加载集中器菜单 if (Wlst.Cr.CoreMims.SystemOption.GetOptionIsDefaults(1003, 0) == true) { return; } var sluid = EquipmentDataInfoHold.GetSluIdByRtuId(TerInfo.RtuPhyId); if (sluid > 0) { var TerInfoSlu = Wlst.Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.GetInfoById(sluid); if (TerInfoSlu != null) { var SluItems = MenuBuilding.BulidCm(((int)TerInfoSlu.RtuModel).ToString(), false, TerInfoSlu); var menuItemFile = new MenuItemBase() { IsCheckable = false, IsEnabled = true, Id = 195959, Visibility = Visibility.Visible }; menuItemFile.Text = TerInfoSlu.RtuName; menuItemFile.TextTmp = TerInfoSlu.RtuName; foreach (var f in SluItems) { menuItemFile.CmItems.Add(f); } CmItems.Add(menuItemFile); } } }
//private ObservableCollection<CtrlNodeItem> _childTreeItemsInfo = null; //public ObservableCollection<CtrlNodeItem> ChildItems //{ // get // { // if (_childTreeItemsInfo == null) // _childTreeItemsInfo = new ObservableCollection<CtrlNodeItem>(); // return _childTreeItemsInfo; // } // //set // //{ // // if (value == _childTreeItemsInfo) return; // // _childTreeItemsInfo = value; // // this.RaisePropertyChanged(() => this.ChildItems); // //} //} public override void OnNodeSelect() { CmItems = MenuBuilding.BulidCm("20961", false, FileId); 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(NodeId); //EventPublish.PublishEvent(args); }
public ObservableCollection <IIMenuItem> ResetCm() { //return base.ResetCm(); if (AttachEquipmentInstance == null) { return(null); } var att = AttachEquipmentInstance as Wlst.Sr.EquipmentInfoHolding.Model.WjParaBase; if (att == null) { return(null); } ObservableCollection <IIMenuItem> t = null; t = MenuBuilding.BulidCm(((int )att.RtuModel).ToString(CultureInfo.InvariantCulture), false, AttachEquipmentInstance); return(t); }
public void ResetCm() { ObservableCollection <IIMenuItem> t = null; //if (Sr.EquipmentGroupInfoHolding.Services.ServicesGrpSingleInfoHold.GrpInfoDictionary.ContainsKey(NodeId)) // t = MenuBuilding.BulidCm(Sr.EquipmentGroupInfoHolding.Services.ServicesGrpSingleInfoHold.GrpInfoDictionary[NodeId].MenuRightTargetKey, // false, // Sr.EquipmentGroupInfoHolding.Services.ServicesGrpSingleInfoHold.GrpInfoDictionary[NodeId]); var tu = new Tuple <int, int>(0, NodeId); if (ServicesGrpSingleInfoHold.InfoGroups.ContainsKey(tu)) { t = MenuBuilding.BulidCm("RightMenuSingle", false, ServicesGrpSingleInfoHold.InfoGroups[tu]); } CmItems = t; }
public override void OnNodeSelect() { // var tu = new Tuple<int, int,int>(NodeId, 0,0); CmItems = MenuBuilding.BulidCm("20960", false, NodeId); 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); }
private void LoadChildren() { //ChildTreeItems.Clear(); //var t = // ServerInstanceRoot.GetInstanceByKey( // MainMenuDefine.MainMenuKey); //if (t == null) return; //string name = t.Name; //ChildTreeItems.Add(new ShortCutTreeItemViewModel(null, t.Id , 0) // { // Name = name // }); //foreach (var f in this.ChildTreeItems) f.LoadChildren(); ChildTreeItems.Clear(); var fff = MenuBuilding.BulidCm(MainMenuDefine.MainMenuKey, true, null); foreach (var g in fff) { if (g.Visibility != Visibility.Visible) { continue; } var tmp = new ShortCutTreeItemViewModel(null, g.Id, 0) { Name = g.Text }; tmp.LoadChildren(g.CmItems, g.Id); if (tmp.ChildTreeItems.Count > 0) { ChildTreeItems.Add(tmp); } } // public ObservableCollection<IIMenuItem> IimenuItems=new ObservableCollection<IIMenuItem>( ); //private void ResetM() //{ // Items.Clear(); // IimenuItems.Clear(); // var fff = MenuBuilding.BulidCm(MainMenuDefine.MainMenuKey, true, null); // //this.HelpCmm(fff); // this.Helpcmmm(fff); // this.RaisePropertyChanged(() => this.Items); //} //protected void Helpcmmm(ObservableCollection<IIMenuItem> t) //{ // var fs = MenuBuilding.HelpCmm(t,true ); // Items.Clear(); // foreach (var g in fs) // { // Items.Add(g); // } //} }
public void ResetCm() { this.CmItems = MenuBuilding.BulidCm(RtuModel.ToString(), false, AttInfo); }
/// <summary> /// 菜单 /// </summary> public ContextMenu GetCm(int rtuId, int ctrlid = 0) { if (Cm == null) { Cm = new ContextMenu(); Cm.BorderThickness = new Thickness(0); } Cm.Items.Clear(); string rtuName = "" + rtuId; if (ctrlid < 1) { if ( Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems. //).EquipmentInfoDictionary. ContainsKey(rtuId)) { var s = Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems[ //.EquipmentInfoDictionary[ rtuId]; rtuName = s.RtuName; var t = MenuBuilding.BulidCm(((int)s.RtuModel).ToString(), false, s); //(s.RtuModel.ToString(CultureInfo.InvariantCulture), false, s); HelpCmm(t); } //else if ( // Sr.SlusglInfoHold.Services.SluSglInfoHold.MySlef.GetField(rtuId) != null) //{ // var s = // Sr.SlusglInfoHold.Services.SluSglInfoHold.MySlef.GetField(rtuId); // rtuName = s.FieldName; // var t = MenuBuilding.BulidCm("20960", false, s.FieldId); // HelpCmm(t); //} else if (rtuId < 1600000000 && rtuId > 1500000000) { int sluId = Convert.ToInt32(rtuId / 1000); int CtrlId = rtuId % 1000; if ( Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems. //).EquipmentInfoDictionary. ContainsKey(sluId)) { var s = Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems[ //.EquipmentInfoDictionary[ sluId]; rtuName = s.RtuName + "--" + CtrlId; var t = MenuBuilding.BulidCm("20900", false, new Tuple <int, int>(sluId, CtrlId)); HelpCmm(t); } } } else //nb单灯 { var sluinfo = Wlst.Sr.SlusglInfoHold.Services.SluSglInfoHold.MySlef.Get(rtuId, ctrlid); if (sluinfo != null) { rtuName = ctrlid + "--" + sluinfo.CtrlName; var t = MenuBuilding.BulidCm("20962", false, new Tuple <int, int>(rtuId, ctrlid)); HelpCmm(t); } } var mi = new MenuItem(); mi.Header = rtuName; mi.IsEnabled = false; if (Cm.Items.Count > 0) { Cm.Items.Insert(0, mi); } else { Cm.Items.Add(mi); } return(Cm); }