Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# implement ienumerable t

using System.Collections;

class MyObjects : IEnumerable<MyObject>
{
    List<MyObject> mylist = new List<MyObject>();

    public MyObject this[int index]  
    {  
        get { return mylist[index]; }  
        set { mylist.Insert(index, value); }  
    } 

    public IEnumerator<MyObject> GetEnumerator()
    {
        return mylist.GetEnumerator();
    }

    IEnumerator IEnumerable.GetEnumerator()
    {
        return this.GetEnumerator();
    }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: Kill System Process in C# 
Csharp :: map user to ConnectionId SignalR 
Csharp :: what is unity 
Csharp :: string tochar array c# 
Csharp :: all Substring of String 
Csharp :: select random from enum c# 
Csharp :: change sprite color unity 
Csharp :: Data at the root level is invalid. Line 1, position 1. 
Csharp :: unity detect a touch on ui element 
Csharp :: c# create list of objects 
Csharp :: autofac .net core 6 
Csharp :: how to set the value of a textbox textmode=date asp.net c# 
Csharp :: print a file from C# 
Csharp :: c# Dictionary contains key case insensitive 
Csharp :: how to generate a random number in c# 
Csharp :: c# arrow 
Csharp :: how to turn on/off Particle System unity 
Csharp :: unity scroll rect to bottom 
Csharp :: c# linq list select 
Csharp :: singleton pattern c# 
Csharp :: how to redirect to another page in button clicked in asp.net c# index.cshtml 
Csharp :: searching for keys in the registry 
Csharp :: div element position in screen 
Csharp :: how to return a value in c# 
Csharp :: c# validate xml 
Csharp :: loading player preferences unity 
Csharp :: dataGridView default error dialog handle 
Csharp :: monogame print 
Csharp :: Rotating an object in Unity usign Physics 
Csharp :: interop C# save as and replace 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =