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; } ThumbMove.SetValue(Canvas.LeftProperty, MsiToCanvas(base.CurrentStart).X - Setting.Thumb_w / 2.0); ThumbMove.SetValue(Canvas.TopProperty, MsiToCanvas(base.CurrentStart).Y - 20.0 - Setting.Thumb_w / 2.0); Canvas.SetLeft(myImage, MsiToCanvas(base.CurrentStart).X - 20.0); Canvas.SetTop(myImage, MsiToCanvas(base.CurrentStart).Y - 40.0); myImage.Source = new BitmapImage(new Uri(base.PinType, UriKind.Relative)); myImage.Visibility = base.isHidden; base.MTextBlock.Visibility = base.isHidden; base.MTextBlock.Text = CalcMeasureInfo(); Canvas.SetLeft(base.MTextBlock, MsiToCanvas(base.CurrentStart).X); Canvas.SetTop(base.MTextBlock, MsiToCanvas(base.CurrentStart).Y); } }
private void tbTextChanged(object sender, TextChangedEventArgs e) { base.AnnoControl.qsr.Text = TB.Text; base.AnnotationDescription = TB.Text; ThumbMove.SetValue(Canvas.LeftProperty, MsiToCanvas(base.CurrentStart).X + TB.ActualWidth / 2.0 - Setting.Thumb_w / 2.0); ThumbMove.SetValue(Canvas.TopProperty, MsiToCanvas(base.CurrentStart).Y + TB.ActualHeight / 2.0 - Setting.Thumb_w / 2.0); }
public override void UpdateVisual() { if (ThumbEnd != 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; } m_line.StrokeThickness = base.Size; m_line.Stroke = base.BorderBrush; m_line.X1 = MsiToCanvas(base.CurrentStart).X; m_line.Y1 = MsiToCanvas(base.CurrentStart).Y; m_line.X2 = MsiToCanvas(base.CurrentEnd).X; m_line.Y2 = MsiToCanvas(base.CurrentEnd).Y; m_ThumbStart.SetValue(Canvas.LeftProperty, m_line.X1 - m_ThumbStart.Width / 2.0); m_ThumbStart.SetValue(Canvas.TopProperty, m_line.Y1 - m_ThumbStart.Height / 2.0); m_ThumbEnd.SetValue(Canvas.LeftProperty, m_line.X2 - m_ThumbEnd.Width / 2.0); m_ThumbEnd.SetValue(Canvas.TopProperty, m_line.Y2 - m_ThumbEnd.Height / 2.0); ThumbMove.SetValue(Canvas.LeftProperty, (m_line.X1 + m_line.X2) / 2.0 - ThumbMove.Width / 2.0); ThumbMove.SetValue(Canvas.TopProperty, (m_line.Y1 + m_line.Y2) / 2.0 - ThumbMove.Height / 2.0); Canvas.SetLeft(base.MTextBlock, (m_line.X1 + m_line.X2) / 2.0); Canvas.SetTop(base.MTextBlock, (m_line.Y1 + m_line.Y2) / 2.0); m_line.Visibility = base.isHidden; base.MTextBlock.Visibility = base.isHidden; base.MTextBlock.Text = CalcMeasureInfo(); } }
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); } }
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); } }
private void reThumb(object sender, RoutedEventArgs e) { ThumbMove.SetValue(Canvas.LeftProperty, MsiToCanvas(base.CurrentStart).X + TB.ActualWidth / 2.0 - Setting.Thumb_w / 2.0); ThumbMove.SetValue(Canvas.TopProperty, MsiToCanvas(base.CurrentStart).Y + TB.ActualHeight / 2.0 - Setting.Thumb_w / 2.0); }