I am trying to inherit from List<Blah> so essentially I have something like this:
class Foo : List<Blah>
{
...
private string _var1;
private string _var2;
public string Var1
{
get { return _var1; }
}
public string Var2
{
get { return _var2; }
}
...
}
Now the problem is when I go to serialize this I get back only a representation of the inherited List properties (the collection of Blah objects) and nothing in the Foo class like Var1 and Var2. If I pull the List<Blah> down into the class instead of inheriting from it, there are no issues. What is causing the serializer to miss the public properites of the Foo class?
I think a big part of it is developers have grown themselves too big and ballooned their budgets. It's the only way to show endless growth to investors between releases. Then they make massive investments in games designed for the bottom line hoping players follow instead of designing them for the players and hoping the bottom line follow in the way smaller, indie developers do. This often causes the games to fail to hook players. Instead they need to streamline development, lower budgets and sales forecasts, actually listen to gamer feedback, realize that social media doesn't dictate real world gaming tastes and habits, and overall learn to adapt instead of regurgitating the same formulas over and over.
Yea, I don't buy new, I always wait for games to be on clearance. I thank those with money and time to waste for funding the fun I'll have for a fraction of the price.
Glad you sold it!
Chop shopping is a PITA. I do a lot of stuff with retro computing, mostly 8 & 16 bit from the 80's, and the choppers are utterly destroying the market. Ripping apart perfectly functional classic machines such as Amiga's and Atari ST's and so on and selling them for parts; it's disgusting.
Question
inetscan
I am trying to inherit from List<Blah> so essentially I have something like this:
class Foo : List<Blah>
{
...
private string _var1;
private string _var2;
public string Var1
{
get { return _var1; }
}
public string Var2
{
get { return _var2; }
}
...
}
Now the problem is when I go to serialize this I get back only a representation of the inherited List properties (the collection of Blah objects) and nothing in the Foo class like Var1 and Var2. If I pull the List<Blah> down into the class instead of inheriting from it, there are no issues. What is causing the serializer to miss the public properites of the Foo class?
Thanks and regards
Link to comment
https://www.neowin.net/forum/topic/496842-c-inheriting-from-list/Share on other sites
5 answers to this question
Recommended Posts