Ejemplo n.º 1
0
 //增加属性
 public void addProperty(PropertyElement property)
 {
     for (int i = 0; i < getElementCount(); i++)
     {
         InstanceElement element = (InstanceElement)getElement(i);
         element.addProperty(property);
     }
 }
Ejemplo n.º 2
0
 //插入属性
 public void inseartProperty(PropertyElement property,int index)
 {
     for (int i = 0; i < getElementCount(); i++)
     {
         InstanceElement element = (InstanceElement)getElement(i);
         element.inseartProperty(property, index);
     }
 }
Ejemplo n.º 3
0
 //克隆
 public override ObjectElement clone()
 {
     PropertyElement newInstance = new PropertyElement((PropertiesManager)parent);
     baseCloneTo(newInstance);
     newInstance.ValueType = ValueType;
     newInstance.propertyTypeElementUsed = propertyTypeElementUsed;
     newInstance.defaultValue = defaultValue;
     return newInstance;
 }
Ejemplo n.º 4
0
 //判断相同
 public bool equalsPropertyElement(PropertyElement destPropertyElement)
 {
     if (destPropertyElement == null || destPropertyElement.ValueType != ValueType || !destPropertyElement.name.Equals(name))
     {
         return false;
     }
     return true;
 }
Ejemplo n.º 5
0
        public void readObjectInit(System.IO.Stream s)
        {
            short len = 0;
            len = IOUtil.readShort(s);

            for (int i = 0; i < len; i++)
            {
                PropertyElement element = new PropertyElement(this);
                addElement(element);
            }

        }
Ejemplo n.º 6
0
 //拷贝(不克隆关联属性)
 public PropertyElement getCopy(PropertiesManager parentT)
 {
     PropertyElement newInstance = new PropertyElement(parentT);
     newInstance.ValueType = ValueType;
     return newInstance;
 }
Ejemplo n.º 7
0
 public void configPropertyName(PropertyElement property)
 {
     if (property == null)
     {
         return;
     }
     PropertyValueElement element = (PropertyValueElement)propertyValueManager.getElement(property.getID());
     element.name = property.name + "";
     propertyValueManager.refreshUI_Element(property.getID());
 }
Ejemplo n.º 8
0
 //删除属性
 public void removeProperty(PropertyElement property)
 {
     propertyValueManager.removeElement(property.getID());
 }
Ejemplo n.º 9
0
 //插入属性
 public void inseartProperty(PropertyElement property,int index)
 {
     PropertyValueElement element = new PropertyValueElement(propertyValueManager);
     element.name = property.name + "";
     element.ValueType = property.ValueType;
     element.setValue(property.getDefaultValue());
     propertyValueManager.insertElement(element, index);
     propertyValueManager.refreshUI();
 }
Ejemplo n.º 10
0
 //配置属性
 public void configProperty(PropertyElement property)
 {
     if (property == null)
     {
         return;
     }
     PropertyValueElement element = (PropertyValueElement)propertyValueManager.getElement(property.getID());
     element.name = property.name + "";
     element.ValueType = property.ValueType;
     element.setValue(property.getDefaultValue());
     propertyValueManager.refreshUI_Element(property.getID());
 }
Ejemplo n.º 11
0
 //增加属性
 public void addProperty(PropertyElement property)
 {
     PropertyValueElement element = new PropertyValueElement(propertyValueManager);
     element.name = property.name + "";
     element.ValueType = property.ValueType;
     element.setValue(property.getDefaultValue());
     propertyValueManager.addElement(element);
     propertyValueManager.refreshUI();
 }
Ejemplo n.º 12
0
 //删除属性
 public bool  removeProperty(PropertyElement property)
 {
     String s=property.getUsedInf();
     if (s!=null)
     {
         SmallDialog_ShowParagraph.showString(s, "不能删除被使用的属性");
         return false;
     }
     for (int i = 0; i < getElementCount(); i++)
     {
         InstanceElement element = (InstanceElement)getElement(i);
         element.removeProperty(property);
     }
     return true;
 }
Ejemplo n.º 13
0
 //配置属性
 public void configPropertyName(PropertyElement property)
 {
     for (int i = 0; i < getElementCount(); i++)
     {
         InstanceElement element = (InstanceElement)getElement(i);
         element.configPropertyName(property);
     }
 }
 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;
 }