menu

WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class SFArrayList - API Reference

    Show / Hide Table of Contents

    Class SFArrayList

    Extends ArrayList with MoveRange, InsertRange and RemoveRange methods. The Item property will grow the array on demand or return NULL if an index is out of range.

    Inheritance
    System.Object
    System.Collections.ArrayList
    SFArrayList
    GridCellCollection
    Implements
    System.Collections.IList
    System.Collections.ICollection
    System.Collections.IEnumerable
    System.ICloneable
    Inherited Members
    System.Collections.ArrayList.Adapter(System.Collections.IList)
    System.Collections.ArrayList.Add(System.Object)
    System.Collections.ArrayList.AddRange(System.Collections.ICollection)
    System.Collections.ArrayList.BinarySearch(System.Int32, System.Int32, System.Object, System.Collections.IComparer)
    System.Collections.ArrayList.BinarySearch(System.Object)
    System.Collections.ArrayList.BinarySearch(System.Object, System.Collections.IComparer)
    System.Collections.ArrayList.Clear()
    System.Collections.ArrayList.Contains(System.Object)
    System.Collections.ArrayList.CopyTo(System.Array)
    System.Collections.ArrayList.CopyTo(System.Array, System.Int32)
    System.Collections.ArrayList.CopyTo(System.Int32, System.Array, System.Int32, System.Int32)
    System.Collections.ArrayList.FixedSize(System.Collections.IList)
    System.Collections.ArrayList.FixedSize(System.Collections.ArrayList)
    System.Collections.ArrayList.GetEnumerator()
    System.Collections.ArrayList.GetEnumerator(System.Int32, System.Int32)
    System.Collections.ArrayList.IndexOf(System.Object)
    System.Collections.ArrayList.IndexOf(System.Object, System.Int32)
    System.Collections.ArrayList.IndexOf(System.Object, System.Int32, System.Int32)
    System.Collections.ArrayList.Insert(System.Int32, System.Object)
    System.Collections.ArrayList.InsertRange(System.Int32, System.Collections.ICollection)
    System.Collections.ArrayList.LastIndexOf(System.Object)
    System.Collections.ArrayList.LastIndexOf(System.Object, System.Int32)
    System.Collections.ArrayList.LastIndexOf(System.Object, System.Int32, System.Int32)
    System.Collections.ArrayList.ReadOnly(System.Collections.IList)
    System.Collections.ArrayList.ReadOnly(System.Collections.ArrayList)
    System.Collections.ArrayList.Remove(System.Object)
    System.Collections.ArrayList.RemoveAt(System.Int32)
    System.Collections.ArrayList.Repeat(System.Object, System.Int32)
    System.Collections.ArrayList.Reverse()
    System.Collections.ArrayList.Reverse(System.Int32, System.Int32)
    System.Collections.ArrayList.SetRange(System.Int32, System.Collections.ICollection)
    System.Collections.ArrayList.GetRange(System.Int32, System.Int32)
    System.Collections.ArrayList.Sort()
    System.Collections.ArrayList.Sort(System.Collections.IComparer)
    System.Collections.ArrayList.Sort(System.Int32, System.Int32, System.Collections.IComparer)
    System.Collections.ArrayList.Synchronized(System.Collections.IList)
    System.Collections.ArrayList.Synchronized(System.Collections.ArrayList)
    System.Collections.ArrayList.ToArray()
    System.Collections.ArrayList.ToArray(System.Type)
    System.Collections.ArrayList.TrimToSize()
    System.Collections.ArrayList.Capacity
    System.Collections.ArrayList.Count
    System.Collections.ArrayList.IsFixedSize
    System.Collections.ArrayList.IsReadOnly
    System.Collections.ArrayList.IsSynchronized
    System.Collections.ArrayList.SyncRoot
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Syncfusion.Collections
    Assembly: Syncfusion.Shared.Base.dll
    Syntax
    public class SFArrayList : ArrayList, IList, ICollection, IEnumerable, ICloneable

    Constructors

    SFArrayList()

    Overloaded. Initializes a new instance of the SFArrayList class that is empty and has the default initial capacity.

    Declaration
    public SFArrayList()

    SFArrayList(ICollection)

    Initializes a new instance of the SFArrayList class that contains elements copied from the specified collection and has the same initial capacity as the number of elements copied.

    Declaration
    public SFArrayList(ICollection c)
    Parameters
    Type Name Description
    System.Collections.ICollection c

    The System.Collections.ICollection whose elements are copied to the new list.

    Properties

    Item[Int32]

    Gets / sets the element at the specified index. In C#, this property is the indexer for the SFArrayList class.

    Declaration
    public override object this[int index] { get; set; }
    Parameters
    Type Name Description
    System.Int32 index

    The zero-based index of the element to get / set.

    Property Value
    Type Description
    System.Object

    The element at the specified index. When querying the value and the index is out of range, an empty (null) object will be returned. When setting the value and the index is out of range the array will be enlarged. See EnsureCount(Int32)

    Overrides
    System.Collections.ArrayList.Item[System.Int32]

    Methods

    Clone()

    Overridden. Creates a deep copy of the SFArrayList.

    Declaration
    public override object Clone()
    Returns
    Type Description
    System.Object

    A deep copy of the SFArrayList.

    Overrides
    System.Collections.ArrayList.Clone()

    EnsureCount(Int32)

    Enlarges the array if needed.

    Declaration
    public void EnsureCount(int value)
    Parameters
    Type Name Description
    System.Int32 value

    The size to be checked. If the array has less elements, empty (null) objects will be appended at the end of the array.

    InsertRange(Int32, Int32)

    Inserts a specified number of (null) values in the SFArrayList at a given index.

    Declaration
    public void InsertRange(int index, int count)
    Parameters
    Type Name Description
    System.Int32 index

    The zero-based index of the first value to be inserted.

    System.Int32 count

    The number of values in the range to be added.

    Examples
    SFArrayList array = new SFArrayList();
    array[0] = 0;
    array[1] = 1;
    array[2] = 2;
    array[3] = 3;
    array.InsertRange(1, 2);
    // results in new order: 0, null, null, 2, 3

    MoveRange(Int32, Int32, Int32)

    Rearranges the values in the SFArrayList.

    Declaration
    public void MoveRange(int index, int count, int dest)
    Parameters
    Type Name Description
    System.Int32 index

    The zero-based index of the first value to be moved.

    System.Int32 count

    The number of values in the range to be moved.

    System.Int32 dest

    The new starting index for the range. The zero-based index is based on the original array.

    Examples
    SFArrayList array = new SFArrayList();
    array[0] = 0;
    array[1] = 1;
    array[2] = 2;
    array[3] = 3;
    array.MoveRange(0, 2, 3);
    // results in new order: 2, 0, 1, 3

    RemoveRange(Int32, Int32)

    Removes a range of values from the SFArrayList.

    Declaration
    public override void RemoveRange(int index, int count)
    Parameters
    Type Name Description
    System.Int32 index

    The zero-based index of the first value to be removed.

    System.Int32 count

    The number of values in the range to be removed.

    Overrides
    System.Collections.ArrayList.RemoveRange(System.Int32, System.Int32)
    Examples
    SFArrayList array = new SFArrayList();
    array[0] = 0;
    array[1] = 1;
    array[2] = 2;
    array[3] = 3;
    array.RemoveRange(1, 2);
    // results in new order: 0, 3

    Implements

    System.Collections.IList
    System.Collections.ICollection
    System.Collections.IEnumerable
    System.ICloneable

    Extension Methods

    EnumerableExtensions.GetElementType(IEnumerable)
    EnumerableExtensions.GetItemPropertyInfo(IEnumerable)
    FunctionalExtensions.ForEach<T>(IEnumerable, Action<T>)
    FunctionalExtensions.ToList<T>(IEnumerable)
    FunctionalExtensions.MoveTo(IList, Int32, Int32)
    QueryableExtensions.OfQueryable(IEnumerable)
    QueryableExtensions.OfQueryable(IEnumerable, Type)
    QueryableExtensions.GroupByMany<TElement>(IEnumerable, Type, List<Func<TElement, Object>>)
    QueryableExtensions.GroupByMany(IEnumerable, Type, Func<String, Expression>, String[])
    QueryableExtensions.GroupByMany(IEnumerable, Type, List<SortDescriptor>, Dictionary<String, IComparer<Object>>, Func<String, Expression>, String[])
    QueryableExtensions.GroupByMany(IEnumerable, Type, List<SortDescriptor>, Func<String, Expression>, String[])
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved