private void ProcessItem(DocObject dobj)
 {
     _counter.StartItem(dobj);
     if (dobj is Field)
     {
         ProcessContainer((dobj as Field).Instruction);
         ProcessContainer((dobj as Field).Result);
     }
     _counter.EndItem(dobj);
 }
 private void ProcessDocObject(DocObject item)
 {
     if (item is Change)
     {
         Change ch = item as Change;
         if (m_visitor.ShouldHighlightChange(ch))
         {
             SetHighlight(ch.Type);
             ProcessSubItems(ch);
             ClearHighlight();
         }
         else
         {
             if (IsInOriginal(ch.Type))
             {
                 ProcessSubItems(ch);
             }
         }
     }
     else if (item is Field || item is FieldInst || item is FieldResult)
     {
         m_fieldStateStack.Push(item.GetType());
         ProcessSubItems(item as DocObjectWithContent);
         m_fieldStateStack.Pop();
     }
     else if (item is HighlightedTextRun)
     {
         HighlightedTextRun tr = item as HighlightedTextRun;
         m_bSeenChange = true;
         m_bHighlight = true;
         AddTextToResult(tr.Content, tr.Font, tr.RTL, tr.Parent is Comment);
         m_bHighlight = false;
     }
     else if (item is TextRun)
     {
         TextRun tr = item as TextRun;
         AddTextToResult(tr.Content, tr.Font, tr.RTL, tr.Parent is Comment);
     }
     else if (item is ParaMarker)
     {
         ParaMarker pr = item as ParaMarker;
         if (pr.IsInsertedListItem)
             SetHighlight(ChangeType.Insertion);
         if (!string.IsNullOrEmpty(pr.ListNumber))
             AddTextToResult(pr.ListNumber, "", false, pr.Parent is Comment);
         if (pr.IsInsertedListItem)
             ClearHighlight();
     }
     else if (item is Pict)
     {
         if (m_visitor.WantsTextForImages)
             AddTextToResult("[Picture]", "", false, item.Parent is Comment);
     }
 }
        bool IsContextExcluded(DocObject docObj)
        {
            if (m_excludedContexts.Contains(docObj.GetType()))
                return true;

            return false;

        }
        private bool ProcessItem(DocObject docObject)
        {
            if (IsStopObject(docObject))
            {
                if (_seenTarget)
                    return false;

                _si.Content.Clear();
            }

            if (docObject is Change)
            {
                Change ch = docObject as Change;
                if (ShouldProcess(ch))
                    return ProcessCollection(ch, 0);

                return true;
            }
            else if (docObject is DocObjectWithContent)
            {
                DocObjectWithContent dowc = docObject as DocObjectWithContent;
                return ProcessCollection(dowc, 0);
            }
            else if (docObject is TextRun)
            {
                if (object.Equals(docObject, _location.TargetObject))
                {
                    _seenTarget = true;
                    AddTargetObject(docObject as TextRun);
                }
                else if (_charsToGrab > 0)
                {
                    AddFollowOnTarget(docObject as TextRun);
                }
                else
                {
                    _si.Content.Add(docObject);
                }
            }

            return true;
        }
 private bool IsStopObject(DocObject docObject)
 {
     return docObject is ParaMarker || SummaryItemBuilder.StartsNewContext(docObject);
 }
Example #6
0
 internal void AddContent(DocObject newContent)
 {
     Content.Add(newContent);
 }