コード例 #1
0
        /// <summary>
        /// Inserts an object to the <see cref="IBusinessObjectCollection"/> at the specified index.
        /// </summary>
        /// <param name="index">The zero-based index at which value should be inserted.</param>
        /// <param name="value">The object to insert into the collection.</param>
        public void Insert(int index, object value)
        {
            if (value != null && !typeof(T).IsAssignableFrom(value.GetType()))
            {
                throw new HabaneroArgumentException("Given instance doesn't match needed type.");
            }

            ViewOfBusinessObjectCollection.Insert(index, (T)value);
            BusinessObjectCollection.Insert(index, (T)value);
            FireListChanged(ListChangedType.ItemAdded, index);
        }
コード例 #2
0
        /// <summary>
        /// Inserts an object to the <see cref="IBusinessObjectCollection"/> at the specified index.
        /// </summary>
        /// <param name="index">The zero-based index at which value should be inserted.</param>
        /// <param name="value">The object to insert into the collection.</param>
        public void Insert(int index, object value)
        {
            if (value != null && !typeof(T).IsAssignableFrom(value.GetType()))
            {
                throw new HabaneroArgumentException("Given instance doesn't match needed type.");
            }

            _logger.Log("Insert Index : " + index + " value : " + value, LogCategory.Info);
            ViewOfBusinessObjectCollection.Insert(index, (T)value);
            BusinessObjectCollection.Insert(index, (T)value);
            OnListChanged(new ListChangedEventArgs(ListChangedType.ItemAdded, index));
        }