/// <summary> /// Returns the sepcified list of table DCO objects if it is present in the document. /// <param name="page">DCO objects the corresponds to the current page that is being processed.</param> /// <param name="tableName">Name of the table of interest</param> /// <returns>The sepcified table DCO object if it is present in the page</returns> public List <IDCO> getTablesForDocument(IDCO document, string tableName) { Stopwatch sw = Stopwatch.StartNew(); List <IDCO> tables = new List <IDCO>(); for (int j = 0; j < document.NumOfChildren(); j++) { IDCO page = document.GetChild(j); if (page.ObjectType() == Constants.Page) { for (int i = 0; i < page.NumOfChildren(); i++) { IDCO field = page.GetChild(i); if (isObjectTable(field) && (field.ID == tableName)) { tables.Add(field); break; } } } } ExportCore.WriteDebugLog(" getTablesForDocument(" + document + "," + tableName + ")" + " completed in " + sw.ElapsedMilliseconds + " ms."); sw.Stop(); return(tables); }
/// <summary> /// Checks if a document contains a table. /// <param name="document">DCO objects the corresponds to the current document that is being processed.</param> /// <param name="tableName">Name of the table of interest</param> /// <returns>True if a page contains a table.</returns> public bool doesDocumentContainTable(IDCO document, string tableName) { Stopwatch sw = Stopwatch.StartNew(); bool docHasTable = false; for (int j = 0; j < document.NumOfChildren(); j++) { IDCO page = document.GetChild(j); if (page.ObjectType() == Constants.Page) { for (int i = 0; i < page.NumOfChildren(); i++) { IDCO field = page.GetChild(i); docHasTable = isObjectTable(field) && (field.ID == tableName); if (docHasTable) { break; } } } } ExportCore.WriteDebugLog(" doesDocumentContainsTable(" + document + "," + tableName + ")" + " completed in " + sw.ElapsedMilliseconds + " ms."); sw.Stop(); return(docHasTable); }
private void processTableRows(IDCO table, XmlNode tableNode) { // iterate over rows // print rows int i = rowStart; do { TDCOLib.DCO row = table.GetChild(i); if (row.ObjectType() == Constants.Field) { i++; Globals.Instance.SetData(Constants.forLoopString.CURRENTITERATIONDCO, row); XmlNode dataNode = tableNode.ChildNodes.Item(0); { if (dataNode.Name == Constants.NodeTypeString.SE_DATA) { dataElement.setIsTableColumn(true); dataElement.EvaluateData(dataNode); } } } Globals.Instance.SetData(Constants.forLoopString.CURRENTITERATIONDCO, Constants.EMPTYSTRING); } while (i < rowEnd); }
/// <summary> /// Returns the sepcified table DCO object if it is present in the page. /// <param name="page">DCO objects the corresponds to the current page that is being processed.</param> /// <param name="tableName">Name of the table of interest</param> /// <returns>The sepcified table DCO object if it is present in the page</returns> public IDCO getTableForPage(IDCO page, string tableName) { Stopwatch sw = Stopwatch.StartNew(); IDCO table = null; for (int i = 0; i < page.NumOfChildren(); i++) { IDCO field = page.GetChild(i); if (isObjectTable(field) && (field.ID == tableName)) { table = field; break; } } ExportCore.WriteDebugLog(" getTableForPage(" + page + "," + tableName + ")" + " completed in " + sw.ElapsedMilliseconds + " ms."); sw.Stop(); return(table); }
/// <summary> /// Checks if a page contains a table. /// <param name="page">DCO objects the corresponds to the current page that is being processed.</param> /// <param name="tableName">Name of the table of interest</param> /// <returns>True if a page contains a table.</returns> public bool doesPageContainTable(IDCO page, string tableName) { Stopwatch sw = Stopwatch.StartNew(); bool pageHasTable = false; for (int i = 0; i < page.NumOfChildren(); i++) { IDCO field = page.GetChild(i); pageHasTable = isObjectTable(field) && (field.ID == tableName); if (pageHasTable) { break; } } ExportCore.WriteDebugLog(" doesPageContainsTable(" + page + "," + tableName + ")" + " completed in " + sw.ElapsedMilliseconds + " ms."); sw.Stop(); return(pageHasTable); }