Ejemplo n.º 1
0
        public void AddInstance(string _id, string _name, string _parent)
        {
            InstanceInfo instance     = new InstanceInfo(_id, _name, _parent);
            InstanceComp instanceComp = new InstanceComp(this.mdlView, instance);

            instanceArray.Add(_id, instanceComp);
        }
Ejemplo n.º 2
0
        int GetImageIndex(InstanceComp _instance)
        {
            string _name = _instance.GetName();

            if (_name.Contains(".PRT"))
            {
                return(1);
            }
            else if (_name.Contains(".ASM"))
            {
                return(0);
            }
            return(8);
        }
Ejemplo n.º 3
0
 protected void UpdateTreeNode(TreeNode _node, InstanceComp _inst)
 {
     foreach (KeyValuePair <string, InstanceComp> _instance in _inst.sonInstance)
     {
         TreeNode sonNode = _node.Nodes.Add(_instance.Value.GetName());
         sonNode.Tag                = _instance.Value;
         sonNode.ImageIndex         = GetImageIndex(_instance.Value);
         sonNode.SelectedImageIndex = sonNode.ImageIndex;
         if (_instance.Value.sonInstance.Count > 0)
         {
             UpdateTreeNode(sonNode, _instance.Value);
         }
     }
 }
Ejemplo n.º 4
0
 public void BuildMdlTree()
 {
     foreach (KeyValuePair <string, InstanceComp> instance in instanceArray)
     {
         if (instance.Value.IsRootMdl())
         {
             rootComp = instance.Value;
         }
         if (instanceArray.ContainsKey(instance.Value.GetParentID()))
         {
             InstanceComp parent = instanceArray[instance.Value.GetParentID()];
             parent.sonInstance.Add(instance.Key, instance.Value);
         }
     }
 }