public NewTemplateReviewForm(List<string> componentList) { InitializeComponent(); foreach(string a in componentList){ Console.WriteLine(a); } Template t = new Template(componentList.ElementAt(0), componentList); this.panel1.Controls.Add(t.getTemplate()); //Test Case : Failed //ComponentFactoryJ component = new ComponentFactoryJ(); //Components comp = component.createlabelComponent("Test"); //Test Case : Worked //ComponentFactoryJ component = new ComponentFactoryJ(); //Components comp = component.createtxtAreaComponent("TextArea"); //this.panel1.Controls.Add((System.Windows.Forms.Control)comp); /* Test Cases for new Factory */ AbstractComponentFactory txtBoxTest = new ComponentFactory(); TextBoxComponent txtBox = txtBoxTest.createtextBoxComponent(); //this.panel1.Controls.Add(txtBox); AbstractComponentFactory txtAreaTest = new ComponentFactory(); TextAreaComponent txtArea = txtAreaTest.createtextAreaComponent(100, 50); //this.panel1.Controls.Add(txtArea); AbstractComponentFactory checkBoxTest = new ComponentFactory(); //CheckBoxComponent checkBox = checkBoxTest.createCheckbox("Test checkbox"); //this.panel1.Controls.Add(checkBox); AbstractComponentFactory labelText = new ComponentFactory(); LabelComponent label = labelText.createlabelComponent("Test label"); //this.panel1.Controls.Add(label); //Serialization testSerialization = new Serialization(TemplateStorage.GetInstance()); //testSerialization.serialize(@"C:\\Users\\cit_student3\\Desktop\\test.xml"); }
//Methods to add components to panel //First component should be Test Document Type followed by a description //Next will be a panel returned by the template class private void makeDocument() { Template tp = new Template(this.Name, list); this.Controls.Add(tp); }
//Methods to add components to panel //First component should be Test Document Type followed by a description //Next will be a panel returned by the template class private void makeDocument(string Name, List<string> list) { Template tp = new Template(Name, list); this.Controls.Add(tp); }