Example #1
0
        private void method_70(Paragraph A_0, string A_1)
        {
            TextRange range;
            int       num = 15;

            if (this.RightAlignPageNumbers)
            {
                A_0.Format.Tabs.AddTab(this.method_71(A_0), TabJustification.Right, TabLeader.Dotted);
                range = new TextRange(base.Document)
                {
                    Text = BookmarkStart.b("㰴", num)
                };
                A_0.Items.Insert(A_0.Items.Count - 1, range);
            }
            Field entity = new Field(base.Document)
            {
                Type         = FieldType.FieldPageRef,
                Code         = BookmarkStart.b("攴瘶縸縺漼稾݀捂", num) + A_1 + BookmarkStart.b("ᔴ欶儸", num),
                m_fieldValue = A_1 + BookmarkStart.b("ᔴ欶儸", num)
            };

            A_0.Items.Insert(A_0.Items.Count - 1, entity);
            FieldMark mark = new FieldMark(base.Document, FieldMarkType.FieldSeparator);

            A_0.Items.Insert(A_0.Items.Count - 1, mark);
            range = new TextRange(base.Document);
            A_0.Items.Insert(A_0.Items.Count - 1, range);
            mark = new FieldMark(base.Document, FieldMarkType.FieldEnd);
            A_0.Items.Insert(A_0.Items.Count - 1, mark);
        }
Example #2
0
        private void method_69(IParagraph A_0, Paragraph A_1, string A_2, string A_3)
        {
            int   num    = 6;
            Field entity = new Field(base.Document)
            {
                Type = FieldType.FieldHyperlink
            };

            A_1.Items.Add(entity);
            A_1.AppendFieldMark(FieldMarkType.FieldSeparator);
            if (!string.IsNullOrEmpty(A_2))
            {
                A_1.AppendText(A_2).CharacterFormat.CharStyleName = BookmarkStart.b("搫圭䀯圱䘳娵儷吹圻", num);
            }
            else
            {
                this.method_76(A_0, A_1);
                foreach (ParagraphBase base2 in A_0.Items)
                {
                    if ((base2 is TextRange) && ((base2 as TextRange).Text != BookmarkStart.b("┫", num)))
                    {
                        ITextRange range = A_1.AppendText((base2 as TextRange).Text);
                        if ((base2 as TextRange).CharacterFormat.HasKey(60))
                        {
                            range.CharacterFormat.Bold = (base2 as TextRange).CharacterFormat.Bold;
                        }
                        if ((base2 as TextRange).CharacterFormat.HasKey(70))
                        {
                            range.CharacterFormat.Italic = (base2 as TextRange).CharacterFormat.Italic;
                        }
                        range.CharacterFormat.CharStyleName = BookmarkStart.b("搫圭䀯圱䘳娵儷吹圻", num);
                    }
                }
            }
            FieldMark mark = new FieldMark(base.Document, FieldMarkType.FieldEnd);

            A_1.Items.Add(mark);
            Hyperlink hyperlink = new Hyperlink(entity)
            {
                Type         = HyperlinkType.Bookmark,
                BookmarkName = A_3
            };
        }
Example #3
0
 protected internal FieldMark(FieldMark fieldMark, IDocument doc) : this(doc)
 {
     this.Type         = fieldMark.Type;
     base.m_charFormat = (Spire.Doc.Formatting.CharacterFormat)fieldMark.CharacterFormat.method_23();
 }
Example #4
0
        private void method_61()
        {
            int       num            = 0;
            Paragraph ownerParagraph = base.OwnerParagraph;
            Body      ownerTextBody  = ownerParagraph.OwnerTextBody;
            int       index          = ownerTextBody.Items.IndexOf(ownerParagraph);
            bool      flag           = true;
            int       num3           = index;
            int       num4           = 0;

            while (num3 < ownerTextBody.Items.Count)
            {
                if (!(ownerTextBody.Items[num3] is Paragraph))
                {
                    goto Label_01E7;
                }
                Paragraph entity = ownerTextBody.Items[num3] as Paragraph;
                int       num6   = 0;
                if (num3 == index)
                {
                    num6 = entity.Items.IndexOf(this);
                }
                for (int i = num6; i < entity.Items.Count; i++)
                {
                    if (((entity.Items[i] == this) && (entity.Items[i + 1] is FieldMark)) && ((entity.Items[i + 1] as FieldMark).Type == FieldMarkType.FieldSeparator))
                    {
                        num4++;
                        i++;
                    }
                    else
                    {
                        if (entity.Items[i] is FieldMark)
                        {
                            FieldMark mark2 = entity.Items[i] as FieldMark;
                            if (mark2.Type == FieldMarkType.FieldSeparator)
                            {
                                num4++;
                            }
                            else if (mark2.Type == FieldMarkType.FieldEnd)
                            {
                                if ((i == 0) && (num4 == 1))
                                {
                                    break;
                                }
                                num4--;
                            }
                        }
                        else if ((entity.Items[i] is TextRange) && ((entity.Items[i] as TextRange).Text == BookmarkStart.b("爥朧椩", num)))
                        {
                            goto Label_01A2;
                        }
                        entity.Items.Remove(entity.Items[i]);
                        i--;
                    }
                }
                goto Label_01A5;
Label_01A2:
                flag = false;
Label_01A5:
                if (entity.Items.Count == 0)
                {
                    ownerTextBody.Items.Remove(entity);
                    num3--;
                }
                else
                {
                    if ((entity.Items[0] is FieldMark) && flag)
                    {
                        entity.Items.Insert(0, this);
                        FieldMark separator = null;
                        if (this.TOCField.Separator != null)
                        {
                            separator = this.TOCField.Separator;
                        }
                        else
                        {
                            separator = new FieldMark(base.Document, FieldMarkType.FieldSeparator);
                            this.TOCField.Separator = separator;
                        }
                        if (separator != null)
                        {
                            entity.Items.Insert(1, separator);
                        }
                        TextRange range = new TextRange(base.Document)
                        {
                            Text = BookmarkStart.b("爥朧椩", num)
                        };
                        entity.Items.Insert(2, range);
                        ownerTextBody.Items.Remove(ownerParagraph);
                        return;
                    }
                    if (!flag)
                    {
                        return;
                    }
                }
Label_01E7:
                num3++;
            }
        }