Exemplo n.º 1
0
 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;
         }
     }
 }
Exemplo n.º 2
0
        internal void Draw()
        {
            this.canvas.Children.Clear();
            DrawModel drawModel = DataSource as DrawModel;

            canvas.Height = drawModel.Height * Scale;
            canvas.Width  = drawModel.Width * Scale;

            foreach (LineModel line in drawModel.ListLine)
            {
                if (line.IsVisible)
                {
                    Line line2 = new Line
                    {
                        X1                 = line.X1 * Scale,
                        Y1                 = line.Y1 * Scale,
                        X2                 = line.X2 * Scale,
                        Y2                 = line.Y2 * Scale,
                        Stroke             = new SolidColorBrush(Colors.Red),
                        StrokeThickness    = 0.4,
                        StrokeLineJoin     = PenLineJoin.Round,
                        StrokeStartLineCap = PenLineCap.Round,
                        StrokeEndLineCap   = PenLineCap.Round
                    };
                    canvas.Children.Add(line2);
                }
            }
        }
Exemplo n.º 3
0
 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;
         }
     }
 }
Exemplo n.º 4
0
        public DrawModel Clone()
        {
            DrawModel drawModel = new DrawModel(Page, Width, Height)
            {
                ProgressIndex = this.ProgressIndex
            };

            foreach (var item in ListLine)
            {
                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);
        }
Exemplo n.º 5
0
 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;
     }
 }
Exemplo n.º 6
0
 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;
     }
 }
Exemplo n.º 7
0
 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;
         }
     }
 }
Exemplo n.º 8
0
 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;
         }
     }
 }
Exemplo n.º 9
0
        public DrawModel Clone()
        {
            DrawModel drawModel = new DrawModel(Page, Width, Height)
            {
                ProgressIndex = this.ProgressIndex
            };

         foreach (var item in ListLine)
            {
                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;
        }