Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to Serialize an Enum?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to Serialize an Enum?

    I create a public property whose type is a custom enum.

    Somewhere on this forum, I saw koganam say that enum would be automatically serialized.
    However, when I set the property to a non-default value, then restart NT platform (with workspace saved, of course) the property returns default.

    So, how can I serialize an enum?
    Thank you.

    #2
    Originally posted by tracoder View Post
    I create a public property whose type is a custom enum.

    Somewhere on this forum, I saw koganam say that enum would be automatically serialized.
    However, when I set the property to a non-default value, then restart NT platform (with workspace saved, of course) the property returns default.

    So, how can I serialize an enum?
    Thank you.
    Have you applied the [XmlIgnore] attribute to the property by any chance?

    Comment


      #3
      Originally posted by koganam View Post
      Have you applied the [XmlIgnore] attribute to the property by any chance?
      What a shame Don't know why I put XmlIgnore there, then have to go crazy seeking for a solution. After removing XmlIgnore, the setting for enum is successfully saved.

      Thank you for your help, koganam. Merry Christmas

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by AHamxa, Yesterday, 11:24 PM
      0 responses
      5 views
      0 likes
      Last Post AHamxa
      by AHamxa
       
      Started by AHamxa, Yesterday, 11:22 PM
      0 responses
      4 views
      0 likes
      Last Post AHamxa
      by AHamxa
       
      Started by AHamxa, Yesterday, 11:17 PM
      0 responses
      5 views
      0 likes
      Last Post AHamxa
      by AHamxa
       
      Started by Spiderbird, 07-27-2018, 07:52 PM
      12 responses
      9,240 views
      2 likes
      Last Post Mountain_cast  
      Started by chrischongpdx, Yesterday, 09:39 PM
      0 responses
      7 views
      0 likes
      Last Post chrischongpdx  
      Working...
      X