Beispiel #1
0
        private void InitResource(NodeData ResourceNameNode, long RentID)
        {
            //对resourceinfo类的list进行筛选查询,然后绑给child
            ResourceNameNode.Children.Clear();
            List <Relation> TempList = ListRelation.Where(s => s.UserID == RentID).ToList();

            for (int i = 0; i < TempList.Count; i++)
            {
                NodeData ValueNode = new NodeData();
                switch (ResourceNameNode.ObjID)
                {
                case S1111Consts.VCLogServer:
                    ResourceInfo tempRI = Listresources.FirstOrDefault(p => p.ResourceID == TempList[i].ResourceID);
                    if (tempRI != null)
                    {
                        string Name = tempRI.Tostring();

                        ValueNode.Parent      = ResourceNameNode;
                        ValueNode.Data        = tempRI;
                        ValueNode.Name        = tempRI.Tostring();
                        ValueNode.Description = string.Format(TempList[i].ToString(), CurrentApp.GetLanguageInfo("1111002", "有效时段"));
                        ValueNode.ObjID       = tempRI.ResourceID;
                        ValueNode.Type        = S1111Consts.ResourceObject;
                        ValueNode.Icon        = "Images/voiceserver.png";
                    }
                    break;
                }
                if (ValueNode.Name != null)
                {
                    Dispatcher.Invoke(new Action(() => ResourceNameNode.AddChild(ValueNode)));
                    mListRootItems.Add(ValueNode);
                }
            }
        }