Address.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. namespace InABox.Core
  2. {
  3. public class Address : BaseObject, IEnclosedEntity, IPersistent, IRemotable
  4. {
  5. [EditorSequence(1)]
  6. [MemoEditor]
  7. public string Street { get; set; }
  8. [EditorSequence(2)]
  9. [TextBoxEditor]
  10. public string City { get; set; }
  11. [EditorSequence(3)]
  12. [ComboLookupEditor(typeof(StateLookups))]
  13. public string State { get; set; }
  14. [EditorSequence(4)]
  15. [CodeEditor(Editable = Editable.Enabled)]
  16. public string PostCode { get; set; }
  17. [NullEditor]
  18. public Location Location { get; set; }
  19. protected override void Init()
  20. {
  21. base.Init();
  22. Street = "";
  23. City = "";
  24. State = "";
  25. PostCode = "";
  26. Location = new Location();
  27. }
  28. private class StateLookups : LookupGenerator<object>
  29. {
  30. public StateLookups(object[] items) : base(items)
  31. {
  32. AddValue("Australian Capital Territory", "Australian Capital Territory");
  33. AddValue("New South Wales", "New South Wales");
  34. AddValue("Northern Territory", "Northern Territory");
  35. AddValue("Queensland", "Queensland");
  36. AddValue("South Australia", "South Australia");
  37. AddValue("Tasmania", "Tasmania");
  38. AddValue("Victoria", "Victoria");
  39. AddValue("Western Australia", "Western Australia");
  40. }
  41. }
  42. }
  43. }