The exapmle provided in section “Serializing Derived Classes”(with XmlArrayItemAttribute) may be not the case

cite=https://msdn.microsoft.com/EN-US/library/vstudio/2baksw0z.aspx

Another use of the XmlArrayItemAttribute is to allow the serialization of derived classes. For example, another class named Manager that derives from Employee can be added to the previous example. If you do not apply the XmlArrayItemAttribute, the code will fail at run time because the derived class type will not be recognized. To remedy this, apply the attribute twice, each time setting the Type property for each acceptable type (base and derived).

A serialized instance might resemble the following.

However, this is not the case.
I used the following test case:

which yields the result:

As you can see, xsi:type attribute didn’t appeared in the XML document containing the serialized Group instance. Instead, the element name of derived Manager class is employed.
If I modify the definition of Group class to

Then I get the following result

which coincides with the example output stated on MSDN.
p.s. I tested the code above in VS 2013.

GoG

It’s almost time to post something about Guardians of Ga’Hoole.
Yet before that, let me sleep…

Site Construction Has Reached its Milestone

It took me nearly a week.

I’ve failed to find a new site as a substitution to Baidu Hi in the year 2005.

So… I’m going to publish some mood & code here, as well as pictures. Please tell me / leave a comment if you’re interested in any of them. If this is the case, please login for comments.

The site now is open for registration. You can find login button at the bottom of sidebar, and Sign Up button is below the login form. However in order to fight against spamming, I’ll close the registration in time.

Okay… So I finally managed to translate the post… :-/

And spammers arrived earlier than my expectation, so please, do not use yahoo mail when registering your account. ‘Cause most of the spammers use this E-mail domain so I decided to forbid it. I just have no other way to fight against them.