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

  • SEARCH
  • Home
  • 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 7956435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:59:21+00:00 2026-06-04T03:59:21+00:00

there. I have the foloowing class definition: [Serializable] public enum FilterType { [XmlEnum(1)] Text

  • 0

there.
I have the foloowing class definition:

[Serializable]
public enum FilterType
{
    [XmlEnum("1")]
    Text = 1,
     [XmlEnum("2")]
    Date = 2,
     [XmlEnum("3")]
    Combo = 3,
     [XmlEnum("4")]
    Multichoice = 4
}

public class FilterValues : List<string>
{
    public FilterType Type { get; set; } 
}

[Serializable]
public struct SerializableKeyValuePair<K, V>
{
    public SerializableKeyValuePair(KeyValuePair<K, V> p)
    {
        this.key = p.Key;
        this.value = p.Value;
    }

    private K key;
    public K Key
    {
        get { return key; }
        set { key = value; }
    }

    private V value;
    public V Value
    {
        get { return this.value; }
        set { this.value = value; }
    }
}

and I can’t make it to serialize the Type property in xml when I try to serialize
array of SerializableKeyValuePair with key of type string and value of type FilterValues ( SerializableKeyValuePair<string, FilterValues>[] ).
I got this result:

<?xml version="1.0" encoding="utf-16"?>  
<ArrayOfSerializableKeyValuePairOfStringFilterValues xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">    
<SerializableKeyValuePairOfStringFilterValues>      
<Key>Date</Key>     
 <Value>        <string>2012-5-16</string>      </Value>    
 </SerializableKeyValuePairOfStringFilterValues>    
 <SerializableKeyValuePairOfStringFilterValues>      
 <Key>bgName</Key>      <Value>        <string>4</string>      </Value>    
 </SerializableKeyValuePairOfStringFilterValues>  
 </ArrayOfSerializableKeyValuePairOfStringFilterValues>

Please help, I tried anything possible.

  • 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-06-04T03:59:23+00:00Added an answer on June 4, 2026 at 3:59 am

    It is related to this question: When a class is inherited from List<>, XmlSerializer doesn't serialize other attributes

    So, as pointed out in answer to that question, you have to change your FilterValues implementation in one of at least three possible ways:

    -implement IXmlSerializable
    -remove inheritance from List
    -use another serializer
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following use case: There's a class called Template and with that
I'm developing a shared library. Let's say I have the following class definition: class
I have a class, lets call it A, and within that class definition I
I have the following class definition, written in C++, residing in it's own header
Assume I have the following class-hierarchy in C++: class AbstractBaseClass { public: // Note:
I have the following object: namespace LearnLINQ1 { [Table(Name=testMe)] public class SubmitTest { [Column(Name=FirstName)]
Hello I have following c++ code class classBase { public: int get1(){return 1;} int
Given a generic class definition like public class ConstrainedNumber<T> : IEquatable<ConstrainedNumber<T>>, IEquatable<T>, IComparable<ConstrainedNumber<T>>, IComparable<T>,
Let's have the following class hierarchy: public class MyType { } public class MySuperclass<T
I am using Quartz JDBCJobStore and have following job definition JobDetail job=newJob(HelloJob.class).withIdentity(demo11, group11). usingJobData(jobSays,

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.