/// <summary>Adds a collection of <see cref="ExcelPoolItem"/> object into the <see cref="ExcelPool"/>. /// </summary> /// <param name="tryCreateExcelPoolItem">A delegate for creating a collection of <see cref="ExcelPoolItem"/> objects via <paramref name="inputExcelDataQueries"/>.</param> /// <param name="inputExcelDataQueries">A collection of <see cref="IExcelDataQuery"/> objects used as input to construct a collection of <see cref="ExcelPoolItem"/> objects.</param> /// <returns>A <see cref="System.String"/> representation which contains a error message or the name of the object to insert together with some time stamp.</returns> public static IEnumerable <string> InsertObject(TryCreateExcelPoolItems tryCreateExcelPoolItem, IIdentifierStringDictionary <IExcelDataQuery> inputExcelDataQueries) { IEnumerable <ExcelPoolItem> values; string errorMessage; List <string> output = new List <string>(); if (tryCreateExcelPoolItem(inputExcelDataQueries, out values, out errorMessage) == false) { output.Add(errorMessage); } else { Add(values, output); } return(output); }
/// <summary>Initializes a new instance of the <see cref="ExcelPoolItemCreator"/> struct. /// </summary> /// <param name="excelPoolItemType">The type of the object to create in its <see cref="ExcelPoolItemType"/> representation.</param> /// <param name="excelPoolItemCreatingFunction">The creating function.</param> /// <exception cref="ArgumentNullException">Thrown, if one of the arguments is <c>null</c>.</exception> /// <remarks>Use the <see cref="ExcelPoolItemCreator.Initialize"/> event to store the <see cref="ExcelPoolItemCreator"/> instance.</remarks> public ExcelPoolItemCreator(ExcelPoolItemType excelPoolItemType, TryCreateExcelPoolItems excelPoolItemCreatingFunction) { if (excelPoolItemType == null) { throw new ArgumentNullException("excelPoolItemType"); } ObjectType = excelPoolItemType; if (excelPoolItemCreatingFunction == null) { throw new ArgumentNullException("excelPoolItemCreatingFunction"); } CreatingFunction = (IIdentifierStringDictionary <IExcelDataQuery> excelDataQueries, out IEnumerable <ExcelPoolItem> values, out string errorMessage) => { return(excelPoolItemCreatingFunction(excelDataQueries, out values, out errorMessage)); }; }