Ejemplo 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
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public String GetValue(String key)
        {
            NamePair option = GetOption(key);

            if (option == null)
            {
                return(null);
            }
            return(option.GetName());
        }
Ejemplo n.º 3
0
        /// <summary>
        ///Get Display for Value (not cached)
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public override String GetDisplay(Object value)
        {
            if (value == null || value == DBNull.Value)
            {
                return("");
            }
            NamePair pp = Get(value);

            if (pp == null)
            {
                return("<" + value.ToString() + ">");
            }
            return(pp.GetName());
        }