示例#1
0
        internal static DocObject ConstructNewContentHandler(string nodeLocalName, DocObjectWithContent parent)
        {
            switch (nodeLocalName)
            {
                case ParaMarker.nodeName:
                    return new ParaMarker(parent);
                case Change.nodeName:
                    return new Change(parent);
                case TextRun.nodeName:
                    return new TextRun(parent);
                case Field.nodeName:
                    return new Field(parent);
                case FootNote.nodeName:
                    return new FootNote(parent);
                case EndNote.nodeName:
                    return new EndNote(parent);
                case Table.nodeName:
                    return new Table(parent);
                case Bookmark.nodeName:
                    return new Bookmark(parent);
                case Pict.nodeName:
                    return new Pict(parent);
                case Blob.nodeName:
                    return new Blob(parent);
                case Shape.nodeName:
                    return new Shape(parent);
                case Textbox.nodeName:
                    return new Textbox(parent);
                case Comment.nodeName:
                    return new Comment(parent);

                default:
                    return null;
            }
        }
        private bool ProcessCollection(DocObjectWithContent dowc, int startIndex)
        {
            for (int i = startIndex; i < dowc.Content.Count; i++)
            {
                if (!ProcessItem(dowc.Content[i]))
                    return false;
            }

            return true;
        }
 private void ProcessContainer(DocObjectWithContent dowc)
 {
     _counter.StartItem(dowc);
     foreach (DocObject dobj in dowc.Content)
     {
         dobj.RedlineCharPos = _counter.CurrentPosition;
         if (dobj is DocObjectWithContent)
         {
             ProcessContainer(dobj as DocObjectWithContent);
         }
         else
         {
             ProcessItem(dobj);
         }
     }
     _counter.EndItem(dowc);
 }
示例#4
0
        public Shape(DocObjectWithContent parent)
            : base(parent)
        {

        }
 private void ProcessSubItems(DocObjectWithContent docObjectWithContent)
 {
     foreach (DocObject item in docObjectWithContent.Content)
     {
         ProcessDocObject(item);
     }
 }
示例#6
0
 private bool? FindRTLInSubObjects(DocObjectWithContent dowc)
 {
     foreach (DocObject dobj in dowc.Content)
     {
         if (dobj is TextRun)
         {
             m_bRightToLeft = (dobj as TextRun).RTL;
         }
         else if (dobj is DocObjectWithContent)
         {
             m_bRightToLeft = FindRTLInSubObjects(dobj as DocObjectWithContent);
         }
         if (m_bRightToLeft.HasValue)
             return m_bRightToLeft.Value;
     }
     return null;
 }
 protected DocObjectWithContent(DocObjectWithContent parent)
     : base(parent)
 {
 }
示例#8
0
 public Section(DocObjectWithContent parent)
     : base(parent)
 {
 }
 private string GetText(DocObjectWithContent dowc)
 {
     StringBuilder bld = new StringBuilder();
     dowc.GetInnerText(bld);
     return bld.ToString();
 }
示例#10
0
        public Change(DocObjectWithContent parent)
            : base(parent)
        {

        }
示例#11
0
 public ChangeableStructure(DocObjectWithContent parent) : base (parent)
 {
     
 }
示例#12
0
 public ParaMarker(DocObjectWithContent parent)
     : base(parent)
 {
 }
示例#13
0
 protected DocObject(DocObjectWithContent parent)
 {
     Parent = parent;
     _isFirst = true;
 }
示例#14
0
 public FieldInst(DocObjectWithContent parent)
     : base(parent)
 {
 }
示例#15
0
文件: Row.cs 项目: killbug2004/WSProf
        public Row(DocObjectWithContent parent)
            : base(parent)
        {

        }
示例#16
0
        public Pict(DocObjectWithContent parent)
            : base(parent)
        {

        }
示例#17
0
        private void ProcessCollection(DocObjectWithContent dowc, bool passTextToStateMachine)
        {
            if (SummaryItemBuilder.StartsNewContext(dowc))
                DispatchContextChangeChar();

            _location.PushCollection(dowc);

            if (SummaryItemBuilder.StartsNewContext(dowc))
                ResetAndDispatchContextChangeChar();


            foreach (DocObject dobj in dowc.Content)
            {
                if (ContextExcluder != null && ContextExcluder(dobj))
                {
                    _location.IncrementChildCount();
                    continue;
                }

                if (dobj is Change)
                {
                    Change ch = dobj as Change;
                    if (ChangeTypeSelector == null || ChangeTypeSelector(ch.Type))
                    {
                        ProcessCollection(ch, passTextToStateMachine);
                    }
                    else
                    {
                        ProcessCollection(ch, false);
                    }
                }
                else if (dobj is DocObjectWithContent)
                {
                    ProcessCollection(dobj as DocObjectWithContent, passTextToStateMachine);
                }
                else if (dobj is TextRun)
                {
                    if (passTextToStateMachine)
                    {
                        ProcessText(dobj as TextRun);
                    }
                    else
                    {
                        _location.RedlineCharPos += (dobj as TextRun).Content.Length;
                    }
                }
                else if (dobj is ParaMarker)
                {
                    HandleChar('\r');
                    _location.RedlineCharPos--;
                }
                else
                {
                    Reset();
                }
                _location.IncrementChildCount();
            }

            if (SummaryItemBuilder.StartsNewContext(dowc))
                DispatchContextChangeChar();

            _location.PopCollection();

            if (SummaryItemBuilder.StartsNewContext(dowc))
                ResetAndDispatchContextChangeChar();

        }
示例#18
0
        public Bookmark(DocObjectWithContent parent)
            : base(parent)
        {

        }
示例#19
0
        public Comment(DocObjectWithContent parent)
            : base(parent)
        {

        }
示例#20
0
        public EndNote(DocObjectWithContent parent)
            : base(parent)
        {

        }
示例#21
0
 public FieldResult(DocObjectWithContent parent)
     : base(parent)
 {
 }
示例#22
0
 public HighlightedTextRun(DocObjectWithContent parent)
     : base(parent)
 {
 }
示例#23
0
        public Textbox(DocObjectWithContent parent)
            : base(parent)
        {

        }
示例#24
0
        public FootNote(DocObjectWithContent parent)
            : base(parent)
        {

        }
 private void AddContentToSummaryItem(DocObjectWithContent dowc, int index)
 {
     ProcessCollection(dowc, index);
 }
示例#26
0
        public Blob(DocObjectWithContent parent)
            : base(parent)
        {

        }
示例#27
0
        public HeaderFooter(DocObjectWithContent parent)
            : base(parent)
        {

        }
示例#28
0
 public Table(DocObjectWithContent parent)
     : base(parent)
 {
 }