CollectionBase

Namespace: Aspose.Cells
We found 10 examples in language CSharp for this search. You will see 57 fragments of code.

        //| <include path='docs/doc[@for="CollectionBase.Clear"]/*' />
        public void Clear() {
            OnClear();
            InnerList.Clear();
            OnClearComplete();
        }

        //| <include path='docs/doc[@for="CollectionBase.RemoveAt"]/*' />
        public void RemoveAt(int index) {
            if (index < 0 || index >= InnerList.Count)
                throw new ArgumentOutOfRangeException("ArgumentOutOfRange_Index");
            Object temp = InnerList[index];
            OnValidate(temp);
            OnRemove(index, temp);
            InnerList.RemoveAt(index);
            OnRemoveComplete(index, temp);
        }

        //| <include path='docs/doc[@for="CollectionBase.ICollection.CopyTo"]/*' />
        void ICollection.CopyTo(Array array, int index) {
            InnerList.CopyTo(array, index);
        }

        //| <include path='docs/doc[@for="CollectionBase.IList.Contains"]/*' />
        bool IList.Contains(Object value) {
            return InnerList.Contains(value);
        }

        //| <include path='docs/doc[@for="CollectionBase.IList.Add"]/*' />
        int IList.Add(Object value) {
            OnValidate(value);
            OnInsert(InnerList.Count, value);
            int index = InnerList.Add(value);
            try {
                OnInsertComplete(index, value);
            }
            catch (Exception) {
                InnerList.RemoveAt(index);
                throw;
            }
            return index;
        }


        //| <include path='docs/doc[@for="CollectionBase.IList.Remove"]/*' />
        void IList.Remove(Object value) {
            OnValidate(value);
            int index = InnerList.IndexOf(value);
            if (index < 0) throw new ArgumentException("Arg_RemoveArgNotFound");
            OnRemove(index, value);
            InnerList.RemoveAt(index);
            OnRemoveComplete(index, value);
        }

        [PexGenericArguments(typeof(int))]
        [PexMethod]
        public void Add<T>([PexAssumeNotNull]CollectionBase<T> target, T item)
        {
            target.Add(item);
        }

        [PexGenericArguments(typeof(int))]
        [PexMethod]
        public void Clear<T>([PexAssumeNotNull]CollectionBase<T> target)
        {
            target.Clear();
        }

        [PexGenericArguments(typeof(int))]
        [PexMethod]
        public bool Contains<T>([PexAssumeNotNull]CollectionBase<T> target, T item)
        {
            bool result = target.Contains(item);
            return result;
        }

        [PexGenericArguments(typeof(int))]
        [PexMethod]
        public void CopyTo<T>(
            [PexAssumeNotNull]CollectionBase<T> target,
            T[] array,
            int arrayIndex
        )
        {
            target.CopyTo(array, arrayIndex);
        }

        [PexGenericArguments(typeof(int))]
        [PexMethod]
        public void CopyTo01<T>(
            [PexAssumeNotNull]CollectionBase<T> target,
            Array array,
            int index
        )
        {
            target.CopyTo(array, index);
        }

        [PexGenericArguments(typeof(int))]
        [PexMethod]
        public IEnumerator<T> GetEnumerator<T>([PexAssumeNotNull]CollectionBase<T> target)
        {
            IEnumerator<T> result = target.GetEnumerator();
            return result;
        }


        //| <include path='docs/doc[@for="CollectionBase.Clear"]/*' />
        public void Clear() {
            OnClear();
            InnerList.Clear();
            OnClearComplete();
        }

        //| <include path='docs/doc[@for="CollectionBase.RemoveAt"]/*' />
        public void RemoveAt(int index) {
            if (index < 0 || index >= InnerList.Count)
                throw new ArgumentOutOfRangeException("ArgumentOutOfRange_Index");
            Object temp = InnerList[index];
            OnValidate(temp);
            OnRemove(index, temp);
            InnerList.RemoveAt(index);
            OnRemoveComplete(index, temp);
        }

        //| <include path='docs/doc[@for="CollectionBase.ICollection.CopyTo"]/*' />
        void ICollection.CopyTo(Object[] array, int index) {
            InnerList.CopyTo(array, index);
        }

        //| <include path='docs/doc[@for="CollectionBase.IList.Contains"]/*' />
        bool IList.Contains(Object value) {
            return InnerList.Contains(value);
        }

        //| <include path='docs/doc[@for="CollectionBase.IList.Add"]/*' />
        int IList.Add(Object value) {
            OnValidate(value);
            OnInsert(InnerList.Count, value);
            int index = InnerList.Add(value);
            try {
                OnInsertComplete(index, value);
            }
            catch (Exception) {
                InnerList.RemoveAt(index);
                throw;
            }
            return index;
        }


        //| <include path='docs/doc[@for="CollectionBase.IList.Remove"]/*' />
        void IList.Remove(Object value) {
            OnValidate(value);
            int index = InnerList.IndexOf(value);
            if (index < 0) throw new ArgumentException("Arg_RemoveArgNotFound");
            OnRemove(index, value);
            InnerList.RemoveAt(index);
            OnRemoveComplete(index, value);
        }


        //| <include path='docs/doc[@for="CollectionBase.Clear"]/*' />
        public void Clear() {
            OnClear();
            InnerList.Clear();
            OnClearComplete();
        }

        //| <include path='docs/doc[@for="CollectionBase.RemoveAt"]/*' />
        public void RemoveAt(int index) {
            if (index < 0 || index >= InnerList.Count)
                throw new ArgumentOutOfRangeException("ArgumentOutOfRange_Index");
            Object temp = InnerList[index];
            OnValidate(temp);
            OnRemove(index, temp);
            InnerList.RemoveAt(index);
            OnRemoveComplete(index, temp);
        }

        //| <include path='docs/doc[@for="CollectionBase.ICollection.CopyTo"]/*' />
        void ICollection.CopyTo(Array array, int index) {
            InnerList.CopyTo(array, index);
        }

        //| <include path='docs/doc[@for="CollectionBase.IList.Contains"]/*' />
        bool IList.Contains(Object value) {
            return InnerList.Contains(value);
        }

        //| <include path='docs/doc[@for="CollectionBase.IList.Add"]/*' />
        int IList.Add(Object value) {
            OnValidate(value);
            OnInsert(InnerList.Count, value);
            int index = InnerList.Add(value);
            try {
                OnInsertComplete(index, value);
            }
            catch (Exception) {
                InnerList.RemoveAt(index);
                throw;
            }
            return index;
        }


        //| <include path='docs/doc[@for="CollectionBase.IList.Remove"]/*' />
        void IList.Remove(Object value) {
            OnValidate(value);
            int index = InnerList.IndexOf(value);
            if (index < 0) throw new ArgumentException("Arg_RemoveArgNotFound");
            OnRemove(index, value);
            InnerList.RemoveAt(index);
            OnRemoveComplete(index, value);
        }

        /// <summary>
        /// Removes all objects from the CollectionBase instance.
        /// </summary>
        public virtual void Clear()
        {
            if (!this.OnClear()) { return; }
            this._innerList.Clear();
            this.OnClearComplete();
        }
        /// <summary>
        /// Performs additional custom processes before inserting a new element into the CollectionBase instance.
        /// </summary>
        /// <param name="index">The zero-based index at which to insert value.</param>
        /// <param name="value">The new value of the element at index.</param>
        /// <returns></returns>
        protected virtual bool OnInsert(int index, T value)
        {
            return true;
        }
        /// <summary>
        /// Performs additional custom processes after inserting a new element into the CollectionBase instance.
        /// </summary>
        /// <param name="index">The zero-based index at which to insert value.</param>
        /// <param name="value">The new value of the element at index.</param>
        protected virtual void OnInsertComplete(int index, T value)
        {
        }
        /// <summary>
        /// Performs additional custom processes when removing an element from the CollectionBase instance.
        /// </summary>
        /// <param name="index">The zero-based index at which value can be found.</param>
        /// <param name="value">The value of the element to remove from index.</param>
        /// <returns></returns>
        protected virtual bool OnRemove(int index, T value)
        {

            return true;
        }
        /// <summary>
        /// Performs additional custom processes after removing an element from the CollectionBase instance.
        /// </summary>
        /// <param name="index">The zero-based index at which value can be found.</param>
        /// <param name="value">The value of the element to remove from index.</param>
        protected virtual void OnRemoveComplete(int index, T value)
        {
        }
        /// <summary>
        /// Performs additional custom processes before setting a value in the CollectionBase instance.
        /// </summary>
        /// <param name="index">The zero-based index at which oldValue can be found.</param>
        /// <param name="oldValue">The value to replace with newValue.</param>
        /// <param name="value">The new value of the element at index.</param>
        /// <returns></returns>
        protected virtual bool OnSet(int index, T oldValue, T value)
        {
            return true;
        }

        /// <summary>
        /// Removes all objects from the CollectionBase instance.
        /// </summary>
        public virtual void Clear()
        {
            if (!this.OnClear()) { return; }
            this._innerList.Clear();
            this.OnClearComplete();
        }
        /// <summary>
        /// Performs additional custom processes before inserting a new element into the CollectionBase instance.
        /// </summary>
        /// <param name="index">The zero-based index at which to insert value.</param>
        /// <param name="value">The new value of the element at index.</param>
        /// <returns></returns>
        protected virtual bool OnInsert(int index, T value)
        {
            return true;
        }
        /// <summary>
        /// Performs additional custom processes after inserting a new element into the CollectionBase instance.
        /// </summary>
        /// <param name="index">The zero-based index at which to insert value.</param>
        /// <param name="value">The new value of the element at index.</param>
        protected virtual void OnInsertComplete(int index, T value)
        {
        }
        /// <summary>
        /// Performs additional custom processes when removing an element from the CollectionBase instance.
        /// </summary>
        /// <param name="index">The zero-based index at which value can be found.</param>
        /// <param name="value">The value of the element to remove from index.</param>
        /// <returns></returns>
        protected virtual bool OnRemove(int index, T value)
        {

            return true;
        }
        /// <summary>
        /// Performs additional custom processes after removing an element from the CollectionBase instance.
        /// </summary>
        /// <param name="index">The zero-based index at which value can be found.</param>
        /// <param name="value">The value of the element to remove from index.</param>
        protected virtual void OnRemoveComplete(int index, T value)
        {
        }
        /// <summary>
        /// Performs additional custom processes before setting a value in the CollectionBase instance.
        /// </summary>
        /// <param name="index">The zero-based index at which oldValue can be found.</param>
        /// <param name="oldValue">The value to replace with newValue.</param>
        /// <param name="value">The new value of the element at index.</param>
        /// <returns></returns>
        protected virtual bool OnSet(int index, T oldValue, T value)
        {
            return true;
        }


		/// <summary>Copies the entire <see cref="T:System.Collections.CollectionBase" /> to a compatible one-dimensional <see cref="T:System.Array" />, starting at the specified index of the target array.</summary>
		/// <param name="array">The one-dimensional <see cref="T:System.Array" /> that is the destination of the elements copied from <see cref="T:System.Collections.CollectionBase" />. The <see cref="T:System.Array" /> must have zero-based indexing.</param>
		/// <param name="index">The zero-based index in <paramref name="array" /> at which copying begins.</param>
		/// <exception cref="T:System.ArgumentNullException">
		///   <paramref name="array" /> is null.</exception>
		/// <exception cref="T:System.ArgumentOutOfRangeException">
		///   <paramref name="index" /> is less than zero.</exception>
		/// <exception cref="T:System.ArgumentException">
		///   <paramref name="array" /> is multidimensional.-or-The number of elements in the source <see cref="T:System.Collections.CollectionBase" /> is greater than the available space from <paramref name="index" /> to the end of the destination <paramref name="array" />.</exception>
		/// <exception cref="T:System.InvalidCastException">The type of the source <see cref="T:System.Collections.CollectionBase" /> cannot be cast automatically to the type of the destination <paramref name="array" />.</exception>
		void ICollection.CopyTo(Array array, int index)
		{
			this.InnerList.CopyTo(array, index);
		}

		/// <summary>Adds an object to the end of the <see cref="T:System.Collections.CollectionBase" />.</summary>
		/// <returns>The <see cref="T:System.Collections.CollectionBase" /> index at which the <paramref name="value" /> has been added.</returns>
		/// <param name="value">The <see cref="T:System.Object" /> to be added to the end of the <see cref="T:System.Collections.CollectionBase" />.</param>
		/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.CollectionBase" /> is read-only.-or-The <see cref="T:System.Collections.CollectionBase" /> has a fixed size.</exception>
		int IList.Add(object value)
		{
			this.OnValidate(value);
			int count = this.InnerList.Count;
			this.OnInsert(count, value);
			this.InnerList.Add(value);
			try
			{
				this.OnInsertComplete(count, value);
			}
			catch
			{
				this.InnerList.RemoveAt(count);
				throw;
			}
			return count;
		}

		/// <summary>Determines whether the <see cref="T:System.Collections.CollectionBase" /> contains a specific element.</summary>
		/// <returns>true if the <see cref="T:System.Collections.CollectionBase" /> contains the specified <paramref name="value" />; otherwise, false.</returns>
		/// <param name="value">The <see cref="T:System.Object" /> to locate in the <see cref="T:System.Collections.CollectionBase" />.</param>
		bool IList.Contains(object value)
		{
			return this.InnerList.Contains(value);
		}

		/// <summary>Searches for the specified <see cref="T:System.Object" /> and returns the zero-based index of the first occurrence within the entire <see cref="T:System.Collections.CollectionBase" />.</summary>
		/// <returns>The zero-based index of the first occurrence of <paramref name="value" /> within the entire <see cref="T:System.Collections.CollectionBase" />, if found; otherwise, -1.</returns>
		/// <param name="value">The <see cref="T:System.Object" /> to locate in the <see cref="T:System.Collections.CollectionBase" />.</param>
		int IList.IndexOf(object value)
		{
			return this.InnerList.IndexOf(value);
		}

		/// <summary>Inserts an element into the <see cref="T:System.Collections.CollectionBase" /> at the specified index.</summary>
		/// <param name="index">The zero-based index at which <paramref name="value" /> should be inserted.</param>
		/// <param name="value">The <see cref="T:System.Object" /> to insert.</param>
		/// <exception cref="T:System.ArgumentOutOfRangeException">
		///   <paramref name="index" /> is less than zero.-or-<paramref name="index" /> is greater than <see cref="P:System.Collections.CollectionBase.Count" />.</exception>
		/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.CollectionBase" /> is read-only.-or-The <see cref="T:System.Collections.CollectionBase" /> has a fixed size.</exception>
		void IList.Insert(int index, object value)
		{
			this.OnValidate(value);
			this.OnInsert(index, value);
			this.InnerList.Insert(index, value);
			try
			{
				this.OnInsertComplete(index, value);
			}
			catch
			{
				this.InnerList.RemoveAt(index);
				throw;
			}
		}

		/// <summary>Removes the first occurrence of a specific object from the <see cref="T:System.Collections.CollectionBase" />.</summary>
		/// <param name="value">The <see cref="T:System.Object" /> to remove from the <see cref="T:System.Collections.CollectionBase" />.</param>
		/// <exception cref="T:System.ArgumentException">The <paramref name="value" /> parameter was not found in the <see cref="T:System.Collections.CollectionBase" /> object.</exception>
		/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.CollectionBase" /> is read-only.-or-The <see cref="T:System.Collections.CollectionBase" /> has a fixed size.</exception>
		void IList.Remove(object value)
		{
			this.OnValidate(value);
			int num = this.InnerList.IndexOf(value);
			if (num == -1)
			{
				throw new ArgumentException("The element cannot be found.", "value");
			}
			this.OnRemove(num, value);
			this.InnerList.Remove(value);
			this.OnRemoveComplete(num, value);
		}

		public void AddColumn(string ColumnName)
		{
			this.oColumns.Insert(this.oColumns.Count, ColumnName);
		}
		public void SetGridSection(string Row, string Column, Section Section)
		{
			this.oSectionTable[Row + "-" + Column] = Section;
		}
		public void AddRow()
		{
			this.oRows.Insert(this.oRows.Count, this.oRows.Count + 1);
		}

        /// <summary>
        /// Removes all objects from the CollectionBase instance.
        /// </summary>
        public virtual void Clear()
        {
            if (!this.OnClear()) { return; }
            this._innerList.Clear();
            this.OnClearComplete();
        }
        /// <summary>
        /// Performs additional custom processes before inserting a new element into the CollectionBase instance.
        /// </summary>
        /// <param name="index">The zero-based index at which to insert value.</param>
        /// <param name="value">The new value of the element at index.</param>
        /// <returns></returns>
        protected virtual bool OnInsert(int index, T value)
        {
            return true;
        }
        /// <summary>
        /// Performs additional custom processes after inserting a new element into the CollectionBase instance.
        /// </summary>
        /// <param name="index">The zero-based index at which to insert value.</param>
        /// <param name="value">The new value of the element at index.</param>
        protected virtual void OnInsertComplete(int index, T value)
        {
        }
        /// <summary>
        /// Performs additional custom processes when removing an element from the CollectionBase instance.
        /// </summary>
        /// <param name="index">The zero-based index at which value can be found.</param>
        /// <param name="value">The value of the element to remove from index.</param>
        /// <returns></returns>
        protected virtual bool OnRemove(int index, T value)
        {

            return true;
        }
        /// <summary>
        /// Performs additional custom processes after removing an element from the CollectionBase instance.
        /// </summary>
        /// <param name="index">The zero-based index at which value can be found.</param>
        /// <param name="value">The value of the element to remove from index.</param>
        protected virtual void OnRemoveComplete(int index, T value)
        {
        }
        /// <summary>
        /// Performs additional custom processes before setting a value in the CollectionBase instance.
        /// </summary>
        /// <param name="index">The zero-based index at which oldValue can be found.</param>
        /// <param name="oldValue">The value to replace with newValue.</param>
        /// <param name="value">The new value of the element at index.</param>
        /// <returns></returns>
        protected virtual bool OnSet(int index, T oldValue, T value)
        {
            return true;
        }

        /// <summary>
        /// Removes all objects from the CollectionBase instance.
        /// </summary>
        public virtual void Clear()
        {
            if (!this.OnClear()) { return; }
            this._innerList.Clear();
            this.OnClearComplete();
        }
        /// <summary>
        /// Performs additional custom processes before inserting a new element into the CollectionBase instance.
        /// </summary>
        /// <param name="index">The zero-based index at which to insert value.</param>
        /// <param name="value">The new value of the element at index.</param>
        /// <returns></returns>
        protected virtual bool OnInsert(int index, T value)
        {
            return true;
        }
        /// <summary>
        /// Performs additional custom processes after inserting a new element into the CollectionBase instance.
        /// </summary>
        /// <param name="index">The zero-based index at which to insert value.</param>
        /// <param name="value">The new value of the element at index.</param>
        protected virtual void OnInsertComplete(int index, T value)
        {
        }
        /// <summary>
        /// Performs additional custom processes when removing an element from the CollectionBase instance.
        /// </summary>
        /// <param name="index">The zero-based index at which value can be found.</param>
        /// <param name="value">The value of the element to remove from index.</param>
        /// <returns></returns>
        protected virtual bool OnRemove(int index, T value)
        {

            return true;
        }
        /// <summary>
        /// Performs additional custom processes after removing an element from the CollectionBase instance.
        /// </summary>
        /// <param name="index">The zero-based index at which value can be found.</param>
        /// <param name="value">The value of the element to remove from index.</param>
        protected virtual void OnRemoveComplete(int index, T value)
        {
        }
        /// <summary>
        /// Performs additional custom processes before setting a value in the CollectionBase instance.
        /// </summary>
        /// <param name="index">The zero-based index at which oldValue can be found.</param>
        /// <param name="oldValue">The value to replace with newValue.</param>
        /// <param name="value">The new value of the element at index.</param>
        /// <returns></returns>
        protected virtual bool OnSet(int index, T oldValue, T value)
        {
            return true;
        }

Aspose.Cells.CollectionBase<T> : IList

Methods :

public Int32 BinarySearch(T item = )
public Int32 BinarySearch(T item = , IComparer<T> comparer = )
public Int32 BinarySearch(Int32 index = , Int32 count = , T item = , IComparer<T> comparer = )
public Boolean Contains(T item = )
public Void CopyTo(T[] array = )
public Void CopyTo(T[] array = , Int32 arrayIndex = )
public Void CopyTo(Int32 index = , T[] array = , Int32 arrayIndex = , Int32 count = )
public Boolean Exists(Predicate<T> match = )
public T Find(Predicate<T> match = )
public List<T> FindAll(Predicate<T> match = )
public Int32 FindIndex(Predicate<T> match = )
public Int32 FindIndex(Int32 startIndex = , Predicate<T> match = )
public Int32 FindIndex(Int32 startIndex = , Int32 count = , Predicate<T> match = )
public T FindLast(Predicate<T> match = )
public Int32 FindLastIndex(Predicate<T> match = )
public Int32 FindLastIndex(Int32 startIndex = , Predicate<T> match = )
public Int32 FindLastIndex(Int32 startIndex = , Int32 count = , Predicate<T> match = )
public Int32 IndexOf(T item = )
public Int32 IndexOf(T item = , Int32 index = )
public Int32 IndexOf(T item = , Int32 index = , Int32 count = )
public Int32 LastIndexOf(T item = )
public Int32 LastIndexOf(T item = , Int32 index = )
public Int32 LastIndexOf(T item = , Int32 index = , Int32 count = )
public IEnumerator<T> GetEnumerator()
public Void Clear()
public Void RemoveAt(Int32 index = )
public Int32 get_Capacity()
public Void set_Capacity(Int32 value = )
public Int32 get_Count()
public T get_Item(Int32 index = )
public Void set_Item(Int32 index = , T value = )
public Type GetType()
public String ToString()
public Boolean Equals(Object obj = )
public Int32 GetHashCode()

Other methods