protected override void HandleStartElement(XmlNodeInformation nodeInfo) { if (nodeInfo.Is(NamespaceId.w, NormalizedVersion("style"))) { Style newStyle = new Style(nodeInfo); newStyle.StyleType = nodeInfo.GetAttributeValue(NormalizedVersion("type")); m_styles.Add(newStyle.Id, newStyle); m_activeStyle = newStyle; m_bSendAllToActiveStyle = false; } else if (nodeInfo.Is(NamespaceId.w, NormalizedVersion("basedOn"))) { m_activeStyle.BasedOn = nodeInfo.GetAttributeValue(NormalizedVersion("val")); } else if (nodeInfo.Is(NamespaceId.w, NormalizedVersion("name"))) { m_activeStyle.Name = nodeInfo.GetAttributeValue(NormalizedVersion("val")); } else if (nodeInfo.Is(NamespaceId.w, NormalizedVersion("rPr"))) { m_bSendAllToActiveStyle = true; } else if (m_bSendAllToActiveStyle) { if (m_activeStyle != null) { nodeInfo.GetAttributes(); // force them to be loaded m_activeStyle.AddProperty(nodeInfo); } } }
private void HandleTableInfo(XmlNodeInformation nodeInfo) { List<AttribDetails> listOfAttribDetails = (List<AttribDetails>)nodeInfo.GetAttributes(); foreach (AttribDetails aDetails in listOfAttribDetails) { if (aDetails.localName == "name") { m_tableData.Name = aDetails.value; } else if (aDetails.localName == "ref") { m_tableData.CellRefs = aDetails.value; } else if (aDetails.localName == "totalsRowShown" || aDetails.localName == "totalsRowCount") { m_tableData.SetShowTotalsRow(aDetails.value); } else if (aDetails.localName == "id") { m_tableData.Id = aDetails.value; } else if (aDetails.localName == "headerRowCount") { m_tableData.SetShowHeaderRow(aDetails.value); } } }
public virtual bool Matches(XmlNodeInformation xni) { foreach (AttribDetails ad in xni.GetAttributes()) { if (Matches(ad)) return true; } return false; }
override protected void HandleStartElement(XmlNodeInformation nodeInfo) { if (nodeInfo.NodeName == "clrScheme") { m_inColourSchemes = true; return; } if (m_inColourSchemes) { var colours = m_DiagramHelper.SchemeColours; if (nodeInfo.NodeName != "sysClr" && nodeInfo.NodeName != "srgbClr") { // Set current schema and make sure it has a colour m_currentSchemeName = nodeInfo.NodeName; if (!colours.ContainsKey(nodeInfo.NodeName)) { colours[m_currentSchemeName] = new SchemeColour(); } } else if (colours.ContainsKey(m_currentSchemeName)) { // Replace current schema colour with the new colour SchemeColour sColour = new SchemeColour(); List<AttribDetails> listOfAttribDetails = (List<AttribDetails>)nodeInfo.GetAttributes(); foreach (AttribDetails aDetails in listOfAttribDetails) { if (aDetails.localName == "val") { sColour.m_value = aDetails.value; } else if (aDetails.localName == "lastClr") { sColour.m_lastColour = aDetails.value; } } colours[m_currentSchemeName] = sColour; } } }
private void ResolveTextSize(XmlNodeInformation nodeInfo) { List<AttribDetails> listOfAttribDetails = (List<AttribDetails>)nodeInfo.GetAttributes(); string currentSize = "10000"; foreach (AttribDetails aDetails in listOfAttribDetails) { if (aDetails.localName == "sz") { currentSize = aDetails.value; } } decimal size = decimal.Parse(currentSize); if (size <= 800) { m_stateTracker.InSmallText = true; } }
override protected void HandleStartElement(XmlNodeInformation nodeInfo) { if (IsCleaning && (HiddenText || m_wholeStringStateIsSmallText || m_wholeStringStateIsRedactedText)) return; //please note that at the moment we are ignoring the count and uniquecount attributes of the sst node //even if we clean out some si content it does not currently appear to cause any problems and would //be problematic to alter #region switch(nodeInfo.NodeName) switch (nodeInfo.NodeName) { case "si": { m_stringBuilder = new StringBuilder(); m_currentStringIndex++; if (!ShouldWriteOut_si()) return; break; } case "r": { if (IsCleaning) { HandleRichTextRun(nodeInfo); return; } break; } case "color": { HandleColorElement(nodeInfo); break; } case "sz": { HandleSizeElement(nodeInfo); break; } case "t": { if (m_partialStringStateIsWhiteText || m_partialStringStateIsSmallText) { m_addText = false; return; } break; } } #endregion if (m_richTextRun.Count > 0) { NodeData nData = new NodeData(); nData.m_nodeType = NodeType.start; nodeInfo.GetAttributes();//make sure they have all been read before we store it nData.m_NodeInfo = nodeInfo; m_richTextRun.Add(nData); return; } base.HandleStartElement(nodeInfo); }
private void HandleTableStyleInfo(XmlNodeInformation nodeInfo) { List<AttribDetails> listOfAttribDetails = (List<AttribDetails>)nodeInfo.GetAttributes(); foreach (AttribDetails aDetails in listOfAttribDetails) { if (aDetails.localName == "name") { m_tableData.StyleName = aDetails.value; } else if (aDetails.localName == "showFirstColumn") { m_tableData.SetShowFirstColumn(aDetails.value); } else if (aDetails.localName == "showLastColumn") { m_tableData.SetShowLastColumn(aDetails.value); } else if (aDetails.localName == "showRowStripes") { m_tableData.SetShowRowStripes(aDetails.value); } else if (aDetails.localName == "showColumnStripes") { m_tableData.SetShowColumnStripes(aDetails.value); } } }