public InstancesManager instancesManager = null;  //实例管理
 public PropertyTypeElement(PropertyTypesManager parentT)
     : base(parentT)
 {
     propertiesManager = new PropertiesManager(this,((PropertyTypesManager)parent).form_main);
     instancesManager = new InstancesManager(this);
 }
        //合并
        public void combine(InstancesManager srcInstancesManager)
        {
            if (srcInstancesManager == null)
            {
                return;
            }
            for (int i = 0; i < srcInstancesManager.getElementCount(); i++)
            {
                InstanceElement srcInstanceElement = (InstanceElement)srcInstancesManager.getElement(i);
                bool findSame = false;
                //寻找相同
                for (int j = 0; j < getElementCount(); j++)
                {
                    InstanceElement tempInstanceElement = (InstanceElement)getElement(j);
                    if (tempInstanceElement.equalsInstanceElement(srcInstanceElement))
                    {
                        findSame = true;
                        break;
                    }
                }
                if (findSame)//保留原实例
                {
                    continue;
                }
                else//添加新的实例
                {
                    InstanceElement newInstanceElement = new InstanceElement(this);
                    newInstanceElement.propertyValueManager.refreshProperty();
                    newInstanceElement.setName(srcInstanceElement.name);
                    addElement(newInstanceElement);
                }
            }

        }
 public InstanceElement(InstancesManager parentT)
     : base(parentT)
 {
     propertyValueManager = new PropertyValueManager(this);
 }