you can find how to do it here.
In short it is:
public object this[int i]
{
get { return InnerList[i]; }
set { InnerList[i] = value; }
}
If you only need a getter the syntax in answer below can be used as well (starting from C# 6).
More Related Contents:
- explicit conversion operator error when converting generic lists
- How to call custom operator with Reflection
- How do I determine if multiple items are selected in a ListBox
- What are the basic rules and idioms for operator overloading?
- Convert List to List
- Select N random elements from a List in C#
- What’s the best way of implementing a thread-safe Dictionary?
- How do I check for nulls in an ‘==’ operator overload without infinite recursion?
- Collection was modified; enumeration operation may not execute in ArrayList [duplicate]
- Is there a built-in method to compare collections?
- How to check if IEnumerable is null or empty?
- How to easily initialize a list of Tuples?
- Thread-safe List property
- The opposite of Intersect()
- Multi Value Dictionary?
- Does C# have a way of giving me an immutable Dictionary?
- Enum to Dictionary in C#
- AddRange to a Collection
- What is ‘1 in Collection type Name
- LINQ .Any VS .Exists – What’s the difference?
- What does |= (single pipe equal) and &=(single ampersand equal) mean
- Initial capacity of collection types, e.g. Dictionary, List
- Enum to Dictionary in C#
- How can I calculate divide and modulo for integers in C#?
- System.InvalidOperationException: Collection was modified
- Returning ‘IList’ vs ‘ICollection’ vs ‘Collection’
- C#: Difference between List and Collection (CA1002, Do not expose generic lists) [duplicate]
- How add or remove object while iterating Collection in C#
- What are the | and ^ operators used for? [duplicate]
- How should I use properties when dealing with read-only List members