Exemplo n.º 1
0
        public AreaTreeItemModel(AreaTreeItemModel mvvmFather, object targetInfomation, bool IsPartition)
        {
            _isPartition = IsPartition;
            if (!IsPartition)
            {
                var terminalInfomation = targetInfomation as EquipmentParameter;
                if (terminalInfomation == null)
                {
                    this.NodeName = "加载出错";
                }
                else
                {
                    this.NodeName = terminalInfomation.RtuName;
                    this.NodeType = TreeNodeType.IsTml;
                    this.NodeId   = terminalInfomation.RtuId;
                    if (this.NodeId < 1499999 && this.NodeId >= 1399999)
                    {
                        this.ImagesSource = ImageResources.LuxIcon;
                    }
                    else if (this.NodeId >= 1499999 && this.NodeId < 1599999)
                    {
                        this.ImagesSource = ImageResources.SluIcon;
                    }
                    else
                    {
                        this.ImagesSource = ImageResources.RtuIcon;
                    }
                }
            }
            else
            {
                var groupInfomatioin = targetInfomation as AreaInfo.AreaItem;
                if (groupInfomatioin == null)
                {
                    this.NodeName = "加载出错";
                }
                else
                {
                    this.NodeName = groupInfomatioin.AreaName;
                    ImagesSource  = ImageResources.GroupIcon;
                    this.NodeType = TreeNodeType.IsPartition;
                    this.NodeId   = groupInfomatioin.AreaId;
                }
            }

            LabNameVisi = Visibility.Visible;
            TxbNameVisi = Visibility.Hidden;
            BackUpName  = "";

            this._father  = mvvmFather;
            _areaTreeItem = new ObservableCollection <AreaTreeItemModel>();

            EventPublish.AddEventTokener(
                Assembly.GetExecutingAssembly().GetName().ToString(), FundEventHandler, FundOrderFilter);
        }
Exemplo n.º 2
0
        private List <Tuple <int, int> > GetIndexBelong(AreaTreeItemModel father, ref int index)
        {
            var lst = new List <Tuple <int, int> >();

            lst.Add(new Tuple <int, int>(father.NodeId, index));
            index++;
            foreach (var t in father.AreaTreeItem)
            {
                var ff = GetIndexBelong(t, ref index);
                lst.AddRange(ff);
            }
            return(lst);
        }
Exemplo n.º 3
0
 /// <summary>
 /// 提供递归查询终端树中的终端节点直属父节点组名称
 /// </summary>
 /// <param name="father"></param>
 private void ReLoadTmlsAreasBelong(AreaTreeItemModel father)
 {
     if (father.NodeType != TreeNodeType.IsPartition)
     {
         return;
     }
     foreach (var t in father.AreaTreeItem)
     {
         if (t.NodeType == TreeNodeType.IsPartition)
         {
             ReLoadTmlsAreasBelong(t);
         }
         else if (t.NodeType == TreeNodeType.IsTml)
         {
             if (dictionaryC.ContainsKey(t.NodeId))
             {
                 TmlData[dictionaryC[t.NodeId]].AreaName = father.NodeName;
                 TmlData[dictionaryC[t.NodeId]].AreaId   = father.NodeId;
             }
         }
     }
 }
Exemplo n.º 4
0
 public HelpDragAndDrop(AreaTreeItemModel tv)
 {
     areaTreeData = tv;
     listData     = new List <int>();
 }
Exemplo n.º 5
0
        public void AddArea(AreaInfo.AreaItem gi)
        {
            var t = new AreaTreeItemModel(null, gi, true);

            AreaTreeItem.Add(t);
        }