public FormDesignerModule(FormTemplate template) : base() { foreach (FormElement e in template.FormElements) { FormElementWrapper w = new FormElementWrapper(e); FormElements.Add(w); } RowString = template.Rows; ColumnString = template.Columns; _template = template; generateInstance(); }
private void addFormElement() { if ((ChosenFormElementOption == null) || (ChosenFormElementOption == String.Empty)) { return; } if (ChosenFormElementOption == "Label") { LabelFormElement e = new LabelFormElement(); e.Name = "New Label"; e.LabelText = "New Label"; LabelElementWrapper w = new LabelElementWrapper(e); _template.FormElements.Add(e); FormElements.Add(w); generateInstance(); } else if (ChosenFormElementOption == "Text Box") { TextFormElement e = new TextFormElement(); e.Name = "New text box"; FormElementWrapper w = new FormElementWrapper(e); _template.FormElements.Add(e); FormElements.Add(w); generateInstance(); } else if (ChosenFormElementOption == "Numeric Up Down") { NumericFormElement e = new NumericFormElement(); e.Name = "New numeric box"; NumericElementWrapper w = new NumericElementWrapper(e); _template.FormElements.Add(e); FormElements.Add(w); generateInstance(); } }