请教:老外这段程序搞不懂啥意思?大哥帮忙分析一下 [Serializable, XmlInclude(typeof(IndexPost)), XmlInclude(typeof(ESIndexPost))]
public class ESSearchResultSet : SearchResultSet
{
}主要是不明白上面的 XmlInclude(typeof(ESIndexPost)) 这段话啥意思?typeof(ESIndexPost) 有何用处?把下面这段删除也能编译通过,哪更是搞不明白了,难道老外吃饱了撑的?
[Serializable, XmlInclude(typeof(IndexPost)), XmlInclude(typeof(ESIndexPost))]
public class ESSearchResultSet : SearchResultSet
{
}主要是不明白上面的 XmlInclude(typeof(ESIndexPost)) 这段话啥意思?typeof(ESIndexPost) 有何用处?把下面这段删除也能编译通过,哪更是搞不明白了,难道老外吃饱了撑的?
[Serializable, XmlInclude(typeof(IndexPost)), XmlInclude(typeof(ESIndexPost))]
请参考
http://msdn.microsoft.com/zh-cn/library/system.xml.serialization.xmlincludeattribute(VS.80).aspx
http://topic.csdn.net/u/20070903/18/a5764963-f881-4e0d-b9b1-453c6ccb4576.html