예제 #1
0
        public PropertyListItem clone()
        {
            PropertyListItem result = new PropertyListItem();

            result.assign(this);
            return(result);
        }
예제 #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);
 }
예제 #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);
        }
예제 #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);
        }
예제 #5
0
        /// <summary>增加一个新的属性,如果属性存在则更新,不存在则新建</summary>
        public void addProperty(PropertyListItem item)
        {
            PropertyListItem current = getItem(item.name);

            current.assign(item);
        }