public void InizializeFirstPage()
 {
     if (this.ListPage == null)
     {
         this.ListPage = new List<DrawModel>();
         this._currentPage = new DrawModel(this.ListPage.Count, this.panel.ActualWidth, this.panel.ActualHeight);
         this.ListPage.Add(this._currentPage);
         this.panel.Children.Clear();
         this.CurrentPageCount = 1;
     }
     else if (this.ListPage.Count > 0)
     {
         this._currentPage = this.ListPage[0];
         this.CurrentPageCount = 1;
         this.ReloadData();
     }
     else if (this.ListPage.Count == 0)
     {
         this._currentPage = new DrawModel(this.ListPage.Count, this.panel.ActualWidth, this.panel.ActualHeight);
         this.ListPage.Add(this._currentPage);
         this.panel.Children.Clear();
         this.CurrentPageCount = 1;
     }
 }
 public void NextPage()
 {
     if ((this._currentPage != null) && (this._currentPage.ListLine.Count != 0))
     {
         int index = this.ListPage.IndexOf(this._currentPage);
         this._linetemp = null;
         if (index < (this.ListPage.Count - 1))
         {
             this._currentPage = this.ListPage[index + 1];
             this.panel.Children.Clear();
             this.ReloadData();
         }
         else if (index >= (this.ListPage.Count - 1))
         {
             this._currentPage = new DrawModel(this.ListPage.Count, this.panel.ActualWidth, this.panel.ActualHeight);
             this.ListPage.Add(this._currentPage);
             this.panel.Children.Clear();
             this.ReloadData();
         }
         if (this._currentPage != null)
         {
             this.CurrentPageCount = this.ListPage.IndexOf(this._currentPage) + 1;
         }
     }
 }
 public void PreviousPage()
 {
     if (this._currentPage != null)
     {
         int index = this.ListPage.IndexOf(this._currentPage);
         this._linetemp = null;
         if (index > 0)
         {
             this._currentPage = this.ListPage[index - 1];
             this.panel.Children.Clear();
             this.ReloadData();
         }
         if (this._currentPage != null)
         {
             this.CurrentPageCount = this.ListPage.IndexOf(this._currentPage) + 1;
         }
     }
 }
Beispiel #4
0
        public DrawModel Clone()
        {
            DrawModel drawModel = new DrawModel(Page, Width, Height)
            {
                 ProgressIndex=this.ProgressIndex
            };

            this.ListLine.ForEach(item =>
                {
                    LineModel line = new LineModel()
                    {
                        Index = item.Index,
                        IsVisible = item.IsVisible,
                        X1 = item.X1,
                        Y1 = item.Y1,
                        X2 = item.X2,
                        Y2 = item.Y2
                    };
                    drawModel.ListLine.Add(line);
                });
            return drawModel;
        }