S
schneider
Hello,
Have an issue with a property using the DefaultValue(True) attribute.
Imports System.ComponentModel
Public Class Class1
Private m_testValue As Boolean
<DefaultValue(True)> _
Public Property test() As Boolean
Get
Return m_testValue
End Get
Set(ByVal value As Boolean)
m_testValue = value
End Set
End Property
End Class
here's the steps to reproduce the problem:
1. User UI sets the Class1.test=false during runtime.
2. I serialize Class1 to xml and the false value is saved.
3. User UI sets the Class1.test=true during runtime.
4. I serialize Class1 to xml and the True value is NOT saved and the
False value is still there.
Step 4 is the problem, the file does not seem to reflect the current
state of the class.
If I remove the attribute it works fine, but the idea is the reduce the
file size and also know what the default is.
Anyone know what I'm doing wrong or missing?
Thanks,
Schneider
Have an issue with a property using the DefaultValue(True) attribute.
Imports System.ComponentModel
Public Class Class1
Private m_testValue As Boolean
<DefaultValue(True)> _
Public Property test() As Boolean
Get
Return m_testValue
End Get
Set(ByVal value As Boolean)
m_testValue = value
End Set
End Property
End Class
here's the steps to reproduce the problem:
1. User UI sets the Class1.test=false during runtime.
2. I serialize Class1 to xml and the false value is saved.
3. User UI sets the Class1.test=true during runtime.
4. I serialize Class1 to xml and the True value is NOT saved and the
False value is still there.
Step 4 is the problem, the file does not seem to reflect the current
state of the class.
If I remove the attribute it works fine, but the idea is the reduce the
file size and also know what the default is.
Anyone know what I'm doing wrong or missing?
Thanks,
Schneider