S
Siegfried Heintze
Can someone help me understand the perils and merits of anonymous classes in
C# 3.0?
Would anonymous classes be most useful when used with reflection? I cannot
figure out how else I would pass them to a function.
How useful is a type if we never pass its instances to a function?
If we do pass an instance of an anonymouse type to a function, can we do
anything with it without using reflection?
The answer to that question might be yes if we can specify an ancestor.
Unfortunately, Andrew Troelsen's book did not show how to create anonymouse
descendant classes.
If I have a class Child, can I create an anonymouse descendant class that
represents a parent that has multiple offspring stored in a linked list and
pass this to a function expecting an instance of class child? Can someone
give me some sample code to do this?
Thanks,
Siegfried
C# 3.0?
Would anonymous classes be most useful when used with reflection? I cannot
figure out how else I would pass them to a function.
How useful is a type if we never pass its instances to a function?
If we do pass an instance of an anonymouse type to a function, can we do
anything with it without using reflection?
The answer to that question might be yes if we can specify an ancestor.
Unfortunately, Andrew Troelsen's book did not show how to create anonymouse
descendant classes.
If I have a class Child, can I create an anonymouse descendant class that
represents a parent that has multiple offspring stored in a linked list and
pass this to a function expecting an instance of class child? Can someone
give me some sample code to do this?
Thanks,
Siegfried