Esempio n. 1
0
        public PropertyListItem clone()
        {
            PropertyListItem result = new PropertyListItem();

            result.assign(this);
            return(result);
        }
Esempio n. 2
0
 public void assign(PropertyListItem value)
 {
     this.name        = value.name;
     this.displayName = value.displayName;
     this.category    = value.category;
     this.value.assign(value.value);
     this.defaultValue.assign(value.defaultValue);
 }
Esempio n. 3
0
        /// <summary>不存在则自动增加</summary>
        public PropertyListItem getItem(string name)
        {
            int insertPos = 0;
            int index     = getItemIndex(name, ref insertPos);

            if (index >= 0)
            {
                return(items[index]);
            }
            PropertyListItem item = new PropertyListItem();

            item.name = name;
            items.Insert(insertPos, item);
            return(item);
        }
Esempio n. 4
0
        /// <summary>不存在则自动增加</summary>
        public PropertyListItem getItem(string name)
        {
            for (int i = 0; i < items.Count; i++)
            {
                if (items[i].name.Equals(name))
                {
                    return(items[i]);
                }
            }
            PropertyListItem item = new PropertyListItem();

            item.name = name;
            items.Add(item);
            return(item);
        }
Esempio n. 5
0
        /// <summary>增加一个新的属性,如果属性存在则更新,不存在则新建</summary>
        public void addProperty(PropertyListItem item)
        {
            PropertyListItem current = getItem(item.name);

            current.assign(item);
        }