Click here to Skip to main content
15,906,626 members
Home / Discussions / C#
   

C#

 
Questionhow to create cab file from setup exe file using cabsdk Pin
NarVish11-May-10 19:37
NarVish11-May-10 19:37 
AnswerRe: how to create cab file from setup exe file using cabsdk Pin
Abhinav S11-May-10 20:20
Abhinav S11-May-10 20:20 
QuestionHow to encrypt data in mySQL using C# Pin
MissNano11-May-10 18:34
MissNano11-May-10 18:34 
AnswerRe: How to encrypt data in mySQL using C# Pin
Peace ON11-May-10 22:14
Peace ON11-May-10 22:14 
QuestionDate Pickers with Checkboxes and Modified Rows Pin
gmhanna11-May-10 17:44
gmhanna11-May-10 17:44 
AnswerRe: Date Pickers with Checkboxes and Modified Rows Pin
Stanciu Vlad11-May-10 19:27
Stanciu Vlad11-May-10 19:27 
QuestionWhere to get started Pin
crosson11-May-10 17:09
crosson11-May-10 17:09 
AnswerRe: Where to get started Pin
Peace ON11-May-10 21:58
Peace ON11-May-10 21:58 
AnswerRe: Where to get started Pin
Richard MacCutchan11-May-10 22:27
mveRichard MacCutchan11-May-10 22:27 
AnswerRe: Where to get started Pin
crosson12-May-10 10:51
crosson12-May-10 10:51 
AnswerRe: Where to get started Pin
Ravi Sant14-Apr-11 1:22
Ravi Sant14-Apr-11 1:22 
QuestionSerialization Question Pin
Kevin Marois11-May-10 11:14
professionalKevin Marois11-May-10 11:14 
AnswerRe: Serialization Question Pin
William Winner11-May-10 11:40
William Winner11-May-10 11:40 
GeneralRe: Serialization Question Pin
Kevin Marois11-May-10 11:55
professionalKevin Marois11-May-10 11:55 
GeneralRe: Serialization Question Pin
William Winner11-May-10 12:07
William Winner11-May-10 12:07 
GeneralRe: Serialization Question Pin
Kevin Marois11-May-10 12:15
professionalKevin Marois11-May-10 12:15 
GeneralRe: Serialization Question Pin
William Winner11-May-10 12:43
William Winner11-May-10 12:43 
The question I have then, is what does Customer's look like? And what does your base class look like?

I would think something like:
C#
[Serializable]
[XMLRoot("Customers")]
public class Customers: _ItemBase
{
}

[Serializable]
public abstract class _ItemBase
{
  [XMLAttribute("Type")]
  public ItemType Type {get; set;}
  
  [XMLAttribute("ItemID")]
  public int ItemId {get; set;}

  private _Collection<_ItemBase> _Items = new _Collection<_ItemBase>()
  [XMLElement("Items")]
  public _Collection<_ItemBase> Items
  {
    get {return _Items;}
    set {_Items = value;}
  }
}


Is that close?

You will have some problems like this though. That's because it looks like the way you've set it up, you could add an InvoiceHeader directly to Customers, or Customers to an InvoiceHeader if everything is just inherited from that base class. In order to deserialize, it's going to need a set structure, because beyond the root, I don't think you'll be able to name anything besides "Items". I could be wrong though.
GeneralRe: Serialization Question Pin
Kevin Marois11-May-10 12:54
professionalKevin Marois11-May-10 12:54 
GeneralRe: Serialization Question Pin
William Winner12-May-10 6:01
William Winner12-May-10 6:01 
GeneralRe: Serialization Question Pin
Kevin Marois12-May-10 6:39
professionalKevin Marois12-May-10 6:39 
AnswerRe: Serialization Question Pin
William Winner11-May-10 12:44
William Winner11-May-10 12:44 
Questioninternal keyword, InternalsAvailableTo Pin
Ryan Minor11-May-10 8:13
Ryan Minor11-May-10 8:13 
AnswerRe: internal keyword, InternalsAvailableTo Pin
Paulo Zemek11-May-10 9:41
Paulo Zemek11-May-10 9:41 
QuestionHow do I change service startup type Pin
ziopino7011-May-10 6:25
ziopino7011-May-10 6:25 
AnswerRe: How do I change service startup type Pin
#realJSOP11-May-10 6:30
professional#realJSOP11-May-10 6:30 

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.