示例#1
0
 public int this[string name]
 {
     get
     {
         foreach (RTFAttribute a in this)
         {
             if (a.Name == name)
             {
                 return(a.Value);
             }
         }
         return(int.MinValue);
     }
     set
     {
         foreach (RTFAttribute a in this)
         {
             if (a.Name == name)
             {
                 a.Value = value;
                 return;
             }
         }
         RTFAttribute item = new RTFAttribute();
         item.Name  = name;
         item.Value = value;
         this.List.Add(item);
     }
 }
示例#2
0
        public int Add(string name, int v)
        {
            RTFAttribute item = new RTFAttribute();

            item.Name  = name;
            item.Value = v;
            return(this.List.Add(item));
        }
示例#3
0
 public void Remove(string name)
 {
     for (int iCount = this.Count - 1; iCount >= 0; iCount--)
     {
         RTFAttribute item = (RTFAttribute)this.List[iCount];
         if (item.Name == name)
         {
             this.List.RemoveAt(iCount);
         }
     }
 }
示例#4
0
        public RTFAttributeList Clone()
        {
            RTFAttributeList list = new RTFAttributeList();

            foreach (RTFAttribute item in this)
            {
                RTFAttribute newItem = new RTFAttribute();
                newItem.Name  = item.Name;
                newItem.Value = item.Value;
                list.List.Add(newItem);
            }
            return(list);
        }
示例#5
0
 public bool Contains(RTFAttribute item)
 {
     return(this.List.Contains(item));
 }
示例#6
0
 public void Remove(RTFAttribute item)
 {
     this.List.Remove(item);
 }
示例#7
0
 public int Add(RTFAttribute item)
 {
     return(this.List.Add(item));
 }