private static string DumpNode(IAbstractTextNode iAbstractTextNode) { StringBuilder bld = new StringBuilder(); for (int i = 0; i < iAbstractTextNode.GetInfoCount(); i++) { bld.Append(DumpInfo(iAbstractTextNode.GetInfo(i))); } bld.AppendLine(); return bld.ToString(); }
/// ------------------------------------------------------------------- static private string _nodeValueFromName(IAbstractTextNode textNode, string infoName) { List<NodeInfo> nodeInfoList = textNode.GetInfo(infoName); string nodeValue = ""; if (nodeInfoList.Count > 0) { NodeInfo nodeInfo = nodeInfoList[0]; nodeValue = (nodeInfo != null) ? nodeInfo.value : ""; } return EscapeXML(nodeValue); }
private bool CheckTrackChangeNode(IAbstractTextNode tn, string changeText, string changeType) { if (tn.GetInfo("Content").Count == 0) return false; NodeInfo ni = tn.GetInfo("Content")[0]; if (ni.value != changeText) return false; ni = tn.GetInfo("Type")[0]; if (ni.value != changeType) return false; return true; }
private void SetContentType(IAbstractTextNode iChild) {//if the cell is in a deleted column/row then that should override its type NodeInfo nAction = iChild.GetInfo("ContentType")[0]; switch(m_currentRevisionType) { case RowColRevisionType.deleteCol: case RowColRevisionType.deleteRow: nAction.value = "Deletion"; break; case RowColRevisionType.insertCol: case RowColRevisionType.insertRow: nAction.value = "Insertion"; break; } }
private bool TestForContent(IAbstractTextNode node, string testContentValue, bool shouldFindValue) { string actualContentValue = node.GetInfo("Content")[0].value; if (actualContentValue == testContentValue) { if (shouldFindValue) return true; return false; } if (shouldFindValue) return false; return true; }
private void ProcessChildNode(IAbstractTextNode iChild) { NodeInfo processed = iChild.GetInfo("Processed")[0]; if (processed.value == "false") { bool setPath = false; NodeInfo name = iChild.GetInfo("RefName")[0]; if (m_currentOleItemNames.Contains(name.value)) { NodeInfo id = iChild.GetInfo("ProgId")[0]; id.value = m_currentLinkProgId; setPath = true; } else { string currentExternalLinkIndex = XlsxParsingUtilities.GetExternalLinkIndex(m_targetName); NodeInfo index = iChild.GetInfo("RefIndex")[0]; NodeInfo id = iChild.GetInfo("ProgId")[0]; if (index.value == currentExternalLinkIndex) { if (m_currentLinkProgId == "Document" || id.value == m_currentLinkProgId) setPath = true; } } if (setPath) { NodeInfo path = iChild.GetInfo("Path")[0]; path.value = m_currentLinkTargetPath; processed.value = "true"; } } }
private bool CheckTrackChangeOK(IAbstractTextNode textNode, string text, string author, string type) { Assert.AreEqual(text, textNode.GetInfo("Content")[0].value); Assert.AreEqual(author, textNode.GetInfo("Author")[0].value); Assert.AreEqual(type, textNode.GetInfo("Type")[0].value); return true; }
private bool IsAllWhiteSpace(IAbstractTextNode tn) { for (int i = 0; i < tn.GetInfoCount(); i++) { if (!IsAllWhiteSpace(tn.GetInfo(i).value)) return false; } return true; }
private bool IsEmbeddingOrEmpty(IAbstractTextNode iAbstractTextNode) { string sContent = iAbstractTextNode.GetInfo("Content")[0].value.Trim(); if (sContent.Length == 0) return true; return sContent.StartsWith("EMBED"); }