示例#1
0
        override protected void HandleStartElement(XmlNodeInformation nodeInfo)
        {
			m_bLastNodeWasStartATNode = false;
            if (nodeInfo.Is(NamespaceId.p, NormalizeString("sld")))
            {
                string sShow = nodeInfo.GetAttributeValue(NormalizeString("Show"));
                if(sShow == "0")
                    m_bHiddenSlide = true;
            }
            else if (nodeInfo.Is(NamespaceId.p, NormalizeString("sp")))
            {
                if (m_iPostItNoteCommentDepth == 0)
                {
                    m_iPostItNoteCommentDepth = nodeInfo.Depth;
                    m_listbShapeWithPostItNoteComment.Add(false);
                    ++m_iPostItNoteCommentIndex;
                }
            }
            else if (nodeInfo.Is(NamespaceId.p, NormalizeString("cNvPr")) &&
                     nodeInfo.GetAttributeValue("name").StartsWith("Comment "))
            {
                if (m_iPostItNoteCommentDepth > 0)
                    m_listbShapeWithPostItNoteComment[m_iPostItNoteCommentIndex] = true;
            }
			else if (nodeInfo.Is(NamespaceId.a, NormalizeString("t")))
			{
				m_bLastNodeWasStartATNode = true;
			}

            base.HandleStartElement(nodeInfo);
        }
示例#2
0
        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);
                }

            }

        }
        override protected void HandleStartElement(XmlNodeInformation nodeInfo)
        {
            if (nodeInfo.Is(NamespaceId.a, NormalizeString("br")))
                m_stateMachine.AddSeparationSpace();
            else if (nodeInfo.Is(NamespaceId.a, NormalizeString("pPr")))
            {
                if(nodeInfo.GetAttributeValue("eaLnBrk") == "1")
                    m_stateMachine.AddSeparationSpace();
            }
            else if (m_listbGraphicFrameHasOLEObject != null &&
                nodeInfo.Is(NamespaceId.p, NormalizeString("graphicFrame")))
            {
                if (m_iGraphicFrameDepth == 0)
                {
                    m_iGraphicFrameDepth = nodeInfo.Depth;
                    ++m_iGFHOOIndex;
                    m_bPreviousForceBlockStructure = ForceBlockStructure;
                    ForceBlockStructure = ShouldBlockThisGraphicFrame();

                    if (nodeInfo.EmptyElement)
                    {
                        System.Diagnostics.Debug.Assert(false);
// as well as being illogical for the algorithm an empty element would also break the written XML. Unless...
                        ForceBlockStructure = false;
                    }
                }
            }

            base.HandleStartElement(nodeInfo);
        }
示例#4
0
        override protected void HandleStartElement(XmlNodeInformation nodeInfo)
        {
            m_bLastNodeWasStartATNode = false;
            if (m_listbShapeWithPostItNoteComment != null &&
                nodeInfo.Is(NamespaceId.p, NormalizeString("sp")))
            {
                if (m_iPostItNoteCommentDepth == 0)
                {
                    m_iPostItNoteCommentDepth = nodeInfo.Depth;
                    ++m_iPostItNoteCommentIndex;
                    m_bPreviousForceBlockStructure = ForceBlockStructure;
                    ForceBlockStructure = ShouldBlockThisShape();

                    if (nodeInfo.EmptyElement)
                    {
                        System.Diagnostics.Debug.Assert(false);
                        // as well as being illogical for the algorithm an empty element would also break the written XML. Unless...
                        ForceBlockStructure = false;
                    }
                }
            }
            else if (nodeInfo.Is(NamespaceId.a, NormalizeString("t")))
            {
                m_bLastNodeWasStartATNode = true;
            }

            base.HandleStartElement(nodeInfo);
        }
 override protected void HandleStartElement(XmlNodeInformation nodeInfo)
 {
     if (nodeInfo.Is(NamespaceId.p, NormalizeString("sldId")))
     {
         string srId = nodeInfo.GetAttributeValue(NamespaceId.r, NormalizeString("id"));
         m_listSlideRelsInOrder.Add(srId);
     }
     base.HandleStartElement(nodeInfo);
 }
 override protected void HandleStartElement(XmlNodeInformation nodeInfo)
 {
     if (nodeInfo.Is(NamespaceId.p, NormalizeString("graphicFrame")))
     {
         if (m_iGraphicFrameDepth == 0)
         {
             m_iGraphicFrameDepth = nodeInfo.Depth;
             m_listbGraphicFrameHasOLEObject.Add(false);
             ++m_iGFHOOIndex;
         }
     }
     else if (nodeInfo.Is(NamespaceId.p, NormalizeString("oleObj")))
     {
         if (m_iGraphicFrameDepth > 0)
             m_listbGraphicFrameHasOLEObject[m_iGFHOOIndex] = true;
     }
     base.HandleStartElement(nodeInfo);
 }
示例#7
0
        override protected void HandleStartElement(XmlNodeInformation nodeInfo)
        {
            bool bEmptyElement = false;
            if (nodeInfo.Is(NamespaceId.p, NormalizeString("sld")))
            {
                bEmptyElement = nodeInfo.EmptyElement;
                ForceBlockStructure = ShouldRemoveThisSlideFromSlideList(nodeInfo);
            }

            base.HandleStartElement(nodeInfo);

            if (bEmptyElement)
                ForceBlockStructure = false;
        }
示例#8
0
        public List<TriggeringNodeDefinition> ExtractFiredTriggersFromTriggerList(XmlNodeInformation NodeInfo, IEnumerable<XmlNodeInformation> lookaheadEnum, List<TriggeringNodeDefinition> subSet, XmlFilterBase filter)
        {
            List<TriggeringNodeDefinition> results = new List<TriggeringNodeDefinition>();

            foreach (TriggeringNodeDefinition tnd in subSet)
            {
                if (tnd.nodeName == null && tnd.attributeFilter == null)
                    continue;  // safety net

                if (!NodeInfo.Is(tnd.namespaceId, tnd.nodeName))
                    continue;


                if (!tnd.attributeFilter.Matches(NodeInfo))
                    continue;

				Stack<bool> states;
                if (tnd.lookaheadFilter != null && lookaheadEnum != null)
                {
                    bool lookaheadSatisfied = tnd.lookaheadFilter.IsSatisfied(lookaheadEnum, filter);
                    if (!string.IsNullOrEmpty(tnd.LookAheadTrackingKey))
                    {
						if (!m_lookaheadStates.TryGetValue(tnd.LookAheadTrackingKey, out states))
						{
							states = new Stack<bool>();
							m_lookaheadStates.Add(tnd.LookAheadTrackingKey, states);
						}
                        states.Push(lookaheadSatisfied);
                    }
                    if (!lookaheadSatisfied)
                        continue;
                }
                else if (!string.IsNullOrEmpty(tnd.LookAheadTrackingKey))
                {
                    // depends on a lookahead value
                    if (!m_lookaheadStates.TryGetValue(tnd.LookAheadTrackingKey, out states))
                        continue;
					if (states.Count == 0)
                        continue;
					bool value = (tnd.PopsLookAheadValue ? states.Pop() : states.Peek());
                    if (!value)
                        continue;
                }

                results.Add(tnd);

            }
            return results;
        }
示例#9
0
        override protected void HandleStartElement(XmlNodeInformation nodeInfo)
        {
            if (m_bBuildLookupTable && nodeInfo.Is(NamespaceId.p, NormalizeString("cmAuthor")))
            {
                int iIndex = Int32.Parse(nodeInfo.GetAttributeValue( NormalizeString("id")));
                string sName = nodeInfo.GetAttributeValue( NormalizeString("name"));
                int iMaxCommentIndex = Int32.Parse(nodeInfo.GetAttributeValue( NormalizeString("lastidx")));

                AddAuthor(iIndex, sName, iMaxCommentIndex);
            }
            base.HandleStartElement(nodeInfo);
        }
示例#10
0
        private void ProcessNode(XmlNodeInformation xni)
        {
            if (xni.NodeType == NodeType.content)
            {
                if (inInstruction && !passedInstruction)
                    instructionText.Append(xni.ContentValue);

                if (passedInstruction && !inInstruction)
                    resultText.Append(xni.ContentValue);

                return;
            }

            if (!xni.IsInNamespace(NamespaceId.w))
                return; // not interested

            if (xni.Is(NamespaceId.w, "instrText"))
            {
                inInstruction = xni.NodeType == NodeType.start;
            }

            if (xni.Is(NamespaceId.w, "fldChar"))
            {
                ProcessFldChar(xni.GetAttributeValue("fldCharType"));
                passedInstruction = true;
            }
        }