tags:

views:

146

answers:

1

I have an Enum and member it type

 [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;

when serialize this class result attribute will be like that:

<filter search_filter="types attributes methods" />

but need attribute:

<filter search_filter="types|attributes|methods" />

how can change delimiter when class serializing?

+1  A: 

You're going to have to take complete control of it, then - for example my marking that member as [XmlIgnore] and adding a public string property such as:

[XmlAttribute("search-filter")]
public string SearchShim {
    get { /* translate */ }
    set { /* translate */ }
}
Marc Gravell