System.ComponentModel.ListSortDescriptionCollection.CopyTo C# (CSharp) Method

CopyTo() public method

public CopyTo ( Array array, int index ) : void
array Array
index int
return void
        public void CopyTo(Array array, int index) {
            this.sorts.CopyTo(array, index);
        }

Usage Example

		/// <summary>
		/// Sorts the view of the underlying list based on the given <see cref="T:System.ComponentModel.ListSortDescriptionCollection"></see>.
		/// </summary>
		/// <param name="sorts">The <see cref="T:System.ComponentModel.ListSortDescriptionCollection"></see> containing the sorts to apply to the view.</param>
		public void ApplySort(ListSortDescriptionCollection sorts)
		{
			Lock();

			try
			{
				ListSortDescriptionCollection proposed;

				if (sorts == null)
					proposed = new ListSortDescriptionCollection();
				else
				{
					foreach (ListSortDescription desc in sorts)
						ValidateProperty(desc.PropertyDescriptor);

					ListSortDescription[] props = new ListSortDescription[sorts.Count];
					sorts.CopyTo(props, 0);
					proposed = new ListSortDescriptionCollection(props);
				}

				this.SortProperties = proposed;
			}
			finally
			{
				Unlock();
			}

			RaiseEvents();
		}
All Usage Examples Of System.ComponentModel.ListSortDescriptionCollection::CopyTo