1
我有一個枚舉和成員鍵入它C#標誌枚舉分隔符
[Flags]
public enum SearchFilter
{
types = 0x01,
attributes = 0x02,
methods = 0x04
}
[System.Xml.Serialization.XmlAttribute("search-filter")]
public SearchFilter search_filter = SearchFilter.types | SearchFilter.attributes | SearchFilter.methods;
時,序列化該類結果屬性將是這樣的:
<filter search_filter="types attributes methods" />
但需要屬性:
<filter search_filter="types|attributes|methods" />
類的序列化時如何更改分隔符?