Re: Collection of Members
That doesn't look very difficult to me. Any other way would a little bit of complexity. Here's one solution
Code:
interface IFoo
{
int X { get; set; }
}
class Foo : IFoo
{
int _x;
public int X
{
get { return _x; }
set { _x = value; }
}
// Add other properties that are specific to this class.
}
void MyFunc(List<IFoo> list)
{
}
void Main()
{
List<IFoo> list = new List<IFoo>();
MyFunc(list);
}
By the way you can use code tags to format your code. It makes it easier for others to read it, understand and then offer help. It also looks nicer...:)
Re: Collection of Members
I completely forgot about the code tag *facepalm*, and then I couldn't find the edit button later on. I was too tired to look for it.
I was thinking I would have to use an interface. I was just hoping that System.Collections had yet another goodie I could learn about today. I think I'm all out of goodies though.
Thanks for your help!