Exemplo n.º 1
0
        /// <summary>
        /// IComparer Interface (based on Name/ID value)
        /// </summary>
        /// <param name="p1">Value 1</param>
        /// <param name="p2">Value 2</param>
        /// <returns>compareTo value</returns>
        public int Compare(NamePair p1, NamePair p2)
        {
            String s1 = p1 == null ? "" : (_sortByName ? p1.GetName() : p1.GetID());
            String s2 = p2 == null ? "" : (_sortByName ? p2.GetName() : p2.GetID());

            return(s1.CompareTo(s2)); //  sort order ??
        }                             //	compare
Exemplo n.º 2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="option"></param>
 public void AddOption(NamePair option)
 {
     if (option != null)
     {
         if (NamePair.IndexOfKey(_options, option.GetID()) == -1)
         {
             _options.Add(option);
         }
     }
     else
     {
         throw new ArgumentException("option should not be null");
     }
 }
Exemplo n.º 3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="option"></param>
 public void PushExceptionOption(NamePair option)
 {
     if (_exception_options == null)
     {
         _exception_options = new List <NamePair>();// ArrayList(10);
     }
     if (option != null)
     {
         if (NamePair.IndexOfKey(_exception_options, option.GetID()) == -1)
         {
             _exception_options.Add(option);
         }
     }
     else
     {
         throw new ArgumentException("option should not be null");
     }
 }