public PropertyElement(PropertiesManager parentT)
            : base(parentT)
        {

        }
 //拷贝(不克隆关联属性)
 public PropertyElement getCopy(PropertiesManager parentT)
 {
     PropertyElement newInstance = new PropertyElement(parentT);
     newInstance.ValueType = ValueType;
     return newInstance;
 }
 //合并
 public void combine(PropertiesManager srcPropertiesManager)
 {
     for (int i = 0; i < srcPropertiesManager.getElementCount(); i++)
     {
         PropertyElement srcPropertyElement = (PropertyElement)srcPropertiesManager.getElement(i);
         bool findSame=false;
         //寻找相同
         for (int j = 0; j < getElementCount(); j++)
         {
             PropertyElement tempPropertyElement = (PropertyElement)getElement(j);
             if (tempPropertyElement.equalsPropertyElement(srcPropertyElement))
             {
                 findSame=true;
                 break;
             }
         }
         if (findSame)//保留原属性
         {
             continue;
         }
         else
         {
             PropertyElement newPropertyElement = srcPropertyElement.getCopy(this);
             addElement(newPropertyElement);
             parent.instancesManager.addProperty(newPropertyElement);
         }
     }
 }
 public InstancesManager instancesManager = null;  //实例管理
 public PropertyTypeElement(PropertyTypesManager parentT)
     : base(parentT)
 {
     propertiesManager = new PropertiesManager(this,((PropertyTypesManager)parent).form_main);
     instancesManager = new InstancesManager(this);
 }
 public PropertyValueManager(InstanceElement parentT)
 {
     parentInstance = parentT;
     propertiesManager = ((InstancesManager)parentInstance.parent).parent.propertiesManager;
 }
 public static PropertyElement createElement(PropertiesManager managerT)
 {
     manager = managerT;
     element = new PropertyElement(manager);
     setDialog("新建属性单元");
     dialog.comboBox_Value.SelectedIndex = 0;
     dialog.setPropsList();
     dialog.ShowDialog();
     return element;
 }
 //设置单元
 public static bool configElement(PropertyElement elementT)
 {
     if (elementT == null)
     {
         Console.WriteLine("error in configElement");
         return false;
     }
     manager = (PropertiesManager)elementT.parent;
     element = elementT;
     setDialog("设置属性单元");
     dialog.textBox_name.Text = element.name;
     dialog.comboBox_Value.SelectedIndex = element.ValueType == Consts.PARAM_INT ? 0 : element.ValueType == Consts.PARAM_STR ? 1 : element.ValueType == Consts.PARAM_PROP ? 2 : 3;
     dialog.setPropsList();
     dialog.ShowDialog();
     return needRefreshUI;
 }