Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public NamePair GetValidOption(String key)
        {
            int index = NamePair.IndexOfKey(_options, key);

            if (index >= 0)
            {
                return((NamePair)_options[index]);
            }
            return(null);
        }
Esempio 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");
     }
 }
Esempio 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");
     }
 }
Esempio n. 4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="options"></param>
 /// <param name="c"></param>
 ///  public static void ConcatNamePairArray(ArrayList options, ArrayList c)
 public static void ConcatNamePairArray(List <NamePair> options, List <NamePair> c)
 {
     if (c == null)
     {
         return;
     }
     if (options == null)
     {
         throw new ArgumentException("options cannot be null");
     }
     if (options != null)
     {
         for (int i = 0; i < c.Count; i++)
         {
             if (NamePair.IndexOfKey(options, ((NamePair)c[i]).GetID()) == -1)
             {
                 options.Add(c[i]);
             }
         }
     }
 }
Esempio n. 5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public NamePair GetOption(String key)
        {
            int index = NamePair.IndexOfKey(_options, key);

            if (index >= 0)
            {
                return((NamePair)_options[index]);
            }
            else
            {
                if (_exception_options == null)
                {
                    return(null);
                }
                index = NamePair.IndexOfKey(_exception_options, key);
                if (index >= 0)
                {
                    return((NamePair)_exception_options[index]);
                }
            }
            return(null);
        }
Esempio n. 6
0
 /// <summary>
 ///  Returns the index of the first option found for the key, or -1 if not found.
 /// </summary>
 /// <param name="key"></param>
 /// <returns></returns>
 public int IndexOfKey(String key)
 {
     return(NamePair.IndexOfKey(_options, key));
 }