Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        public bool Replace(CListBoxItem item)
        {
            bool retValue = false;

            try
            {
                if (_items.ContainsKey(item.ItemKey))
                {
                    _items[item.ItemKey] = item;
                    retValue             = true;
                }
            }
            catch (Exception ex)
            {
                throw new ControlException("CListBox.Replace()", ex);
            }

            return(retValue);
        }
Exemple #2
0
        /// <summary>
        /// Added a new item to the list (not overwriting).
        /// </summary>
        /// <param name="item">An item</param>
        /// <returns>True if added.</returns>
        public bool Add(CListBoxItem item)
        {
            bool retValue = false;

            try
            {
                if (!_items.ContainsKey(item.ItemKey))
                {
                    _items.Add(item.ItemKey, item);
                    retValue = true;
                }
            }
            catch (Exception ex)
            {
                throw new ControlException("CListBox.Add()", ex);
            }

            return(retValue);
        }