Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6840525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:51:18+00:00 2026-05-26T23:51:18+00:00

I have an object to deserialize but the object has custom type ApplicationLanguage that

  • 0

I have an object to deserialize but the object has custom type ApplicationLanguage that cannot be serialize.

 [Serializable]
    public class FieldTranslation
    {
        // how is this possible?
        // does the 'en-us' in this member is reachable in this concept?
        //public ApplicationLanguage Lang = ApplicationLanguagesList.Get("en-us");

        //public ApplicationLanguage Lang { get; set; }

        [XmlAttribute("name")]
        public string Name{ get; set; }

        public string Tooltip { get; set; }

        public string Label { get; set; }

        public string Error { get; set; }

        public string Language { get; set; }
    }

I built an API to get type ApplicationLanguage from the cache like that:

ApplicationLanguage  en= ApplicationLanguagesList.Get("en-us");

Is there anyway that I can combine the custom type in the serialization above?

this is the xml:

 <Fields lang="en-us">
   <Item name="FirstName">
     <Tooltip>Please provide your {0}</Tooltip>
     <Error>{0} Is not valid</Error>
     <Label>First Name</Label>
  </Item>
</Fields>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:51:18+00:00Added an answer on May 26, 2026 at 11:51 pm

    you could change your class struct like

    [Serializable]
    [XmlRoot("Fields")]
    public class FieldCollection
    {
        [XmlAttribute("lang")]
        public string Lanuage { get; set; }
        [XmlElement("Item")]
        public FieldTranslation[] Fields { get; set; }
    }
    
    [Serializable]
    public class FieldTranslation
    {
        [XmlAttribute("name")]
        public string Name { get; set; }
    
        public string Tooltip { get; set; }
    
        public string Label { get; set; }
    
        public string Error { get; set; }
    
        public string Language { get; set; }
    }
    

    and then set the language property to serialize

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an XML file that I deserialize into a class object. This class
I have object A which in turn has a property of type Object B
I have two tables: object that has object_id column and avalues that have object_id
I have a class that has more than a dozen properties. For most of
I think I read somewhere that some modules only have object oriented interfaces (
I have an object that is mapped to a cookie as a serialized base-64
I have an object in a multi-threaded environment that maintains a collection of information,
I have an object of the type System.Drawing.Image and want to make every pixel
Currently, we use a giant configuration object that is serialized to/from XML. This has
I've got a class that has a read-only property defined that is actually a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.