我 XMLIgnoreAttribute , VARSpecified 忽略或忽略值。
但指定的任何属性是否必须有值?
我找到了Attributes That Control XML Serialization,但没有用。
class Test
{
[XMLIgnore]
public string IgnoredValue;
[XMLAttribute]
public string AnAttribute;
// If 'AnAttribute' length < 5 will be ignored
public bool AnAttributeSpecified{get {return AnAttribute.Length > 5;};}
// For this, it must have a value, is there any attribute for this?
public string Name;
}