#if MSCHART using FastReport.MSChart; #endif using FastReport.Map; using FastReport.Dialog; namespace FastReport.Import { /// /// The components factory. /// public static partial class ComponentsFactory { #region Objects /// /// Creates a RichObject instance with specified name and parent. /// /// The name of the RichObject instance. /// The parent of the RichObject instance. /// The RichObject instance. public static RichObject CreateRichObject(string name, Base parent) { RichObject rich = new RichObject(); rich.Name = name; rich.Parent = parent; return rich; } /// /// Creates a SVGObject instance with specified name and parent. /// /// The name of the SVGObject instance. /// The parent of the SVGObject instance. /// The SVGObject instance. public static SVG.SVGObject CreateSVGObject(string name, Base parent) { SVG.SVGObject picture = new SVG.SVGObject(); picture.Name = name; if ((parent as IParent).CanContain(picture)) picture.Parent = parent; return picture; } /// /// Creates a AdvMatrixObject instance with specified name and parent. /// /// The name of the AdvMatrixObject instance. /// The parent of the AdvMatrixObject instance. /// The AdvMatrixObject instance. public static AdvMatrix.AdvMatrixObject CreateAdvMatrixObject(string name, Base parent) { AdvMatrix.AdvMatrixObject matrix = new AdvMatrix.AdvMatrixObject(); matrix.Name = name; if ((parent as IParent).CanContain(matrix)) matrix.Parent = parent; return matrix; } #if MSCHART /// /// Creates a MSChartObject instance with specified name and parent. /// /// The name of the MSChartObject instance. /// The parent of the MSChartObject instance. /// The MSChartObject instance. public static MSChartObject CreateMSChartObject(string name, Base parent) { MSChartObject chart = new MSChartObject(); chart.Name = name; chart.Parent = parent; return chart; } /// /// Creates a SparklineObject instance with specified name and parent. /// /// The name of the SparlineObject instance. /// The parent of the SparlineObject instance. /// public static SparklineObject CreateSparklineObject(string name, Base parent) { SparklineObject sparkline = new SparklineObject(); sparkline.Name = name; sparkline.Parent = parent; return sparkline; } #endif /// /// Creates a MapObject instance with specified name and parent. /// /// The name of the MapObject instance. /// The parent of the MapObject instance. /// The MapObject instance. public static MapObject CreateMapObject(string name, Base parent) { MapObject map = new MapObject(); map.Name = name; map.Parent = parent; return map; } #endregion // Objects #if !FRCORE #region DialogObjects /// /// Creates a DialogPage instance in the specified Report. /// /// The Report instance. /// The DialogPage instance. public static Dialog.DialogPage CreateDialogPage(Report report) { Dialog.DialogPage page = new Dialog.DialogPage(); report.Pages.Add(page); page.CreateUniqueName(); return page; } /// /// Creates a TextBoxControl instance with specified name and parent. /// /// The name of the TextBoxControl instance. /// The parent of the TextBoxControl instance. /// The TextBoxControl instance. public static TextBoxControl CreateTextBoxControl(string name, Base parent) { TextBoxControl textBox = new TextBoxControl(); textBox.Name = name; if ((parent as IParent).CanContain(textBox)) textBox.Parent = parent; return textBox; } /// /// Creates a LabelControl instance with specified name and parent. /// /// The name of the LabelControl instance. /// The parent of the LabelControl instance. /// The LabelControl instance. public static LabelControl CreateLabelControl(string name, Base parent) { LabelControl labelControl = new LabelControl(); labelControl.Name = name; if ((parent as IParent).CanContain(labelControl)) labelControl.Parent = parent; return labelControl; } /// /// Creates a RadioButtonControl instance with specified name and parent. /// /// The name of the RadioButtonControl instance. /// The parent of the RadioButtonControl instance. /// The RadioButtonControl instance. public static RadioButtonControl CreateRadioButtonControl(string name, Base parent) { RadioButtonControl radioButtonControl = new RadioButtonControl(); radioButtonControl.Name = name; if ((parent as IParent).CanContain(radioButtonControl)) radioButtonControl.Parent = parent; return radioButtonControl; } /// /// Creates a DateTimePickerControl instance with specified name and parent. /// /// The name of the DateTimePickerControl instance. /// The parent of the DateTimePickerControl instance. /// The DateTimePickerControl instance. public static DateTimePickerControl CreateDateTimePickerControl(string name, Base parent) { DateTimePickerControl dateTimePickerControl = new DateTimePickerControl(); dateTimePickerControl.Name = name; if ((parent as IParent).CanContain(dateTimePickerControl)) dateTimePickerControl.Parent = parent; return dateTimePickerControl; } /// /// Creates a GridControl instance with specified name and parent. /// /// The name of the GridControl instance. /// The parent of the GridControl instance. /// The GridControl instance. public static GridControl CreateGridControl(string name, Base parent) { GridControl gridControl = new GridControl(); gridControl.Name = name; if ((parent as IParent).CanContain(gridControl)) gridControl.Parent = parent; return gridControl; } /// /// Creates a GroupBoxControl instance with specified name and parent. /// /// The name of the GroupBoxControl instance. /// The parent of the GroupBoxControl instance. /// The GroupBoxControl instance. public static GroupBoxControl CreateGroupBoxControl(string name, Base parent) { GroupBoxControl gridControl = new GroupBoxControl(); gridControl.Name = name; if ((parent as IParent).CanContain(gridControl)) gridControl.Parent = parent; return gridControl; } /// /// Creates a ButtonControl instance with specified name and parent. /// /// The name of the ButtonControl instance. /// The parent of the ButtonControl instance. /// The ButtonControl instance. public static ButtonControl CreateButtonControl(string name, Base parent) { ButtonControl buttonControl = new ButtonControl(); buttonControl.Name = name; if ((parent as IParent).CanContain(buttonControl)) buttonControl.Parent = parent; return buttonControl; } /// /// Creates a CheckBoxControl instance with specified name and parent. /// /// The name of the CheckBoxControl instance. /// The parent of the CheckBoxControl instance. /// The CheckBoxControl instance. public static CheckBoxControl CreateCheckBoxControl(string name, Base parent) { CheckBoxControl checkBoxControl = new CheckBoxControl(); checkBoxControl.Name = name; if ((parent as IParent).CanContain(checkBoxControl)) checkBoxControl.Parent = parent; return checkBoxControl; } /// /// Creates a CheckedListBoxControl instance with specified name and parent. /// /// The name of the CheckedListBoxControl instance. /// The parent of the CheckedListBoxControl instance. /// The CheckedListBoxControl instance. public static CheckedListBoxControl CreateCheckedListBoxControl(string name, Base parent) { CheckedListBoxControl checkedListBoxControl = new CheckedListBoxControl(); checkedListBoxControl.Name = name; if ((parent as IParent).CanContain(checkedListBoxControl)) checkedListBoxControl.Parent = parent; return checkedListBoxControl; } /// /// Creates a ListBoxControl instance with specified name and parent. /// /// The name of the ListBoxControl instance. /// The parent of the ListBoxControl instance. /// The ListBoxControl instance. public static ListBoxControl CreateListBoxControl(string name, Base parent) { ListBoxControl listBoxControl = new ListBoxControl(); listBoxControl.Name = name; if ((parent as IParent).CanContain(listBoxControl)) listBoxControl.Parent = parent; return listBoxControl; } /// /// Creates a PanelControl instance with specified name and parent. /// /// The name of the PanelControl instance. /// The parent of the PanelControl instance. /// The PanelControl instance. public static PanelControl CreatePanelControl(string name, Base parent) { PanelControl panelControl = new PanelControl(); panelControl.Name = name; if ((parent as IParent).CanContain(panelControl)) panelControl.Parent = parent; return panelControl; } /// /// Creates a ComboBoxControl instance with specified name and parent. /// /// The name of the ComboBoxControl instance. /// The parent of the ComboBoxControl instance. /// The ComboBoxControl instance. public static ComboBoxControl CreateComboBoxControl(string name, Base parent) { ComboBoxControl comboBoxControl = new ComboBoxControl(); comboBoxControl.Name = name; if ((parent as IParent).CanContain(comboBoxControl)) comboBoxControl.Parent = parent; return comboBoxControl; } /// /// Creates a NumericUpDownControl instance with specified name and parent. /// /// The name of the NumericUpDownControl instance. /// The parent of the NumericUpDownControl instance. /// The NumericUpDownControl instance. public static NumericUpDownControl CreateNumericUpDownControl(string name, Base parent) { NumericUpDownControl numericUpDownControl = new NumericUpDownControl(); numericUpDownControl.Name = name; if ((parent as IParent).CanContain(numericUpDownControl)) numericUpDownControl.Parent = parent; return numericUpDownControl; } /// /// Creates a PictureBoxControl instance with specified name and parent. /// /// The name of the PictureBoxControl instance. /// The parent of the PictureBoxControl instance. /// The PictureBoxControl instance. public static PictureBoxControl CreatePictureBoxControl(string name, Base parent) { PictureBoxControl pictureBoxControl = new PictureBoxControl(); pictureBoxControl.Name = name; if ((parent as IParent).CanContain(pictureBoxControl)) pictureBoxControl.Parent = parent; return pictureBoxControl; } /// /// Creates a ListViewControl instance with specified name and parent. /// /// The name of the ListViewControl instance. /// The parent of the ListViewControl instance. /// The ListViewControl instance. public static ListViewControl CreateListViewControl(string name, Base parent) { ListViewControl listViewControl = new ListViewControl(); listViewControl.Name = name; if ((parent as IParent).CanContain(listViewControl)) listViewControl.Parent = parent; return listViewControl; } /// /// Creates a RichTextBoxControl instance with specified name and parent. /// /// The name of the RichTextBoxControl instance. /// The parent of the RichTextBoxControl instance. /// The RichTextBoxControl instance. public static RichTextBoxControl CreateRichTextBoxControl(string name, Base parent) { RichTextBoxControl richTextBoxControl = new RichTextBoxControl(); richTextBoxControl.Name = name; if ((parent as IParent).CanContain(richTextBoxControl)) richTextBoxControl.Parent = parent; return richTextBoxControl; } /// /// Creates a TreeViewControl instance with specified name and parent. /// /// The name of the TreeViewControl instance. /// The parent of the TreeViewControl instance. /// The TreeViewControl instance. public static TreeViewControl CreateTreeViewControl(string name, Base parent) { TreeViewControl treeViewControl = new TreeViewControl(); treeViewControl.Name = name; if ((parent as IParent).CanContain(treeViewControl)) treeViewControl.Parent = parent; return treeViewControl; } #endregion #endif } }