Example #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);
     }
 }
Example #2
0
        public int Add(string name, int v)
        {
            RTFAttribute item = new RTFAttribute();

            item.Name  = name;
            item.Value = v;
            return(this.List.Add(item));
        }
Example #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);
         }
     }
 }
Example #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);
        }
Example #5
0
 public bool Contains(RTFAttribute item)
 {
     return(this.List.Contains(item));
 }
Example #6
0
 public void Remove(RTFAttribute item)
 {
     this.List.Remove(item);
 }
Example #7
0
 public int Add(RTFAttribute item)
 {
     return(this.List.Add(item));
 }