Exemple #1
0
        public IEditPage Add()
        {
            IEditPage page1 = new EditPage(this);

            this.Add(page1);
            return(page1);
        }
Exemple #2
0
 protected virtual void RulerChanged(object sender, EventArgs e)
 {
     if ((this.owner != null) && (sender is IEditRuler))
     {
         int num1;
         int num2;
         if (this.owner.Selection.IsEmpty())
         {
             num1 = this.GetPageIndexAt(this.owner.DisplayLines.PointToDisplayPoint(this.owner.Position));
             num2 = num1;
         }
         else
         {
             Rectangle rectangle1 = this.owner.Selection.SelectionRect;
             num1 = this.GetPageIndexAt(this.owner.DisplayLines.PointToDisplayPoint(rectangle1.Location));
             num2 = this.GetPageIndexAt(this.owner.DisplayLines.PointToDisplayPoint(rectangle1.Right, rectangle1.Bottom));
         }
         this.BeginUpdate();
         try
         {
             IEditRuler  ruler1  = (IEditRuler)sender;
             RulerIndent indent1 = ((RulerEventArgs)e).Object as RulerIndent;
             for (int num3 = Math.Max(num1, 0); num3 <= num2; num3++)
             {
                 EditPage page1 = this[num3] as EditPage;
                 if (ruler1.Vertical)
                 {
                     if (indent1.Orientation == IndentOrientation.Near)
                     {
                         page1.TopIndent = indent1.Indent;
                     }
                     else
                     {
                         page1.BottomIndent = indent1.Indent;
                     }
                 }
                 else if (indent1.Orientation == IndentOrientation.Near)
                 {
                     page1.LeftIndent = indent1.Indent;
                 }
                 else
                 {
                     page1.RightIndent = indent1.Indent;
                 }
             }
         }
         finally
         {
             this.EndUpdate();
         }
     }
 }
Exemple #3
0
 public void FixupReferences(EditPage Owner)
 {
     this.owner       = Owner;
     this.Footer      = this.footer;
     this.Header      = this.header;
     this.HorzOffset  = this.horzOffset;
     this.Landscape   = this.landscape;
     this.Margins     = this.margins;
     this.PageKind    = this.pageKind;
     this.PageSize    = this.pageSize;
     this.PaintNumber = this.paintNumber;
     this.VertOffset  = this.vertOffset;
 }
Exemple #4
0
            public int Compare(object x, object y)
            {
                EditPage page1 = (EditPage)x;
                int      num1  = (int)y;

                if (page1.StartLine > num1)
                {
                    return(1);
                }
                if (page1.EndLine < num1)
                {
                    return(-1);
                }
                return(0);
            }
Exemple #5
0
 protected internal void UpdatePages(int StartIndex, int EndIndex, bool Changed)
 {
     if (((this.updateCount <= 0) || !Changed) && (this.pageType != River.Orqa.Editor.PageType.Normal))
     {
         this.updateCount++;
         try
         {
             Rectangle rectangle1;
             int       num1  = Math.Max(StartIndex, 0);
             int       num2  = this.owner.DisplayLines.GetCount();
             int       num3  = 0;
             bool      flag1 = this.pageType == River.Orqa.Editor.PageType.PageLayout;
             bool      flag2 = this.displayWhiteSpace && flag1;
             int       num4  = 0;
             if (num1 > 0)
             {
                 EditPage page1 = (EditPage)this[num1 - 1];
                 rectangle1 = page1.GetBounds(true);
                 num4       = rectangle1.Bottom;
                 num3       = page1.EndLine + 1;
             }
             if (Changed)
             {
                 this.owner.UpdateWordWrap(num3, 0x7fffffff);
             }
             int num5 = this.owner.Painter.FontHeight;
             while (((num3 < num2) || (num2 == 0)) && (num1 <= EndIndex))
             {
                 EditPage page2 = this.GetPage(num1);
                 page2.StartLine = num3;
                 int num6 = Math.Max((num5 > 0) ? (page2.ClientRect.Height / num5) : 1, 1);
                 page2.EndLine = (num3 + num6) - 1;
                 int num7 = ((this.rulers & EditRulers.Vertical) != EditRulers.None) ? EditConsts.DefaultRulerHeight : 0;
                 int num8 = ((num1 == 0) && ((this.rulers & EditRulers.Horizonal) != EditRulers.None)) ? EditConsts.DefaultRulerHeight : 0;
                 page2.Origin = new Point((flag1 ? page2.HorzOffset : 0) + num7, (num4 + (flag2 ? page2.VertOffset : (((num1 == 0) && flag1) ? 4 : 0))) + num8);
                 rectangle1   = page2.GetBounds(true);
                 num4        += (rectangle1.Height + num8);
                 num3        += num6;
                 if (num3 >= num2)
                 {
                     break;
                 }
                 num1++;
             }
             if ((EndIndex == 0x7fffffff) && ((DisplayStrings)this.owner.DisplayLines).AlreadyScanned())
             {
                 for (int num9 = this.Count - 1; num9 > num1; num9--)
                 {
                     this.items.RemoveAt(num9);
                 }
             }
             if (Changed)
             {
                 this.UpdateRulers();
             }
         }
         finally
         {
             this.updateCount--;
         }
     }
 }
Exemple #6
0
 public XmlEditPageInfo(EditPage Owner) : this()
 {
     this.owner = Owner;
 }