Click here to Skip to main content
15,887,267 members
Home / Discussions / C#
   

C#

 
GeneralRe: GridView + TextBox and Button Control Pin
It_tech17-Feb-10 1:02
It_tech17-Feb-10 1:02 
GeneralRe: GridView + TextBox and Button Control Pin
It_tech17-Feb-10 5:47
It_tech17-Feb-10 5:47 
QuestionRegular expression Pin
salmonraju16-Feb-10 22:59
salmonraju16-Feb-10 22:59 
AnswerRe: Regular expression [modified] Pin
OriginalGriff16-Feb-10 23:14
mveOriginalGriff16-Feb-10 23:14 
GeneralRe: Regular expression Pin
salmonraju16-Feb-10 23:24
salmonraju16-Feb-10 23:24 
GeneralRe: Regular expression Pin
OriginalGriff16-Feb-10 23:30
mveOriginalGriff16-Feb-10 23:30 
GeneralRe: Regular expression Pin
salmonraju16-Feb-10 23:46
salmonraju16-Feb-10 23:46 
QuestionXmlSerializer doesn't serialize properties when inheriting List<T>? [modified] Pin
mav.northwind16-Feb-10 22:55
mav.northwind16-Feb-10 22:55 
Hi folks!

The XmlSerializer is giving me a headache. I've got this class (.NET 2.0):
[Serializable]
public class ParticipantList : List<Participant>
{
  private Guid _ID = Guid.NewGuid();
  public Guid ID
  {
    get { return _ID; }
    set { _ID = value; }
  }

  public static void ToFile(ParticipantList list, string filename)
  {
    using (FileStream fs = new FileStream(filename, FileMode.Create, FileAccess.Write))
    {
      XmlSerializer xs = new XmlSerializer(typeof(ParticipantList));
      xs.Serialize(fs, list);
    }
  }

  public static ParticipantList FromFile(string filename)
  {
    using (FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
    {
      XmlSerializer xs = new XmlSerializer(typeof(ParticipantList));
      return (ParticipantList)xs.Deserialize(fs);
    }
  }
}

Pretty basic stuff it would seem.
The participant list gets serialized OK, but the ID isn't included in the XML file! Frown | :(

Did I miss something? Has the XmlSerializer gone nuts?

Thanks in advance for tips on how to get the ID serialized as well!

[Update]
No additional property or member gets serialized, the Guid isn't the reason.
Regards,
mav

--
Black holes are the places where God divided by 0...
modified on Wednesday, February 17, 2010 6:16 AM

AnswerMessage Closed Pin
16-Feb-10 23:08
stancrm16-Feb-10 23:08 
GeneralRe: XmlSerializer doesn't serialize Guid? Pin
mav.northwind17-Feb-10 0:16
mav.northwind17-Feb-10 0:16 
AnswerSolution Pin
mav.northwind17-Feb-10 2:11
mav.northwind17-Feb-10 2:11 
Questionquery execution with mysql Pin
Guizzardi16-Feb-10 22:34
Guizzardi16-Feb-10 22:34 
AnswerRe: query execution with mysql Pin
OriginalGriff16-Feb-10 23:26
mveOriginalGriff16-Feb-10 23:26 
GeneralRe: query execution with mysql Pin
Guizzardi17-Feb-10 0:14
Guizzardi17-Feb-10 0:14 
GeneralRe: query execution with mysql Pin
OriginalGriff17-Feb-10 0:33
mveOriginalGriff17-Feb-10 0:33 
GeneralRe: query execution with mysql Pin
Guizzardi17-Feb-10 1:04
Guizzardi17-Feb-10 1:04 
GeneralRe: query execution with mysql Pin
OriginalGriff17-Feb-10 1:24
mveOriginalGriff17-Feb-10 1:24 
GeneralRe: query execution with mysql Pin
Guizzardi17-Feb-10 3:05
Guizzardi17-Feb-10 3:05 
QuestionI have a cellclicked invent for my datagrid in a winform how do i automatically click it in code? Pin
tonyonlinux16-Feb-10 21:38
tonyonlinux16-Feb-10 21:38 
QuestionCreating Entity Class for XML Pin
K V Sekhar16-Feb-10 18:56
K V Sekhar16-Feb-10 18:56 
AnswerRe: Creating Entity Class for XML Pin
Saksida Bojan16-Feb-10 20:47
Saksida Bojan16-Feb-10 20:47 
GeneralRe: Creating Entity Class for XML Pin
kfqnwang9-Mar-11 16:00
kfqnwang9-Mar-11 16:00 
QuestionChat Server/Client Pin
satsumatable16-Feb-10 18:09
satsumatable16-Feb-10 18:09 
AnswerRe: Chat Server/Client Pin
Marcel Gheorghita16-Feb-10 19:05
Marcel Gheorghita16-Feb-10 19:05 
Questionmaths Pin
antrock10116-Feb-10 18:06
antrock10116-Feb-10 18:06 

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.