示例#1
0
 public string SearchByValue(int value)
 {
     for (int i = 0; i < this.list.Count; i++)
     {
         SelectBoxItem item = (SelectBoxItem)this.list[i];
         if (value == item.Value)
         {
             return(item.Name);
         }
     }
     return(string.Empty);
 }
示例#2
0
 public int SearchByName(string name)
 {
     for (int i = 0; i < this.list.Count; i++)
     {
         SelectBoxItem item = (SelectBoxItem)this.list[i];
         if (name.Equals(item.Name))
         {
             return(item.Value);
         }
     }
     return(-1);
 }