Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to Serialize object's property by its Category

How to Serialize object's property by its Category

Scheduled Pinned Locked Moved C#
jsontutorialquestion
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nakey_yang
    wrote on last edited by
    #1

    public class Test { private int num1; private int num2; private int num3 [CategoryAttribute("BlackGround")] public int Num1 {get{return num1;} set{num1=value;}} [CategoryAttribute("BlackGround")] public int Num2 {get{return num2;} set{num2=value;}} [CategoryAttribute("ForeGround")] public int Num3 { get{return num3;} set{num3=value;} }} How get the Serialization result as below? .. .. .. ok

    S N 2 Replies Last reply
    0
    • N nakey_yang

      public class Test { private int num1; private int num2; private int num3 [CategoryAttribute("BlackGround")] public int Num1 {get{return num1;} set{num1=value;}} [CategoryAttribute("BlackGround")] public int Num2 {get{return num2;} set{num2=value;}} [CategoryAttribute("ForeGround")] public int Num3 { get{return num3;} set{num3=value;} }} How get the Serialization result as below? .. .. .. ok

      S Offline
      S Offline
      Stefan Troschuetz
      wrote on last edited by
      #2

      You want to post this every two hours? Show a bit patience! If you just wanted to change your posting use the modify link instead of starting a new thread.


      N 1 Reply Last reply
      0
      • S Stefan Troschuetz

        You want to post this every two hours? Show a bit patience! If you just wanted to change your posting use the modify link instead of starting a new thread.


        N Offline
        N Offline
        nakey_yang
        wrote on last edited by
        #3

        i know ,but i didn't know why this xml tag do disappear? ok

        S H 2 Replies Last reply
        0
        • N nakey_yang

          i know ,but i didn't know why this xml tag do disappear? ok

          S Offline
          S Offline
          Stefan Troschuetz
          wrote on last edited by
          #4

          Try to set the "Do not treat <'s as HTML tags" option which can be found below the text-control or use the HTML extended character codes.


          1 Reply Last reply
          0
          • N nakey_yang

            i know ,but i didn't know why this xml tag do disappear? ok

            H Offline
            H Offline
            Heath Stewart
            wrote on last edited by
            #5

            Or escape the tags themselves using &lt; for < and &gt; for >.

            Microsoft MVP, Visual C# My Articles

            1 Reply Last reply
            0
            • N nakey_yang

              public class Test { private int num1; private int num2; private int num3 [CategoryAttribute("BlackGround")] public int Num1 {get{return num1;} set{num1=value;}} [CategoryAttribute("BlackGround")] public int Num2 {get{return num2;} set{num2=value;}} [CategoryAttribute("ForeGround")] public int Num3 { get{return num3;} set{num3=value;} }} How get the Serialization result as below? .. .. .. ok

              N Offline
              N Offline
              nakey_yang
              wrote on last edited by
              #6

              i kown,bu i don't know why the xml tag became disappeared! ok

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups