Click here to Skip to main content
15,913,722 members
Home / Discussions / C#
   

C#

 
GeneralRe: Global structure in Main, Functions and .dlls Pin
Richard MacCutchan4-Jan-17 1:16
mveRichard MacCutchan4-Jan-17 1:16 
GeneralRe: Global structure in Main, Functions and .dlls Pin
zequion4-Jan-17 6:41
professionalzequion4-Jan-17 6:41 
GeneralRe: Global structure in Main, Functions and .dlls Pin
Richard MacCutchan4-Jan-17 6:47
mveRichard MacCutchan4-Jan-17 6:47 
GeneralRe: Global structure in Main, Functions and .dlls Pin
zequion4-Jan-17 7:57
professionalzequion4-Jan-17 7:57 
GeneralRe: Global structure in Main, Functions and .dlls Pin
Richard MacCutchan4-Jan-17 21:27
mveRichard MacCutchan4-Jan-17 21:27 
AnswerRe: Global structure in Main, Functions and .dlls Pin
Gerry Schmitz4-Jan-17 7:52
mveGerry Schmitz4-Jan-17 7:52 
Questionhow to store the value selection on calendar in database Pin
being A.S.3-Jan-17 18:37
being A.S.3-Jan-17 18:37 
AnswerRe: how to store the value selection on calendar in database Pin
dan!sh 3-Jan-17 19:55
professional dan!sh 3-Jan-17 19:55 
QuestionRetrieving data from a webpage Pin
MAW303-Jan-17 13:46
MAW303-Jan-17 13:46 
AnswerRe: Retrieving data from a webpage Pin
dan!sh 3-Jan-17 17:30
professional dan!sh 3-Jan-17 17:30 
GeneralRe: Retrieving data from a webpage Pin
MAW303-Jan-17 19:01
MAW303-Jan-17 19:01 
GeneralRe: Retrieving data from a webpage Pin
dan!sh 3-Jan-17 19:53
professional dan!sh 3-Jan-17 19:53 
GeneralRe: Retrieving data from a webpage Pin
MAW303-Jan-17 21:28
MAW303-Jan-17 21:28 
GeneralRe: Retrieving data from a webpage Pin
dan!sh 3-Jan-17 22:01
professional dan!sh 3-Jan-17 22:01 
GeneralRe: Retrieving data from a webpage Pin
MAW304-Jan-17 4:43
MAW304-Jan-17 4:43 
AnswerRe: Retrieving data from a webpage Pin
MAW304-Jan-17 18:59
MAW304-Jan-17 18:59 
QuestionRe: Retrieving data from a webpage Pin
Richard MacCutchan4-Jan-17 21:57
mveRichard MacCutchan4-Jan-17 21:57 
AnswerRe: Retrieving data from a webpage Pin
MAW305-Jan-17 2:30
MAW305-Jan-17 2:30 
QuestionC# Text to Speech Pin
Pavlex42-Jan-17 10:32
Pavlex42-Jan-17 10:32 
AnswerRe: C# Text to Speech Pin
Michael_Davies2-Jan-17 10:38
Michael_Davies2-Jan-17 10:38 
GeneralRe: C# Text to Speech Pin
Pavlex42-Jan-17 10:40
Pavlex42-Jan-17 10:40 
GeneralRe: C# Text to Speech Pin
Pavlex42-Jan-17 11:26
Pavlex42-Jan-17 11:26 
GeneralRe: C# Text to Speech Pin
Pete O'Hanlon2-Jan-17 19:33
mvePete O'Hanlon2-Jan-17 19:33 
GeneralRe: C# Text to Speech Pin
Bernhard Hiller2-Jan-17 21:27
Bernhard Hiller2-Jan-17 21:27 
QuestionXml Serialization of List<T> Pin
Richard Andrew x642-Jan-17 6:18
professionalRichard Andrew x642-Jan-17 6:18 
I have the following code, but the class member "X" refuses to be serialized to the xml file:
C#
[Serializable]
public class MyList : List<MyClass>
{
    public string X = string.empty;
}

protected void Function()
{
    MyList L = new MyList();
    L.X = "String";

    XmlSerializer serializer = new XmlSerializer(typeof(MyList));

    StreamWriter Sw = new StreamWriter(Filename);

    serializer.Serialize(Sw, L);

    Sw.Dispose();
}

The member is simply absent from resulting the Xml file.

Is there anything I can do to force the serializer to serialize member "X" to the file?

Is there some reason it's not serializing "X"? Is it because the class derives from List<T>?



The difficult we do right away...
...the impossible takes slightly longer.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.