Advertisement
Guest User

Untitled

a guest
Feb 18th, 2013
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 0.50 KB | None | 0 0
  1. module main;
  2.  
  3. import orange.core._;
  4. import orange.serialization._;
  5. import orange.serialization.archives._;
  6.  
  7. class Display
  8. {
  9.     int x;
  10. }
  11.  
  12. class Widget
  13. {
  14.     Display d;
  15.     Display e;
  16. }
  17.  
  18. Display display;
  19.  
  20. void main()
  21. {
  22.     auto archive = new XmlArchive!(char);
  23.     auto serializer = new Serializer(archive);
  24.  
  25.     display = new Display;
  26.     display.x = 3;
  27.  
  28.     auto w = new Widget;
  29.     w.d = display;
  30.     w.e = display;
  31.  
  32.     serializer.serialize(w);
  33.     println(archive.data);
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement