Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Form : Document { ... }
- // Later on
- Controls.Add(new DocumentDisplay(form));
- class Form
- {
- private Document Document { get; set; }
- // Other stuff
- }
- // Later on
- Controls.Add (new DocumentDisplay(form.Document));
- class Document
- {
- List<Field> m_Fields;
- public void AddField(Field f) {... }
- public void AddFields(Field[] f) {... }
- }
- class DocumentFactory()
- {
- public static Document GetDocument()
- {
- Document d = new Document();
- d.AddFields(GetDocumentFields()); // private helper .. returns fields 1-8
- return d;
- }
- public static Document GetForm()
- {
- Document d = new Document();
- AddDocumentFields(d);
- d.AddField(FIELD_9);
- d.AddField(FIELD_10);
- }
- // and so on..
- }
Add Comment
Please, Sign In to add comment