menu

ASP.NET MVC

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class Collection

    Show / Hide Table of Contents

    Class Collection

    implements a collection class.

    Inheritance
    System.Object
    Collection
    Implements
    System.Collections.IList
    System.Collections.ICollection
    System.Collections.IEnumerable
    Inherited Members
    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.JavaScript.DataVisualization.Models.Collections
    Assembly: Syncfusion.EJ.dll
    Syntax
    public class Collection : IList, ICollection, IEnumerable

    Constructors

    Collection()

    Initializes a new instance of the Collection class.

    Declaration
    public Collection()

    Properties

    Count

    Gets or sets the count of the collection

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    System.Int32

    ArrayList

    Examples
               Collection Collection = new Collection();
               Collection.Members.Add(new Node() { Name = "node1", OffsetX = 100 });
               Collection.Members.Add(new Node() { Name = "node2", OffsetX = 100 });
               Model.Nodes = Collection;
               int count = Collection.Count;

    IsFixedSize

    Gets a value indicating whether the System.Collections.IList has a fixed size.

    Declaration
    public bool IsFixedSize { get; }
    Property Value
    Type Description
    System.Boolean

    true if the System.Collections.IList has a fixed size; otherwise, false.

    IsReadOnly

    Gets a value indicating whether the System.Collections.IList is read-only.

    Declaration
    public bool IsReadOnly { get; }
    Property Value
    Type Description
    System.Boolean

    true if the System.Collections.IList is read-only; otherwise, false.

    IsSynchronized

    Gets a value indicating whether this instance .

    Declaration
    public bool IsSynchronized { get; }
    Property Value
    Type Description
    System.Boolean

    true if this instance ; otherwise, false.

    Item[Int32]

    Gets or sets the element at the specified index.

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

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

    Property Value
    Type Description
    System.Object

    The element at the specified index.

    Exceptions
    Type Condition
    System.NotSupportedException

    The property is set and the System.Collections.IList is read-only.

    System.ArgumentOutOfRangeException

    index is not a valid index in the System.Collections.IList.

    Members

    Gets or sets the members of the collection.

    Declaration
    public ArrayList Members { get; set; }
    Property Value
    Type Description
    System.Collections.ArrayList

    ArrayList

    Examples
               Collection Collection = new Collection();
               Collection.Members.Add(new Node() { Name = "node1", OffsetX = 100 });
               Collection.Members.Add(new Node() { Name = "node2", OffsetX = 100 });
               Model.Nodes = Collection;

    SyncRoot

    Gets a value indicating whether this SyncRoot .

    Declaration
    public object SyncRoot { get; }
    Property Value
    Type Description
    System.Object

    object

    Methods

    Add(Object)

    Gets or sets the members of the collection.

    Declaration
    public void Add(object value)
    Parameters
    Type Name Description
    System.Object value
    Examples
               Collection Collection = new Collection();
               Collection.Members.Add(new Node() { Name = "node1", OffsetX = 100 });
               Collection.Members.Add(new Node() { Name = "node2", OffsetX = 100 });
               Model.Nodes = Collection;

    AddValue(Object)

    Declaration
    protected int AddValue(object value)
    Parameters
    Type Name Description
    System.Object value
    Returns
    Type Description
    System.Int32

    Clear()

    Remove all the members from the collection

    Declaration
    public void Clear()
    Examples
               Collection Collection = new Collection();
               Node Node = new Node() { Name = "node1", OffsetX = 100 };
               Collection.Add(Node);
               Node = new Node() { Name = "node2", OffsetX = 100 };
               Collection.Add(Node);
               Collection.Clear();

    Contains(Object)

    return wether the collection contains specified vaule or not

    Declaration
    public bool Contains(object value)
    Parameters
    Type Name Description
    System.Object value
    Returns
    Type Description
    System.Boolean

    bool

    Examples
               Collection Collection = new Collection();
               Collection.Members.Add(new Node() { Name = "node1", OffsetX = 100 });
               Collection.Members.Add(new Node() { Name = "node2", OffsetX = 100 });
               bool contains = Collection.Contains(new Node() { });

    CopyTo(Array, Int32)

    Declaration
    public void CopyTo(Array array, int index)
    Parameters
    Type Name Description
    System.Array array
    System.Int32 index

    GetEnumerator()

    Declaration
    public IEnumerator GetEnumerator()
    Returns
    Type Description
    System.Collections.IEnumerator

    IndexOf(Object)

    return the series position of the specified object on the collection

    Declaration
    public int IndexOf(object value)
    Parameters
    Type Name Description
    System.Object value
    Returns
    Type Description
    System.Int32

    bool

    Examples
               Collection Collection = new Collection();
               Collection.Members.Add(new Node() { Name = "node1", OffsetX = 100 });
               Collection.Members.Add(new Node() { Name = "node2", OffsetX = 100 });
               bool index = Collection.IndexOf(new Node() { });

    Insert(Int32, Object)

    Inserts an item to the System.Collections.IList at the specified index.

    Declaration
    public void Insert(int index, object value)
    Parameters
    Type Name Description
    System.Int32 index

    The zero-based index at which value should be inserted.

    System.Object value

    The object to insert into the System.Collections.IList.

    Exceptions
    Type Condition
    System.NullReferenceException

    value is null reference in the System.Collections.IList.

    System.NotSupportedException

    The System.Collections.IList is read-only.-or- The System.Collections.IList has a fixed size.

    System.ArgumentOutOfRangeException

    index is not a valid index in the System.Collections.IList.

    InsertValue(Int32, Object)

    Declaration
    protected void InsertValue(int index, object value)
    Parameters
    Type Name Description
    System.Int32 index
    System.Object value

    Remove(Object)

    remove the specified object from the collection

    Declaration
    public void Remove(object value)
    Parameters
    Type Name Description
    System.Object value
    Examples
               Collection Collection = new Collection();
               Node Node = new Node() { Name = "node1", OffsetX = 100 };
               Collection.Add(Node);
               Node = new Node() { Name = "node2", OffsetX = 100 };
               Collection.Add(Node);
               Collection.Remove(Node);

    RemoveAt(Int32)

    remove the specified object from the collection at specified index

    Declaration
    public void RemoveAt(int index)
    Parameters
    Type Name Description
    System.Int32 index
    Examples
               Collection Collection = new Collection();
               Node Node = new Node() { Name = "node1", OffsetX = 100 };
               Collection.Add(Node);
               Node = new Node() { Name = "node2", OffsetX = 100 };
               Collection.Add(Node);
               Collection.RemoveAt(1);

    RemoveRange(ICollection)

    Declaration
    public void RemoveRange(ICollection values)
    Parameters
    Type Name Description
    System.Collections.ICollection values

    Set(Int32, Object)

    Declaration
    protected void Set(int index, object value)
    Parameters
    Type Name Description
    System.Int32 index
    System.Object value

    Explicit Interface Implementations

    IList.Add(Object)

    Adds an item to the System.Collections.IList.

    Declaration
    int IList.Add(object value)
    Parameters
    Type Name Description
    System.Object value

    The object to add to the System.Collections.IList.

    Returns
    Type Description
    System.Int32

    The position into which the new element was inserted, or -1 to indicate that the item was not inserted into the collection,

    Exceptions
    Type Condition
    System.NotSupportedException

    The System.Collections.IList is read-only.-or- The System.Collections.IList has a fixed size.

    Implements

    System.Collections.IList
    System.Collections.ICollection
    System.Collections.IEnumerable
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved