Cześć,
Mam problem z XmlChoiceIdentifier. Mam taką klasę + enum w moim interfejsie.
Public Enum ItemChoice
opcja1
opcja2
opcja3
End Enum
Partial Public Class myClass
Private _wartosc As String
Private _wybranaOpcja As ItemChoice
<System.Xml.Serialization.XmlElementAttribute("opcja1", GetType(String)),
System.Xml.Serialization.XmlElementAttribute("opcja2", GetType(String)),
System.Xml.Serialization.XmlElementAttribute("opcja3", GetType(String)),
System.Xml.Serialization.XmlChoiceIdentifierAttribute("wybranaOpcja")>
Public Property Wartosc() As String
Get
Return Me._wartosc
End Get
Set
Me._wartosc = Value
End Set
End Property
<System.Xml.Serialization.XmlElementAttribute(Order:=1),
System.Xml.Serialization.XmlIgnoreAttribute()>
Public Property WybranaOpcja() As ItemChoice
Get
Return Me._wybranaOpcja
End Get
Set
Me._wybranaOpcja = Value
End Set
End Property
End Class
Użytkownik może sobie wpisać wartość w jedną z trzech opcji. Ja muszę pobrać wartość oraz nazwę opcji wybranej. Niestety nieważne gdzie się wpisze wartość zawsze pobiera opcja1, wartość z opcja1.
Co mogę źle robić?
VB.NET