/// <summary>Handles the Click event of the bCreateObject control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void bCreateObject_Click(object sender, EventArgs e) { SimpleDataObject simpleDataObject = new SimpleDataObject(); InfoOutput infoOutput = new InfoOutput(); simpleDataObject.FillInfoOutput(infoOutput); InfoOutputPackage generalPackage = infoOutput.GetGeneralPackage(); InfoOutputParentChildDataTable parentChildDataTable = generalPackage.GetParentChildDataTable("ParentTable"); InitializeDataGridViews(parentChildDataTable); }
/// <summary>Gets informations of the current object as a specific <see cref="InfoOutput"/> instance. /// </summary> /// <param name="infoOutput">The <see cref="InfoOutput"/> object which is to be filled with informations concering the current instance.</param> /// <param name="categoryName">The name of the category, i.e. all informations will be added to these category.</param> public void FillInfoOutput(InfoOutput infoOutput, string categoryName = InfoOutput.GeneralCategoryName) { /* creates two simple data tables: */ DataTable parentDataTable = new DataTable("ParentTable"); parentDataTable.Columns.Add("Name", typeof(String)); DataColumn masterColumn = new DataColumn("ID") { DataType = typeof(int) }; parentDataTable.Columns.Add(masterColumn); masterColumn.ColumnMapping = MappingType.Hidden; DataTable childDataTable = new DataTable("ChildTable"); childDataTable.Columns.Add("Value", typeof(DateTime)); DataColumn slaveColumn = new DataColumn("ID") { DataType = typeof(int) }; childDataTable.Columns.Add(slaveColumn); slaveColumn.ColumnMapping = MappingType.Hidden; /* add some simple data: */ parentDataTable.Rows.Add("The child should show exactly 2 dates", 4); parentDataTable.Rows.Add("Exactly 1 date", 7); childDataTable.Rows.Add(new DateTime(2010, 10, 24), 4); childDataTable.Rows.Add(new DateTime(2012, 5, 15), 4); childDataTable.Rows.Add(new DateTime(1998, 2, 8), 7); /* store the parent-child data table in the package: */ InfoOutputParentChildDataTable parentChildDataTable = new InfoOutputParentChildDataTable(parentDataTable, childDataTable, masterColumn, slaveColumn); InfoOutputPackage package = infoOutput.AcquirePackage(categoryName); package.Add(parentChildDataTable); }
public void SetUp() { m_InfoOutput = new InfoOutput(); }