123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- using ComPDFKit.PDFAnnotation;
- using ComPDFKit.Tool;
- using Compdfkit_Tools.Measure.Property;
- using Compdfkit_Tools.PDFControl;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- namespace Compdfkit_Tools.Measure
- {
- /// <summary>
- /// MeasurePropertyControl.xaml 的交互逻辑
- /// </summary>
- public partial class MeasurePropertyControl : UserControl
- {
- private UIElement currentPanel = null;
- public MeasurePropertyControl()
- {
- InitializeComponent();
- }
- public void SetPropertyForMeasureCreate(AnnotParam Args)
- {
- if (Args == null)
- {
- ClearMeasurePanel();
- return;
- }
- switch (Args.CurrentType)
- {
- case C_ANNOTATION_TYPE.C_ANNOTATION_LINE:
- StraightnessProperty straightnessProperty = new StraightnessProperty();
- //if (attribEvent != null)
- //{
- // straightnessProperty.SetAnnotEventData(attribEvent);
- //}
- //else
- //{
- // straightnessProperty.SetAnnotArgsData((LineMeasureArgs)Args);
- //}
- currentPanel = straightnessProperty;
- break;
- case C_ANNOTATION_TYPE.C_ANNOTATION_POLYLINE:
- //MultilineProperty multilineProperty = new MultilineProperty();
- //if (attribEvent != null)
- //{
- // multilineProperty.SetAnnotEventData(attribEvent);
- //}
- //else
- //{
- // multilineProperty.SetAnnotArgsData((PolyLineMeasureArgs)Args);
- //}
- //currentPanel = multilineProperty;
- break;
- case C_ANNOTATION_TYPE.C_ANNOTATION_POLYGON:
- //PolygonalProperty polygonalProperty = new PolygonalProperty();
- //if (attribEvent != null)
- //{
- // polygonalProperty.SetAnnotEventData(attribEvent);
- //}
- //else
- //{
- // polygonalProperty.SetAnnotArgsData((PolygonMeasureArgs)Args);
- //}
- //currentPanel = polygonalProperty;
- break;
- default:
- break;
- }
- SetMeasurePanel(currentPanel);
- }
- private void SetMeasurePanel(UIElement newChild)
- {
- MeasurePropertyPanel.Child = newChild;
- }
- public void ClearMeasurePanel()
- {
- currentPanel = null;
- MeasurePropertyPanel.Child = null;
- }
- //public void SetPorpertyForMeasureModify(AnnotAttribEvent annotEvent)
- //{
- //}
- }
- }
|