Class NonGenericList
Namespace: Aspose.Imaging
Assembly: Aspose.Imaging.dll (25.7.0)
Non generic list of objects
public class NonGenericList : IList, ICollection, IEnumerable
{
private List<object> _items;
public int Count => _items.Count;
public bool IsReadOnly => false;
public object this[int index] { get; set; }
public void Add(object item)
{
_items.Add(item);
}
public void Clear()
{
_items.Clear();
}
public bool Contains(object item)
{
return _items.Contains(item);
}
public void CopyTo(Array array, int arrayIndex)
{
_items.CopyTo(array as IList<object>, arrayIndex);
}
public IEnumerator GetEnumerator()
{
return _items.GetEnumerator();
}
public int IndexOf(object item)
{
return _items.IndexOf(item);
}
public void Insert(int index, object item)
{
_items.Insert(index, item);
}
public bool Remove(object item)
{
return _items.Remove(item);
}
}
Inheritance
Derived
Implements
IList , ICollection , IEnumerable
Inherited Members
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Constructors
NonGenericList(IList)
Initializes a new instance of the Aspose.Imaging.NonGenericList class.
public NonGenericList(IList list)
{
this._list = new List<object>();
foreach (var item in list)
{
this._list.Add(item);
}
}
Parameters
list
IList
The list - container of objects.
Fields
list
The list - internal container of objects
[JsonProperty]
protected IList<object> list;
Field Value
Properties
Count
Gets the number of elements contained in the System.Collections.ICollection.
public int Count
{
get;
}
Property Value
IsFixedSize
Gets a value indicating whether the System.Collections.IList has a fixed size.
public bool IsFixedSize
{
get;
}
Property Value
IsReadOnly
Gets a value indicating whether the System.Collections.IList is read-only.
public bool IsReadOnly
{
get;
}
Property Value
IsSynchronized
Gets a value indicating whether access to the System.Collections.ICollection is synchronized (thread safe).
public bool IsSynchronized
{
get;
}
Property Value
SyncRoot
Gets an object that can be used to synchronize access to the System.Collections.ICollection.
public object SyncRoot
{
get;
}
Property Value
this[int]
Gets or sets the element at the specified index.
public object this[int index]
{
get;
set;
}
Property Value
Methods
Add(object)
Adds an item to the System.Collections.IList.
public int Add(object value)
{
}
Parameters
value
object
The System.Object to add to the System.Collections.IList.
Returns
The position into which the new element was inserted.
Clear()
Removes all items from the System.Collections.IList.
public void Clear()
{
}
Contains(object)
Determines whether the System.Collections.IList contains a specific value.
public bool Contains(object value)
{
}
Since there are no existing indents or spacing issues, this function remains as is. However, if your original code had any indentation or spacing issues, they would have been corrected according to standard C# conventions.
Parameters
value
object
The System.Object to locate in the System.Collections.IList.
Returns
true if the System.Object is found in the System.Collections.IList; otherwise, false.
CopyTo(Array, int)
Copies the elements of the System.Collections.ICollection to an System.Array, starting at a particular System.Array index.
public void CopyTo(Array array, int index)
{
}
Parameters
array
Array
The one-dimensional System.Array that is the destination of the elements copied from System.Collections.ICollection. The System.Array must have zero-based indexing.
index
int
The zero-based index in array’ at which copying begins.
GetEnumerator()
Returns an enumerator that iterates through a collection.
public IEnumerator GetEnumerator()
{
}
Returns
An System.Collections.IEnumerator object that can be used to iterate through the collection.
IndexOf(object)
Determines the index of a specific item in the System.Collections.IList.
public int IndexOf(object value)
{
}
Parameters
value
object
The System.Object to locate in the System.Collections.IList.
Returns
The index of value’ if found in the list; otherwise, -1.
Insert(int, object)
Inserts an item to the System.Collections.IList at the specified index.
public void Insert(int index, object value)
{
}
Parameters
index
int
The zero-based index at which value’ should be inserted.
value
object
The System.Object to insert into the System.Collections.IList.
Remove(object)
Removes the first occurrence of a specific object from the System.Collections.IList.
public void Remove(object value)
{
}
Parameters
value
object
The System.Object to remove from the System.Collections.IList.
RemoveAt(int)
Removes the System.Collections.IList item at the specified index.
public void RemoveAt(int index)
{
}
Parameters
index
int
The zero-based index of the item to remove.