public void addProcessVar(ProcessVar pv) { processVarList.Add(pv); }
private bool processOneRowLayoutTable(XElement rowElem) { var cells = rowElem.Elements(w + "tc"); if (cells.Count() != Constants.ElancoDocConstants.NumCellsInLayoutTableRow) { Console.WriteLine("ERROR - parsing layout table row, num cells: {0:D}", cells.Count()); return(false); } string trimmedContent; int columnCounter = 1; foreach (var cell in cells) { trimmedContent = XUtils.WordProcessingMLUtils.getParagraphTextFromCell(cell); if (columnCounter == 1) { if (trimmedContent.Length > 0) { Operation newOp = new Operation(trimmedContent); operationList.Add(newOp); currentOp = newOp; } } else if (columnCounter == 2) { if (trimmedContent.Length > 0) { Phase newPhase = new Phase(trimmedContent); currentOp.addPhase(newPhase); currentPhase = newPhase; } } else if (columnCounter == 3) { if (trimmedContent.Length > 0) { if (trimmedContent.Substring(0, Constants.ElancoDocConstants.ProcessVarSkipName.Length) .Equals(Constants.ElancoDocConstants.ProcessVarSkipName)) { // don't process - (this is admittedly hackish) } else { // here is where we can add a reference for later adding a Units field to ProcessVar ProcessVar newProcessVar = new ProcessVar(trimmedContent); currentPhase.addProcessVar(newProcessVar); } } } else { // at this time we don't care about other columns // TODO: (maybe) grab the units and associate them // with the Process variables break; } columnCounter++; } return(true); }