public void ODFFrameTest() { //Create a new text document TextDocument document = new TextDocument(); document.New(); // Create a main paragraph Paragraph p =new Paragraph(document); // Create a main form ODFForm main_form = new ODFForm(document, "mainform"); main_form.Method = Method.Get; // Create a frame ODFFrame frm = new ODFFrame(main_form, p.Content, "frm", "5mm", "5mm", "5cm", "3cm"); frm.Label = "ODFFrame test"; // Add the frame to the form control list main_form.Controls.Add (frm); // Create a button ODFButton butt = new ODFButton(main_form, p.Content, "butt", "1cm", "15mm", "4cm", "1cm"); butt.Label = "A simple button :)"; // Add the button to the form control list main_form.Controls.Add (butt); // Add the forms to the document! document.Forms.Add(main_form); // Add the paragraph to the content list document.Content.Add(p); document.SaveTo(AARunMeFirstAndOnce.outPutFolder+"frame_test.odt"); document.Load(AARunMeFirstAndOnce.outPutFolder+"frame_test.odt"); document.SaveTo(AARunMeFirstAndOnce.outPutFolder+"frame_test2.odt"); }
private void FormCollection_Inserted(int index, object value) { ODFForm child = (value as ODFForm); if (child != null) { this.Node.AppendChild(child.Node); } }
private void FormCollection_Removed(int index, object value) { ODFForm child = (value as ODFForm); if (child != null) { child.Controls.Clear(); if (child.Node != null) { this.Node.RemoveChild(child.Node); } } }
public ODFRadioButton(ODFForm ParentForm, XmlNode node): base(ParentForm, node) {}
/// <summary> /// Creates an ODFRadioButton /// </summary> /// <param name="ParentForm">Parent form that the control belongs to</param> /// <param name="contentCollection">Collection of content where the control will be referenced</param> /// <param name="id">Control ID. Please specify a unique ID!</param> public ODFRadioButton(ODFForm ParentForm, ContentCollection contentCollection, string id): base (ParentForm, contentCollection, id) {}
/// <summary> /// Creates an ODFHidden /// </summary> /// <param name="ParentForm">Parent form that the control belongs to</param> /// <param name="contentCollection">Collection of content where the control will be referenced</param> /// <param name="id">Control ID. Please specify a unique ID!</param> public ODFHidden(ODFForm ParentForm, ContentCollection contentCollection, string id): base (ParentForm, contentCollection, id) {}
/// <summary> /// Adds new form to the forms collection /// </summary> /// <param name="name">Form name</param> /// <returns></returns> public ODFForm AddNewForm(string name) { ODFForm f = new ODFForm(this.Document, name); Forms.Add(f); return f; }
public ODFValueRange(ODFForm ParentForm, XmlNode node): base(ParentForm, node) {}
/// <summary> /// Creates an ODFValueRange /// </summary> /// <param name="ParentForm">Parent form that the control belongs to</param> /// <param name="contentCollection">Collection of content where the control will be referenced</param> /// <param name="id">Control ID. Please specify a unique ID!</param> public ODFValueRange(ODFForm ParentForm, ContentCollection contentCollection, string id): base (ParentForm, contentCollection, id) {}
/// <summary> /// Creates an ODFTextArea /// </summary> /// <param name="ParentForm">Parent form that the control belongs to</param> /// <param name="contentCollection">Collection of content where the control will be referenced</param> /// <param name="id">Control ID. Please specify a unique ID!</param> public ODFTextArea(ODFForm ParentForm, ContentCollection contentCollection, string id): base (ParentForm, contentCollection, id) {}
public void HTMLExportTest() { //Create a new text document TextDocument document = new TextDocument(); document.New(); Paragraph p =new Paragraph(document); ODFForm main_form = new ODFForm(document, "mainform"); main_form.Method = Method.Get; main_form.Href="http://hello.foo.com"; ODFComboBox ccb = new ODFComboBox(main_form, p.Content, "ccb", "0mm", "0mm", "3cm", "1cm"); ccb.Size = 5; ccb.DropDown = XmlBoolean.True; ccb.Items.Add(new ODFItem(document, "Charlie")); ccb.Items.Add(new ODFItem(document, "John")); ccb.Items.Add(new ODFItem(document, "Dieter")); ccb.Items.Add(new ODFItem(document, "Bill")); ccb.Items.Add(new ODFItem(document, "Oleg")); ccb.Items.Add(new ODFItem(document, "Lars")); main_form.Controls.Add (ccb); ODFButton butt = new ODFButton(main_form, p.Content, "butt", "5mm", "15mm", "4cm", "1cm"); butt.Label = "A simple button :)"; main_form.Controls.Add (butt); ODFCheckBox cb = new ODFCheckBox(main_form, p.Content, "cbx", "5mm", "25mm", "4cm", "5mm"); cb.Label = "check it!"; cb.Name = "cbx"; cb.Value = "cbx_value"; main_form.Controls.Add (cb); document.Forms.Add(main_form); document.Content.Add(p); Paragraph text_p = new Paragraph(document); text_p.TextContent.Add(new SimpleText(document, "This is a simple text content that is located in the next paragraph after the form!")); document.Content.Add(text_p); document.SaveTo(AARunMeFirstAndOnce.outPutFolder+"html_test.odt"); document.SaveTo(AARunMeFirstAndOnce.outPutFolder+"html_test.html"); }
public void GenericPropertiesTest() { //Create a new text document TextDocument document = new TextDocument(); document.New(); Paragraph p =new Paragraph(document); p.StyleName = "Standard"; ODFForm main_form = new ODFForm(document, "mainform"); // add form:properties to the form main_form.Properties.Add(new SingleFormProperty(document, PropertyValueType.String, "name", "Oleg Yegorov")); main_form.Properties.Add(new SingleFormProperty(document, PropertyValueType.String, "comment", "ODF rulezz!")); main_form.Properties.Add(new SingleFormProperty(document, PropertyValueType.Boolean, "some_bool_value", "true")); // please check content.xml file to see that they were really added :) main_form.Method = Method.Get; ODFFrame frm = new ODFFrame(main_form, p.Content, "frm", "5mm", "5mm", "5cm", "7cm"); frm.Label = "Generic properties test."; main_form.Controls.Add (frm); document.Forms.Add(main_form); document.Content.Add(p); document.SaveTo(AARunMeFirstAndOnce.outPutFolder+"generic_prop.odt"); }
public void ODFListBoxAndComboBoxTest() { //Create a new text document TextDocument document = new TextDocument(); document.New(); Paragraph p =new Paragraph(document); p.StyleName = "Standard"; ODFForm main_form = new ODFForm(document, "mainform"); main_form.Method = Method.Get; ODFFrame frm = new ODFFrame(main_form, p.Content, "frm", "5mm", "5mm", "5cm", "7cm"); frm.Label = "List- and ComboBox test"; main_form.Controls.Add (frm); ODFListBox lb = new ODFListBox(main_form, p.Content, "lb", "1cm", "15mm", "4cm", "5cm"); lb.Options.Add(new ODFOption(document, "Charlie")); lb.Options.Add(new ODFOption(document, "John")); lb.Options.Add(new ODFOption(document, "Dieter")); lb.Options.Add(new ODFOption(document, "Bill")); lb.Options.Add(new ODFOption(document, "Oleg")); lb.Options.Add(new ODFOption(document, "Lars")); main_form.Controls.Add (lb); ODFComboBox cb = new ODFComboBox(main_form, p.Content, "cb", "1cm", "65mm", "4cm", "6mm"); cb.Items.Add(new ODFItem(document, "Charlie")); cb.Items.Add(new ODFItem(document, "John")); cb.Items.Add(new ODFItem(document, "Dieter")); cb.Items.Add(new ODFItem(document, "Bill")); cb.Items.Add(new ODFItem(document, "Oleg")); cb.Items.Add(new ODFItem(document, "Lars")); cb.CurrentValue = "Please select a value..."; cb.DropDown = XmlBoolean.True; main_form.Controls.Add (cb); document.Forms.Add(main_form); document.Content.Add(p); document.SaveTo(AARunMeFirstAndOnce.outPutFolder+"listbox_combobox.odt"); }
public void SaveLoadTest() { //Create a new text document TextDocument document = new TextDocument(); document.New(); Paragraph p =new Paragraph(document); p.StyleName = "Standard"; ODFForm main_form = new ODFForm(document, "mainform"); main_form.Method = Method.Get; ODFFrame frm = new ODFFrame(main_form, p.Content, "frm", "5mm", "5mm", "5cm", "3cm"); frm.Label = "Save and Load test"; main_form.Controls.Add (frm); ODFButton butt = new ODFButton(main_form, p.Content, "butt", "1cm", "15mm", "4cm", "1cm"); butt.Label = "A simple button :)"; main_form.Controls.Add (butt); document.Forms.Add(main_form); document.Content.Add(p); document.SaveTo(AARunMeFirstAndOnce.outPutFolder+"saveload.odt"); document.Load(AARunMeFirstAndOnce.outPutFolder+"saveload.odt"); ODFButton bt = document.FindControlById("butt") as ODFButton; Assert.IsNotNull(bt, "Could not find control with >butt< ID"); bt.Label = "This label has chanhed"; document.SaveTo(AARunMeFirstAndOnce.outPutFolder+"saveload2.odt"); }
public void ODFImageTest() { //Create a new text document TextDocument document = new TextDocument(); document.New(); // Create a new paragraph Paragraph p =new Paragraph(document); // Create a main form ODFForm main_form = new ODFForm(document, "mainform"); main_form.Method = Method.Get; // Create an ODFGrid ODFImage img = new ODFImage(main_form, p.Content, "grd", "5mm", "5mm", "10cm", "6cm"); img.ImageData = AARunMeFirstAndOnce.inPutFolder+"Eclipse_add_new_Class.jpg"; main_form.Controls.Add (img); document.Forms.Add(main_form); document.Content.Add(p); document.SaveTo(AARunMeFirstAndOnce.outPutFolder+"image_test.odt"); document.Load(AARunMeFirstAndOnce.outPutFolder+"image_test.odt"); document.SaveTo(AARunMeFirstAndOnce.outPutFolder+"image_test2.odt"); }
public void ODFGridTest() { //Create a new text document TextDocument document = new TextDocument(); document.New(); // Create a new paragraph Paragraph p =new Paragraph(document); // Create a main form ODFForm main_form = new ODFForm(document, "mainform"); main_form.Method = Method.Get; // Create an ODFGrid ODFGrid grd = new ODFGrid(main_form, p.Content, "grd", "5mm", "5mm", "7cm", "5cm"); grd.Columns.Add(new ODFGridColumn(document, "col1", "One")); grd.Columns.Add(new ODFGridColumn(document, "col1", "Two")); grd.Columns.Add(new ODFGridColumn(document, "col1", "Three")); main_form.Controls.Add (grd); document.Forms.Add(main_form); document.Content.Add(p); document.SaveTo(AARunMeFirstAndOnce.outPutFolder+"grid_test.odt"); document.Load(AARunMeFirstAndOnce.outPutFolder+"grid_test.odt"); document.SaveTo(AARunMeFirstAndOnce.outPutFolder+"grid_test2.odt"); }
public ODFGrid(ODFForm ParentForm, XmlNode node): base(ParentForm, node) { _columns = new ODFGridColumnCollection(); RestoreColumnEvents(); }
public void NestedFormTest() { //Create a new text document TextDocument document = new TextDocument(); document.New(); // Create a main paragraph Paragraph p =new Paragraph(document); // Create a main form ODFForm main_form = new ODFForm(document, "mainform"); ODFForm child_form = new ODFForm(document, "childform"); main_form.Method = Method.Get; main_form.Method = Method.Get; // Create a frame ODFFrame frm = new ODFFrame(main_form, p.Content, "frm", "5mm", "5mm", "5cm", "3cm"); frm.Label = "Main form"; // Add the frame to the form control list main_form.Controls.Add (frm); // Create a button ODFButton butt = new ODFButton(main_form, p.Content, "butt", "1cm", "15mm", "4cm", "1cm"); butt.Label = "This is a main form"; // Add the button to the form control list main_form.Controls.Add (butt); // Add the forms to the main form! document.Forms.Add(main_form); // Add the paragraph to the content list document.Content.Add(p); // adding controls to the nested form ODFFrame frm_child = new ODFFrame(child_form, p.Content, "frm_child", "5mm", "35mm", "5cm", "3cm"); frm_child.Label = "Child form"; child_form.Controls.Add (frm_child); ODFButton butt_child = new ODFButton(child_form, p.Content, "butt_child", "1cm", "45mm", "4cm", "1cm"); butt_child.Label = "This is a child form"; child_form.Controls.Add (butt_child); main_form.ChildForms.Add(child_form); ODFButton b = document.FindControlById("butt_child") as ODFButton; Assert.IsNotNull(b, "Error! could not find the specified control"); b.Label = "Child form:)"; // Add the forms to the main form! document.Forms.Add(main_form); // Add the paragraph to the content list document.Content.Add(p); document.SaveTo(AARunMeFirstAndOnce.outPutFolder+"nested_forms_test.odt"); document.Load(AARunMeFirstAndOnce.outPutFolder+"nested_forms_test.odt"); document.SaveTo(AARunMeFirstAndOnce.outPutFolder+"nested_forms_test2.odt"); }
public ODFTextArea(ODFForm ParentForm, XmlNode node): base(ParentForm, node) {}
public void SpreadSheetFormsTest() { //Create new spreadsheet document SpreadsheetDocument spreadsheetDocument = new SpreadsheetDocument(); spreadsheetDocument.New(); //Create a new table Table table = new Table(spreadsheetDocument, "First", "tablefirst"); //Create a new cell, without any extra styles Cell cell = new Cell(spreadsheetDocument, "cell001"); cell.OfficeValueType = "string"; //Set full border cell.CellStyle.CellProperties.Border = Border.NormalSolid; //Add a paragraph to this cell Paragraph paragraph = ParagraphBuilder.CreateSpreadsheetParagraph( spreadsheetDocument); //Add some text content paragraph.TextContent.Add(new SimpleText(spreadsheetDocument, "Some text")); //Add paragraph to the cell cell.Content.Add(paragraph); //Insert the cell at row index 2 and column index 3 //All need rows, columns and cells below the given //indexes will be build automatically. table.Rows.Add(new Row(table, "Standard")); table.Rows.Add(new Row(table, "Standard")); table.Rows.Add(new Row(table, "Standard")); table.InsertCellAt(3, 2, cell); //Insert table into the spreadsheet document ODFForm main_form = new ODFForm(spreadsheetDocument, "mainform"); main_form.Method = Method.Get; ODFButton butt = new ODFButton(main_form, cell.Content, "butt", "0cm", "0cm", "15mm", "8mm"); butt.Label = "test :)"; main_form.Controls.Add (butt); spreadsheetDocument.TableCollection.Add(table); table.Forms.Add(main_form); spreadsheetDocument.SaveTo(AARunMeFirstAndOnce.outPutFolder+"spreadsheet_forms.ods"); SpreadsheetDocument spreadsheetDocument2 = new SpreadsheetDocument(); spreadsheetDocument2.Load(AARunMeFirstAndOnce.outPutFolder+"spreadsheet_forms.ods"); ODFButton b = spreadsheetDocument2.TableCollection[0].FindControlById("butt") as ODFButton; Assert.IsNotNull(b); b.Label = "it works!"; spreadsheetDocument2.SaveTo(AARunMeFirstAndOnce.outPutFolder+"spreadsheet_forms2.ods"); }
/// <summary> /// Creates an ODFValueRange /// </summary> /// <param name="ParentForm">Parent form that the control belongs to</param> /// <param name="contentCollection">Collection of content where the control will be referenced</param> /// <param name="id">Control ID. Please specify a unique ID!</param> /// <param name="x">X coordinate of the control in ODF format (eg. "1cm", "15mm", 3.2cm" etc)</param> /// <param name="y">Y coordinate of the control in ODF format (eg. "1cm", "15mm", 3.2cm" etc)</param> /// <param name="width">Width of the control in ODF format (eg. "1cm", "15mm", 3.2cm" etc)</param> /// <param name="height">Height of the control in ODF format (eg. "1cm", "15mm", 3.2cm" etc)</param> public ODFValueRange(ODFForm ParentForm, ContentCollection contentCollection, string id, string x, string y, string width, string height): base (ParentForm, contentCollection, id, x, y, width, height) {}
public void SpreadSheetImportExportTest() { //Create new spreadsheet document SpreadsheetDocument spreadsheetDocument = new SpreadsheetDocument(); spreadsheetDocument.Load(AARunMeFirstAndOnce.inPutFolder+@"bigtable.ods"); ODFForm f = new ODFForm(spreadsheetDocument, "mainform"); ODFButton butt = new ODFButton(f, spreadsheetDocument.TableCollection[0].Rows[1].Cells[1].Content, "butt", "5mm", "15mm", "4cm", "1cm"); f.Controls.Add(butt); spreadsheetDocument.TableCollection[0].Forms.Add(f); spreadsheetDocument.SaveTo(AARunMeFirstAndOnce.outPutFolder+"bigtable2.ods"); }
public ODFGenericControl(ODFForm ParentForm, XmlNode node): base(ParentForm, node) { }
public void StyleTest() { // Create a new document TextDocument document = new TextDocument(); document.New(); // Create a main paragraph Paragraph p =new Paragraph(document); ParagraphStyle ps1 = new ParagraphStyle(document, "style1"); ps1.Family = "paragraph"; ps1.TextProperties.FontName = FontFamilies.Arial; ps1.TextProperties.FontColor = AODL.Document.Helper.Colors.GetColor(System.Drawing.Color.Blue); ps1.TextProperties.Bold = "bold"; ps1.TextProperties.FontSize = "18pt"; document.Styles.Add(ps1); ParagraphStyle ps2 = new ParagraphStyle(document, "style2"); ps2.Family = "paragraph"; ps2.TextProperties.FontName = FontFamilies.CourierNew; ps2.TextProperties.Italic = "italic"; ps2.TextProperties.FontSize = "14pt"; ps2.TextProperties.Underline = "dotted"; document.Styles.Add(ps2); ParagraphStyle ps3 = new ParagraphStyle(document, "style3"); ps3.Family = "paragraph"; ps3.TextProperties.FontName = FontFamilies.Wingdings; ps3.TextProperties.FontColor = AODL.Document.Helper.Colors.GetColor(System.Drawing.Color.Red); ps3.TextProperties.FontSize = "16pt"; document.Styles.Add(ps3); // Create a main form ODFForm main_form = new ODFForm(document, "mainform"); main_form.Method = Method.Get; // The first button. It doesn't get a focus on click ODFButton butt = new ODFButton(main_form, p.Content, "butt1", "0cm", "0mm", "7cm", "1cm"); butt.TextStyle = ps1; butt.Label = "Button one"; butt.Title = "This button uses Arial font."; butt.FocusOnClick = XmlBoolean.False; butt.ButtonType = ButtonType.Push; main_form.Controls.Add (butt); // The second button. It is disabled butt = new ODFButton(main_form, p.Content, "butt2", "0cm", "2cm", "7cm", "1cm"); butt.Label = "Button two"; butt.Title = "Second button."; butt.FocusOnClick = XmlBoolean.True; butt.Disabled = XmlBoolean.True; butt.TextStyle = ps2; main_form.Controls.Add (butt); // The third button with "toggle" behaviour butt = new ODFButton(main_form, p.Content, "butt3", "0cm", "4cm", "7cm", "1cm"); butt.Label = "Button three"; butt.Title = "Third button."; butt.Toggle = XmlBoolean.True; butt.TextStyle = ps3; main_form.Controls.Add (butt); document.Forms.Add(main_form); document.Content.Add(p); document.SaveTo(AARunMeFirstAndOnce.outPutFolder+"style_test.odt"); document.Load(AARunMeFirstAndOnce.outPutFolder+"style_test.odt"); document.SaveTo(AARunMeFirstAndOnce.outPutFolder+"style_test2.odt"); }
public ODFFile(ODFForm ParentForm, XmlNode node): base(ParentForm, node) {}
public void FormsClearTest() { // Create a new document TextDocument document = new TextDocument(); document.New(); // Create a main paragraph Paragraph p =new Paragraph(document); p.TextContent.Add(new SimpleText(document, "This document should contain no forms!")); // Create a main form ODFForm main_form = new ODFForm(document, "mainform"); main_form.Method = Method.Get; // The first button. It doesn't get a focus on click ODFButton butt = new ODFButton(main_form, p.Content, "butt1", "0cm", "0mm", "4cm", "1cm"); butt.Label = "Button one"; butt.Title = "First button."; butt.FocusOnClick = XmlBoolean.False; butt.ButtonType = ButtonType.Push; main_form.Controls.Add (butt); // The second button. It is disabled butt = new ODFButton(main_form, p.Content, "butt2", "0cm", "2cm", "4cm", "1cm"); butt.Label = "Button two"; butt.Title = "Second button."; butt.FocusOnClick = XmlBoolean.True; butt.Disabled = XmlBoolean.True; main_form.Controls.Add (butt); // The third button with "toggle" behaviour butt = new ODFButton(main_form, p.Content, "butt3", "0cm", "4cm", "4cm", "1cm"); butt.Label = "Button three"; butt.Title = "Third button."; butt.Toggle = XmlBoolean.True; main_form.Controls.Add (butt); document.Forms.Add(main_form); document.Content.Add(p); // Clear all the forms within the document! document.Forms.Clear(); document.SaveTo(AARunMeFirstAndOnce.outPutFolder+"no_forms.odt"); }
public ODFHidden(ODFForm ParentForm, XmlNode node): base(ParentForm, node) {}
public ODFFixedText(ODFForm ParentForm, XmlNode node): base(ParentForm, node) {}
/// <summary> /// Creates an ODFRadioButton /// </summary> /// <param name="ParentForm">Parent form that the control belongs to</param> /// <param name="contentCollection">Collection of content where the control will be referenced</param> /// <param name="id">Control ID. Please specify a unique ID!</param> /// <param name="x">X coordinate of the control in ODF format (eg. "1cm", "15mm", 3.2cm" etc)</param> /// <param name="y">Y coordinate of the control in ODF format (eg. "1cm", "15mm", 3.2cm" etc)</param> /// <param name="width">Width of the control in ODF format (eg. "1cm", "15mm", 3.2cm" etc)</param> /// <param name="height">Height of the control in ODF format (eg. "1cm", "15mm", 3.2cm" etc)</param> public ODFRadioButton(ODFForm ParentForm, ContentCollection contentCollection, string id, string x, string y, string width, string height): base (ParentForm, contentCollection, id, x, y, width, height) {}
/// <summary> /// Creates an ODFGrid /// </summary> /// <param name="ParentForm">Parent form that the control belongs to</param> /// <param name="contentCollection">Collection of content where the control will be referenced</param> /// <param name="id">Control ID. Please specify a unique ID!</param> public ODFGrid(ODFForm ParentForm, ContentCollection contentCollection, string id): base (ParentForm, contentCollection, id) { _columns = new ODFGridColumnCollection(); RestoreColumnEvents(); }
/// <summary> /// Gets the form. /// </summary> /// <param name="formnode">The node of the form.</param> /// <returns></returns> private ODFForm CreateForm(XmlNode formnode) { ODFForm form = null; try { if (formnode.Name == "form:form") { if (this._debugMode) this.LogNode(formnode, "Log form node before"); //Create a new ODFForm ///////////TODO. Fix for child forms! form = new ODFForm(formnode.CloneNode(true), this._document); form.SuppressControlEvents(); foreach(XmlNode nodeChild in form.Node.ChildNodes) { switch (nodeChild.Name) { case "form:form": if (nodeChild.ParentNode==form.Node) { ODFForm frmchild = CreateForm(nodeChild); if (frmchild != null) { form.ChildForms.Add(frmchild); } form.Node.RemoveChild(nodeChild); } break; case "form:properties": break; case "form:button": if (nodeChild.ParentNode==form.Node) { ODFButton button = new ODFButton(form, nodeChild); button.FixPropertyCollection(); form.Controls.Add(button); } break; case "form:listbox": if (nodeChild.ParentNode==form.Node) { ODFListBox listbox = new ODFListBox(form, nodeChild); listbox.FixPropertyCollection(); listbox.FixOptionCollection(); form.Controls.Add(listbox); } break; case "form:combobox": if (nodeChild.ParentNode==form.Node) { ODFComboBox combobox = new ODFComboBox(form, nodeChild); combobox.FixPropertyCollection(); combobox.FixItemCollection(); form.Controls.Add(combobox); } break; case "form:textarea": if (nodeChild.ParentNode==form.Node) { ODFTextArea text = new ODFTextArea(form, nodeChild); text.FixPropertyCollection(); form.Controls.Add(text); } break; case "form:frame": if (nodeChild.ParentNode==form.Node) { ODFFrame frm = new ODFFrame(form, nodeChild); frm.FixPropertyCollection(); form.Controls.Add(frm); } break; case "form:file": if (nodeChild.ParentNode==form.Node) { ODFFile file = new ODFFile(form, nodeChild); file.FixPropertyCollection(); form.Controls.Add(file); } break; case "form:hidden": if (nodeChild.ParentNode==form.Node) { ODFHidden hidden = new ODFHidden(form, nodeChild); hidden.FixPropertyCollection(); form.Controls.Add(hidden); } break; case "form:checkbox": if (nodeChild.ParentNode==form.Node) { ODFCheckBox cb = new ODFCheckBox(form, nodeChild); cb.FixPropertyCollection(); form.Controls.Add(cb); } break; case "form:radio": if (nodeChild.ParentNode==form.Node) { ODFRadioButton rb = new ODFRadioButton(form, nodeChild); rb.FixPropertyCollection(); form.Controls.Add(rb); } break; case "form:formatted-text": if (nodeChild.ParentNode==form.Node) { ODFFormattedText text = new ODFFormattedText(form, nodeChild); text.FixPropertyCollection(); form.Controls.Add(text); } break; case "form:value-range": if (nodeChild.ParentNode==form.Node) { ODFValueRange vr = new ODFValueRange(form, nodeChild); vr.FixPropertyCollection(); form.Controls.Add(vr); } break; case "form:image": if (nodeChild.ParentNode==form.Node) { ODFImage img = new ODFImage(form, nodeChild); img.FixPropertyCollection(); form.Controls.Add(img); } break; case "form:image-frame": if (nodeChild.ParentNode==form.Node) { ODFImageFrame imgf = new ODFImageFrame(form, nodeChild); imgf.FixPropertyCollection(); form.Controls.Add(imgf); } break; case "form:grid": if (nodeChild.ParentNode==form.Node) { ODFGrid gr = new ODFGrid(form, nodeChild); gr.FixPropertyCollection(); gr.FixColumnCollection(); form.Controls.Add(gr); } break; default: if (nodeChild.ParentNode==form.Node) { ODFGenericControl gc = new ODFGenericControl(form, nodeChild); gc.FixPropertyCollection(); form.Controls.Add(gc); } break; } } form.RestoreControlEvents(); form.FixPropertyCollection(); // formnode.RemoveAll(); // formnode.InnerText = ""; } } catch(Exception ex) { throw new AODLException("Exception while processing a form:form node.", ex); } return form; }
/// <summary> /// Creates an ODFGrid /// </summary> /// <param name="ParentForm">Parent form that the control belongs to</param> /// <param name="contentCollection">Collection of content where the control will be referenced</param> /// <param name="id">Control ID. Please specify a unique ID!</param> /// <param name="x">X coordinate of the control in ODF format (eg. "1cm", "15mm", 3.2cm" etc)</param> /// <param name="y">Y coordinate of the control in ODF format (eg. "1cm", "15mm", 3.2cm" etc)</param> /// <param name="width">Width of the control in ODF format (eg. "1cm", "15mm", 3.2cm" etc)</param> /// <param name="height">Height of the control in ODF format (eg. "1cm", "15mm", 3.2cm" etc)</param> public ODFGrid(ODFForm ParentForm, ContentCollection contentCollection, string id, string x, string y, string width, string height): base (ParentForm, contentCollection, id, x, y, width, height) { _columns = new ODFGridColumnCollection(); RestoreColumnEvents(); }