コード例 #1
0
 public override void UpdateVisual()
 {
     if (ThumbMove != null)
     {
         double x    = MsiToCanvas(base.CurrentStart).X;
         double y    = MsiToCanvas(base.CurrentStart).Y;
         double x2   = MsiToCanvas(base.CurrentEnd).X;
         double y2   = MsiToCanvas(base.CurrentEnd).Y;
         double num  = Math.Abs(x - x2);
         double num2 = Math.Abs(y - y2);
         x = Math.Min(x, x2);
         y = Math.Min(y, y2);
         ThumbB.SetValue(Canvas.LeftProperty, x + num / 2.0 - Setting.Thumb_w / 2.0);
         ThumbB.SetValue(Canvas.TopProperty, y + num2 - Setting.Thumb_w / 2.0);
         ThumbL.SetValue(Canvas.LeftProperty, x - Setting.Thumb_w / 2.0);
         ThumbL.SetValue(Canvas.TopProperty, y + num2 / 2.0 - Setting.Thumb_w / 2.0);
         ThumbLB.SetValue(Canvas.LeftProperty, x - Setting.Thumb_w / 2.0);
         ThumbLB.SetValue(Canvas.TopProperty, y + num2 - Setting.Thumb_w / 2.0);
         ThumbLT.SetValue(Canvas.LeftProperty, x - Setting.Thumb_w / 2.0);
         ThumbLT.SetValue(Canvas.TopProperty, y - Setting.Thumb_w / 2.0);
         ThumbR.SetValue(Canvas.LeftProperty, x + num - Setting.Thumb_w / 2.0);
         ThumbR.SetValue(Canvas.TopProperty, y + num2 / 2.0 - Setting.Thumb_w / 2.0);
         ThumbRB.SetValue(Canvas.LeftProperty, x + num - Setting.Thumb_w / 2.0);
         ThumbRB.SetValue(Canvas.TopProperty, y + num2 - Setting.Thumb_w / 2.0);
         ThumbRT.SetValue(Canvas.LeftProperty, x + num - Setting.Thumb_w / 2.0);
         ThumbRT.SetValue(Canvas.TopProperty, y - Setting.Thumb_w / 2.0);
         ThumbT.SetValue(Canvas.LeftProperty, x + num / 2.0 - Setting.Thumb_w / 2.0);
         ThumbT.SetValue(Canvas.TopProperty, y - Setting.Thumb_w / 2.0);
         ThumbMove.SetValue(Canvas.LeftProperty, x + num / 2.0 - Setting.Thumb_c / 2.0);
         ThumbMove.SetValue(Canvas.TopProperty, y + num2 / 2.0 - Setting.Thumb_c / 2.0);
         m_rectangle.StrokeThickness = 2.0;
         m_rectangle.Stroke          = base.BorderBrush;
         m_rectangle.Width           = num;
         m_rectangle.Height          = num2;
         Canvas.SetLeft(m_rectangle, x);
         Canvas.SetTop(m_rectangle, y);
         Canvas.SetLeft(newImage, x + num - 24.0);
         Canvas.SetTop(newImage, y + num2);
         Canvas.SetLeft(newImage2, x + num - 24.0 - 24.0 - 5.0);
         Canvas.SetTop(newImage2, y + num2);
         LeftRect.SetValue(Canvas.LeftProperty, 0.0);
         LeftRect.SetValue(Canvas.TopProperty, y);
         LeftRect.Width  = x;
         LeftRect.Height = num2;
         RightRect.SetValue(Canvas.LeftProperty, x + m_rectangle.Width);
         RightRect.SetValue(Canvas.TopProperty, y);
         RightRect.Width  = M_FiguresCanvas.ActualWidth - (x + num);
         RightRect.Height = num2;
         TopRect.SetValue(Canvas.LeftProperty, 0.0);
         TopRect.SetValue(Canvas.TopProperty, 0.0);
         TopRect.Width  = M_FiguresCanvas.ActualWidth;
         TopRect.Height = y;
         BottomRect.SetValue(Canvas.LeftProperty, 0.0);
         BottomRect.SetValue(Canvas.TopProperty, y + num2);
         BottomRect.Width  = M_FiguresCanvas.ActualWidth;
         BottomRect.Height = M_FiguresCanvas.ActualHeight - (y + num2);
     }
 }
コード例 #2
0
 public override void UpdateVisual()
 {
     if (ThumbMove != null)
     {
         if (base.AnnotationDescription.Trim() != "" || base.isVisble == Visibility.Visible)
         {
             base.MTextBlock.Visibility = Visibility.Visible;
         }
         if (base.isVisble == Visibility.Collapsed && !base.isMsVisble)
         {
             base.MTextBlock.Visibility = Visibility.Collapsed;
         }
         if (base.isVisble == Visibility.Collapsed && base.AnnotationDescription.Trim() == "")
         {
             base.MTextBlock.Visibility = Visibility.Collapsed;
         }
         PointCollection pointCollection = new PointCollection();
         Mpolyline.Stroke          = base.BorderBrush;
         Mpolyline.StrokeThickness = base.Size;
         double x  = MsiToCanvas(base.CurrentStart).X;
         double y  = MsiToCanvas(base.CurrentStart).Y;
         double x2 = MsiToCanvas(base.CurrentEnd).X;
         double y2 = MsiToCanvas(base.CurrentEnd).Y;
         UpdatePoints(x, y, x2, y2);
         foreach (Point currentPoint in CurrentPoints)
         {
             pointCollection.Add(MsiToCanvas(currentPoint));
         }
         Mpolyline.Points = pointCollection;
         double num  = Math.Abs(x - x2);
         double num2 = Math.Abs(y - y2);
         x = Math.Min(x, x2);
         y = Math.Min(y, y2);
         ThumbB.SetValue(Canvas.LeftProperty, x + num / 2.0 - Setting.Thumb_w / 2.0);
         ThumbB.SetValue(Canvas.TopProperty, y + num2 - Setting.Thumb_w / 2.0);
         ThumbL.SetValue(Canvas.LeftProperty, x - Setting.Thumb_w / 2.0);
         ThumbL.SetValue(Canvas.TopProperty, y + num2 / 2.0 - Setting.Thumb_w / 2.0);
         ThumbLB.SetValue(Canvas.LeftProperty, x - Setting.Thumb_w / 2.0);
         ThumbLB.SetValue(Canvas.TopProperty, y + num2 - Setting.Thumb_w / 2.0);
         ThumbLT.SetValue(Canvas.LeftProperty, x - Setting.Thumb_w / 2.0);
         ThumbLT.SetValue(Canvas.TopProperty, y - Setting.Thumb_w / 2.0);
         ThumbR.SetValue(Canvas.LeftProperty, x + num - Setting.Thumb_w / 2.0);
         ThumbR.SetValue(Canvas.TopProperty, y + num2 / 2.0 - Setting.Thumb_w / 2.0);
         ThumbRB.SetValue(Canvas.LeftProperty, x + num - Setting.Thumb_w / 2.0);
         ThumbRB.SetValue(Canvas.TopProperty, y + num2 - Setting.Thumb_w / 2.0);
         ThumbRT.SetValue(Canvas.LeftProperty, x + num - Setting.Thumb_w / 2.0);
         ThumbRT.SetValue(Canvas.TopProperty, y - Setting.Thumb_w / 2.0);
         ThumbT.SetValue(Canvas.LeftProperty, x + num / 2.0 - Setting.Thumb_w / 2.0);
         ThumbT.SetValue(Canvas.TopProperty, y - Setting.Thumb_w / 2.0);
         ThumbMove.SetValue(Canvas.LeftProperty, x + num / 2.0 - Setting.Thumb_c / 2.0);
         ThumbMove.SetValue(Canvas.TopProperty, y + num2 / 2.0 - Setting.Thumb_c / 2.0);
         Canvas.SetLeft(base.MTextBlock, x + num / 2.0);
         Canvas.SetTop(base.MTextBlock, y + num2 / 2.0);
         base.MTextBlock.Visibility = base.isHidden;
         Mpolyline.Visibility       = base.isHidden;
         base.MTextBlock.Text       = CalcMeasureInfo();
     }
 }
コード例 #3
0
 public override void UpdateVisual()
 {
     if (ThumbMove != null)
     {
         if (base.AnnotationDescription.Trim() != "" || base.isVisble == Visibility.Visible)
         {
             base.MTextBlock.Visibility = Visibility.Visible;
         }
         if (base.isVisble == Visibility.Collapsed && !base.isMsVisble)
         {
             base.MTextBlock.Visibility = Visibility.Collapsed;
         }
         if (base.isVisble == Visibility.Collapsed && base.AnnotationDescription.Trim() == "")
         {
             base.MTextBlock.Visibility = Visibility.Collapsed;
         }
         double x    = MsiToCanvas(base.CurrentStart).X;
         double y    = MsiToCanvas(base.CurrentStart).Y;
         double x2   = MsiToCanvas(base.CurrentEnd).X;
         double y2   = MsiToCanvas(base.CurrentEnd).Y;
         double num  = Math.Abs(x - x2);
         double num2 = Math.Abs(y - y2);
         x = Math.Min(x, x2);
         y = Math.Min(y, y2);
         ThumbB.SetValue(Canvas.LeftProperty, x + num / 2.0 - Setting.Thumb_w / 2.0);
         ThumbB.SetValue(Canvas.TopProperty, y + num2 - Setting.Thumb_w / 2.0);
         ThumbL.SetValue(Canvas.LeftProperty, x - Setting.Thumb_w / 2.0);
         ThumbL.SetValue(Canvas.TopProperty, y + num2 / 2.0 - Setting.Thumb_w / 2.0);
         ThumbLB.SetValue(Canvas.LeftProperty, x - Setting.Thumb_w / 2.0);
         ThumbLB.SetValue(Canvas.TopProperty, y + num2 - Setting.Thumb_w / 2.0);
         ThumbLT.SetValue(Canvas.LeftProperty, x - Setting.Thumb_w / 2.0);
         ThumbLT.SetValue(Canvas.TopProperty, y - Setting.Thumb_w / 2.0);
         ThumbR.SetValue(Canvas.LeftProperty, x + num - Setting.Thumb_w / 2.0);
         ThumbR.SetValue(Canvas.TopProperty, y + num2 / 2.0 - Setting.Thumb_w / 2.0);
         ThumbRB.SetValue(Canvas.LeftProperty, x + num - Setting.Thumb_w / 2.0);
         ThumbRB.SetValue(Canvas.TopProperty, y + num2 - Setting.Thumb_w / 2.0);
         ThumbRT.SetValue(Canvas.LeftProperty, x + num - Setting.Thumb_w / 2.0);
         ThumbRT.SetValue(Canvas.TopProperty, y - Setting.Thumb_w / 2.0);
         ThumbT.SetValue(Canvas.LeftProperty, x + num / 2.0 - Setting.Thumb_w / 2.0);
         ThumbT.SetValue(Canvas.TopProperty, y - Setting.Thumb_w / 2.0);
         ThumbMove.SetValue(Canvas.LeftProperty, x + num / 2.0 - Setting.Thumb_c / 2.0);
         ThumbMove.SetValue(Canvas.TopProperty, y + num2 / 2.0 - Setting.Thumb_c / 2.0);
         m_rectangle.StrokeThickness = base.Size;
         m_rectangle.Stroke          = new SolidColorBrush(Color.FromRgb(0, byte.MaxValue, 0));
         m_rectangle.Width           = num;
         m_rectangle.Height          = num2;
         Canvas.SetLeft(m_rectangle, x);
         Canvas.SetTop(m_rectangle, y);
         Canvas.SetLeft(base.MTextBlock, x);
         Canvas.SetTop(base.MTextBlock, y + 20.0);
         m_rectangle.Visibility = base.isHidden;
         base.MTextBlock.Text   = CalcMeasureInfo();
         Canvas.SetLeft(XTextBlock, x);
         Canvas.SetTop(XTextBlock, y);
     }
 }