I\'ve seen this syntax a couple times now, and it\'s beginning to worry me,
For example:
iCalendar iCal = new iCalendar();
Event evt = iCal.Create
It's calling a generic method - so in your case, the method may be declared like this:
public T Create()
You can specify the type argument in the angle brackets, just as you would for creating an instance of a generic type:
List list = new List();
Does that help?
One difference between generic methods and generic types is that the compiler can try to infer the type argument. For instance, if your Create
method were instead:
public T Copy(T original)
you could just call
Copy(someEvent);
and the compiler would infer that you meant:
Copy(someEvent);