Selaa lähdekoodia

测量-测量demo的UI合并

zhuyi 10 kuukautta sitten
vanhempi
commit
e27332a42d

+ 115 - 117
Demo/Examples/Compdfkit_Tools/Common/BarControl/CPDFMeasureBarControl.xaml.cs

@@ -4,8 +4,6 @@ using ComPDFKit.PDFAnnotation.Form;
 using Compdfkit_Tools.Helper;
 using Compdfkit_Tools.Measure;
 using Compdfkit_Tools.Measure.Property;
-using ComPDFKitViewer.AnnotEvent;
-using ComPDFKitViewer.PdfViewer;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
@@ -47,7 +45,7 @@ namespace Compdfkit_Tools.PDFControl
         };
 
 
-        private CPDFViewer pdfViewer;
+        private PDFViewControl pdfViewer;
 
         private MeasurePropertyControl measurePropertyControl = null;
         private MeasureControl measureControl = null;
@@ -162,7 +160,7 @@ namespace Compdfkit_Tools.PDFControl
 
         #region Even Process
 
-        public void InitWithPDFViewer(CPDFViewer pdfViewer, MeasurePropertyControl FromProperty, MeasureControl parentControl)
+        public void InitWithPDFViewer(PDFViewControl pdfViewer, MeasurePropertyControl FromProperty, MeasureControl parentControl)
         {
             this.pdfViewer = pdfViewer;
             measurePropertyControl = FromProperty;
@@ -208,7 +206,7 @@ namespace Compdfkit_Tools.PDFControl
 
         private void MeasureBtn_Click(object sender, RoutedEventArgs e)
         {
-            AnnotHandlerEventArgs args = null;
+            //AnnotHandlerEventArgs args = null;
             ClearToolState(sender as ToggleButton);
             if ((bool)(sender as ToggleButton).IsChecked)
             {
@@ -217,16 +215,16 @@ namespace Compdfkit_Tools.PDFControl
                     case MeasureType.UnKnown:
                         break;
                     case MeasureType.Line:
-                        args = CreateLine();
+                        //args = CreateLine();
                         break;
                     case MeasureType.Multiline:
-                        args = CreateMultiline();
+                        //args = CreateMultiline();
                         break;
                     case MeasureType.Polygonal:
-                        args = CreatePolygonal();
+                        //args = CreatePolygonal();
                         break;
                     case MeasureType.Rectangles:
-                        args = CreateRectangles();
+                        //args = CreateRectangles();
                         break;
                     default:
                         break;
@@ -234,120 +232,120 @@ namespace Compdfkit_Tools.PDFControl
             }
             else
             {
-                pdfViewer.SetMouseMode(MouseModes.PanTool);
+                //pdfViewer.SetMouseMode(MouseModes.PanTool);
                 measureControl.SetInfoPanelVisble(false, false);
             }
-            if (args != null)
-            {
-                panelState.RightPanel = RightPanelState.PropertyPanel;
-            }
-            measurePropertyControl.SetPropertyForMeasureCreate(args,null);
+            //if (args != null)
+            //{
+            //    panelState.RightPanel = RightPanelState.PropertyPanel;
+            //}
+            //measurePropertyControl.SetPropertyForMeasureCreate(args,null);
         }
 
         #endregion
 
-        #region Create Form
-
-        private AnnotHandlerEventArgs CreateLine()
-        {
-            LineMeasureArgs lineMeasureArgs = new LineMeasureArgs();
-            lineMeasureArgs.LineColor = Colors.Red;
-            lineMeasureArgs.LineWidth = 2;
-            lineMeasureArgs.Transparency = 1;
-            lineMeasureArgs.FontColor = Colors.Red;
-            lineMeasureArgs.FontName = "Arial";
-            lineMeasureArgs.FontSize = 14;
-            lineMeasureArgs.HeadLineType = C_LINE_TYPE.LINETYPE_ARROW;
-            lineMeasureArgs.TailLineType = C_LINE_TYPE.LINETYPE_ARROW;
-            pdfViewer?.ClearSelectAnnots();
-            pdfViewer?.SetMouseMode(MouseModes.AnnotCreate);
-            pdfViewer?.SetToolParam(lineMeasureArgs);
-            measureControl.SetMeasureInfoType(CPDFMeasureType.CPDF_DISTANCE_MEASURE);
-            measureControl.SetInfoPanelVisble(true, false);
-            measureControl.SetMeasureScale(CPDFMeasureType.CPDF_DISTANCE_MEASURE,
-                string.Format("{0}{1}={2}{3}",
-                            MeasureSetting.RulerBase,
-                            MeasureSetting.RulerBaseUnit,
-                            MeasureSetting.RulerTranslate,
-                            MeasureSetting.RulerTranslateUnit));
-            return lineMeasureArgs;
-        }
-
-        private AnnotHandlerEventArgs CreateMultiline()
-        {
-
-            PolyLineMeasureArgs polyLineMeasureArgs = new PolyLineMeasureArgs();
-            polyLineMeasureArgs.LineColor = Colors.Red;
-            polyLineMeasureArgs.LineWidth = 2;
-            polyLineMeasureArgs.Transparency = 1;
-            polyLineMeasureArgs.FontColor = Colors.Red;
-            polyLineMeasureArgs.FontName = "Arial";
-            polyLineMeasureArgs.FontSize = 14;
-            pdfViewer?.ClearSelectAnnots();
-            pdfViewer?.SetMouseMode(MouseModes.AnnotCreate);
-            pdfViewer?.SetToolParam(polyLineMeasureArgs);
-            measureControl.SetMeasureInfoType(CPDFMeasureType.CPDF_PERIMETER_MEASURE);
-            measureControl.SetInfoPanelVisble(true, false);
-            measureControl.SetMeasureScale(CPDFMeasureType.CPDF_PERIMETER_MEASURE,
-               string.Format("{0}{1}={2}{3}",
-                           MeasureSetting.RulerBase,
-                           MeasureSetting.RulerBaseUnit,
-                           MeasureSetting.RulerTranslate,
-                           MeasureSetting.RulerTranslateUnit));
-            return polyLineMeasureArgs;
-        }
-
-        private AnnotHandlerEventArgs CreatePolygonal()
-        {
-            PolygonMeasureArgs polygonMeasureArgs = new PolygonMeasureArgs();
-            polygonMeasureArgs.LineColor = Colors.Red;
-            polygonMeasureArgs.LineWidth = 2;
-            polygonMeasureArgs.Transparency = 1;
-            polygonMeasureArgs.FontColor = Colors.Red;
-            polygonMeasureArgs.FillColor = Colors.Transparent;
-            polygonMeasureArgs.FontName = "Arial";
-            polygonMeasureArgs.FontSize = 14;
-            pdfViewer?.ClearSelectAnnots();
-            pdfViewer?.SetMouseMode(MouseModes.AnnotCreate);
-            pdfViewer?.SetToolParam(polygonMeasureArgs);
-            measureControl.SetMeasureInfoType(CPDFMeasureType.CPDF_AREA_MEASURE);
-            measureControl.SetInfoPanelVisble(true, false);
-            measureControl.SetMeasureScale(CPDFMeasureType.CPDF_AREA_MEASURE,
-              string.Format("{0}{1}={2}{3}",
-                          MeasureSetting.RulerBase,
-                          MeasureSetting.RulerBaseUnit,
-                          MeasureSetting.RulerTranslate,
-                          MeasureSetting.RulerTranslateUnit));
-            return polygonMeasureArgs;
-        }
-
-        private AnnotHandlerEventArgs CreateRectangles()
-        {
-
-            PolygonMeasureArgs rectPolygonMeasureArgs = new PolygonMeasureArgs();
-            rectPolygonMeasureArgs.LineColor = Colors.Red;
-            rectPolygonMeasureArgs.IsOnlyDrawRect = true;
-            rectPolygonMeasureArgs.LineWidth = 2;
-            rectPolygonMeasureArgs.Transparency = 1;
-            rectPolygonMeasureArgs.FontColor = Colors.Red;
-            rectPolygonMeasureArgs.FillColor = Colors.Transparent;
-            rectPolygonMeasureArgs.FontName = "Arial";
-            rectPolygonMeasureArgs.FontSize = 14;
-            pdfViewer?.ClearSelectAnnots();
-            pdfViewer?.SetMouseMode(MouseModes.AnnotCreate);
-            pdfViewer?.SetToolParam(rectPolygonMeasureArgs);
-            measureControl.SetMeasureInfoType(CPDFMeasureType.CPDF_AREA_MEASURE);
-            measureControl.SetInfoPanelVisble(true, false);
-            measureControl.SetMeasureScale(CPDFMeasureType.CPDF_AREA_MEASURE,
-             string.Format("{0}{1}={2}{3}",
-                         MeasureSetting.RulerBase,
-                         MeasureSetting.RulerBaseUnit,
-                         MeasureSetting.RulerTranslate,
-                         MeasureSetting.RulerTranslateUnit));
-            return rectPolygonMeasureArgs;
-        }
-
-        #endregion
+        //#region Create Form
+
+        //private AnnotHandlerEventArgs CreateLine()
+        //{
+        //    LineMeasureArgs lineMeasureArgs = new LineMeasureArgs();
+        //    lineMeasureArgs.LineColor = Colors.Red;
+        //    lineMeasureArgs.LineWidth = 2;
+        //    lineMeasureArgs.Transparency = 1;
+        //    lineMeasureArgs.FontColor = Colors.Red;
+        //    lineMeasureArgs.FontName = "Arial";
+        //    lineMeasureArgs.FontSize = 14;
+        //    lineMeasureArgs.HeadLineType = C_LINE_TYPE.LINETYPE_ARROW;
+        //    lineMeasureArgs.TailLineType = C_LINE_TYPE.LINETYPE_ARROW;
+        //    pdfViewer?.ClearSelectAnnots();
+        //    pdfViewer?.SetMouseMode(MouseModes.AnnotCreate);
+        //    pdfViewer?.SetToolParam(lineMeasureArgs);
+        //    measureControl.SetMeasureInfoType(CPDFMeasureType.CPDF_DISTANCE_MEASURE);
+        //    measureControl.SetInfoPanelVisble(true, false);
+        //    measureControl.SetMeasureScale(CPDFMeasureType.CPDF_DISTANCE_MEASURE,
+        //        string.Format("{0}{1}={2}{3}",
+        //                    MeasureSetting.RulerBase,
+        //                    MeasureSetting.RulerBaseUnit,
+        //                    MeasureSetting.RulerTranslate,
+        //                    MeasureSetting.RulerTranslateUnit));
+        //    return lineMeasureArgs;
+        //}
+
+        //private AnnotHandlerEventArgs CreateMultiline()
+        //{
+
+        //    PolyLineMeasureArgs polyLineMeasureArgs = new PolyLineMeasureArgs();
+        //    polyLineMeasureArgs.LineColor = Colors.Red;
+        //    polyLineMeasureArgs.LineWidth = 2;
+        //    polyLineMeasureArgs.Transparency = 1;
+        //    polyLineMeasureArgs.FontColor = Colors.Red;
+        //    polyLineMeasureArgs.FontName = "Arial";
+        //    polyLineMeasureArgs.FontSize = 14;
+        //    pdfViewer?.ClearSelectAnnots();
+        //    pdfViewer?.SetMouseMode(MouseModes.AnnotCreate);
+        //    pdfViewer?.SetToolParam(polyLineMeasureArgs);
+        //    measureControl.SetMeasureInfoType(CPDFMeasureType.CPDF_PERIMETER_MEASURE);
+        //    measureControl.SetInfoPanelVisble(true, false);
+        //    measureControl.SetMeasureScale(CPDFMeasureType.CPDF_PERIMETER_MEASURE,
+        //       string.Format("{0}{1}={2}{3}",
+        //                   MeasureSetting.RulerBase,
+        //                   MeasureSetting.RulerBaseUnit,
+        //                   MeasureSetting.RulerTranslate,
+        //                   MeasureSetting.RulerTranslateUnit));
+        //    return polyLineMeasureArgs;
+        //}
+
+        //private AnnotHandlerEventArgs CreatePolygonal()
+        //{
+        //    PolygonMeasureArgs polygonMeasureArgs = new PolygonMeasureArgs();
+        //    polygonMeasureArgs.LineColor = Colors.Red;
+        //    polygonMeasureArgs.LineWidth = 2;
+        //    polygonMeasureArgs.Transparency = 1;
+        //    polygonMeasureArgs.FontColor = Colors.Red;
+        //    polygonMeasureArgs.FillColor = Colors.Transparent;
+        //    polygonMeasureArgs.FontName = "Arial";
+        //    polygonMeasureArgs.FontSize = 14;
+        //    pdfViewer?.ClearSelectAnnots();
+        //    pdfViewer?.SetMouseMode(MouseModes.AnnotCreate);
+        //    pdfViewer?.SetToolParam(polygonMeasureArgs);
+        //    measureControl.SetMeasureInfoType(CPDFMeasureType.CPDF_AREA_MEASURE);
+        //    measureControl.SetInfoPanelVisble(true, false);
+        //    measureControl.SetMeasureScale(CPDFMeasureType.CPDF_AREA_MEASURE,
+        //      string.Format("{0}{1}={2}{3}",
+        //                  MeasureSetting.RulerBase,
+        //                  MeasureSetting.RulerBaseUnit,
+        //                  MeasureSetting.RulerTranslate,
+        //                  MeasureSetting.RulerTranslateUnit));
+        //    return polygonMeasureArgs;
+        //}
+
+        //private AnnotHandlerEventArgs CreateRectangles()
+        //{
+
+        //    PolygonMeasureArgs rectPolygonMeasureArgs = new PolygonMeasureArgs();
+        //    rectPolygonMeasureArgs.LineColor = Colors.Red;
+        //    rectPolygonMeasureArgs.IsOnlyDrawRect = true;
+        //    rectPolygonMeasureArgs.LineWidth = 2;
+        //    rectPolygonMeasureArgs.Transparency = 1;
+        //    rectPolygonMeasureArgs.FontColor = Colors.Red;
+        //    rectPolygonMeasureArgs.FillColor = Colors.Transparent;
+        //    rectPolygonMeasureArgs.FontName = "Arial";
+        //    rectPolygonMeasureArgs.FontSize = 14;
+        //    pdfViewer?.ClearSelectAnnots();
+        //    pdfViewer?.SetMouseMode(MouseModes.AnnotCreate);
+        //    pdfViewer?.SetToolParam(rectPolygonMeasureArgs);
+        //    measureControl.SetMeasureInfoType(CPDFMeasureType.CPDF_AREA_MEASURE);
+        //    measureControl.SetInfoPanelVisble(true, false);
+        //    measureControl.SetMeasureScale(CPDFMeasureType.CPDF_AREA_MEASURE,
+        //     string.Format("{0}{1}={2}{3}",
+        //                 MeasureSetting.RulerBase,
+        //                 MeasureSetting.RulerBaseUnit,
+        //                 MeasureSetting.RulerTranslate,
+        //                 MeasureSetting.RulerTranslateUnit));
+        //    return rectPolygonMeasureArgs;
+        //}
+
+        //#endregion
 
 
     }

+ 246 - 250
Demo/Examples/Compdfkit_Tools/Measure/MeasureControl.xaml.cs

@@ -3,8 +3,6 @@ using ComPDFKit.PDFAnnotation;
 using Compdfkit_Tools.Helper;
 using Compdfkit_Tools.PDFControl;
 using ComPDFKitViewer;
-using ComPDFKitViewer.AnnotEvent;
-using ComPDFKitViewer.PdfViewer;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
@@ -43,268 +41,266 @@ namespace Compdfkit_Tools.Measure
         public MeasureControl()
         {
             InitializeComponent();
-            MeasureSetting.MeasureChanged += MeasureSetting_MeasureChanged;
+            //MeasureSetting.MeasureChanged += MeasureSetting_MeasureChanged;
         }
 
-        private void MeasureSetting_MeasureChanged(object sender, MeasureEventArgs e)
-        {
-            InfoPanel.SetMeasureType(e.Type);
-            InfoPanel.SetMeasureInfo(e);
-
-            switch (e.Type)
-            {
-                case CPDFMeasureType.CPDF_DISTANCE_MEASURE:
-                case CPDFMeasureType.CPDF_PERIMETER_MEASURE:
-                    SettingPanel.ShowAreaAndLength(Visibility.Collapsed);
-                    break;
-                case CPDFMeasureType.CPDF_AREA_MEASURE:
-                    SettingPanel.ShowAreaAndLength(Visibility.Visible);
-                    break;
-                default:
-                    break;
-            }
-
-            SettingPanel.BindMeasureSetting(e);
-        }
+        //private void MeasureSetting_MeasureChanged(object sender, MeasureEventArgs e)
+        //{
+        //    InfoPanel.SetMeasureType(e.Type);
+        //    InfoPanel.SetMeasureInfo(e);
+
+        //    switch (e.Type)
+        //    {
+        //        case CPDFMeasureType.CPDF_DISTANCE_MEASURE:
+        //        case CPDFMeasureType.CPDF_PERIMETER_MEASURE:
+        //            SettingPanel.ShowAreaAndLength(Visibility.Collapsed);
+        //            break;
+        //        case CPDFMeasureType.CPDF_AREA_MEASURE:
+        //            SettingPanel.ShowAreaAndLength(Visibility.Visible);
+        //            break;
+        //        default:
+        //            break;
+        //    }
+
+        //    SettingPanel.BindMeasureSetting(e);
+        //}
         #region Init PDFViewer
 
-        public void InitWithPDFViewer(PDFViewControl pdfViewControl, CPDFViewer pdfViewer)
+        public void InitWithPDFViewer(PDFViewControl pdfViewControl)
         {
             PdfViewControl = pdfViewControl;
-            PdfViewControl.PDFView = pdfViewer;
-            PDFMeasureTool.InitWithPDFViewer(pdfViewer, measurePropertyControl, this);
-            FloatPageTool.InitWithPDFViewer(pdfViewer);
+            //PdfViewControl.PDFView = pdfViewer;
+            PDFMeasureTool.InitWithPDFViewer(pdfViewControl, measurePropertyControl, this);
+            FloatPageTool.InitWithPDFViewer(pdfViewControl);
             PDFGrid.Child = PdfViewControl;
 
             panelState.PropertyChanged -= PanelState_PropertyChanged;
             panelState.PropertyChanged += PanelState_PropertyChanged;
-            pdfViewControl.PDFView.AnnotActiveHandler -= PDFView_AnnotActiveHandler;
-            pdfViewControl.PDFView.AnnotActiveHandler += PDFView_AnnotActiveHandler;
-            pdfViewControl.PDFView.AnnotCommandHandler -= PDFView_AnnotCommandHandler;
-            pdfViewControl.PDFView.AnnotCommandHandler += PDFView_AnnotCommandHandler;
+            //pdfViewControl.PDFView.AnnotActiveHandler -= PDFView_AnnotActiveHandler;
+            //pdfViewControl.PDFView.AnnotActiveHandler += PDFView_AnnotActiveHandler;
+            //pdfViewControl.PDFView.AnnotCommandHandler -= PDFView_AnnotCommandHandler;
+            //pdfViewControl.PDFView.AnnotCommandHandler += PDFView_AnnotCommandHandler;
             SetInfoPanelVisble(false, false);
             SettingPanel.PdfViewControl= pdfViewControl;
         }
 
-        private void PDFView_AnnotCommandHandler(object sender, AnnotCommandArgs e)
-        {
-            switch (e.CommandType)
-            {
-                case CommandType.Context:
-                    if (e.CommandTarget == TargetType.Annot && e.PressOnAnnot)
-                    {
-                        e.Handle = true;
-                        e.PopupMenu = new ContextMenu();
-                        e.PopupMenu.Items.Add(new MenuItem() { Header = "Delete", Command = ApplicationCommands.Delete, CommandTarget = (UIElement)sender });
-                        MenuItem menuItem = new MenuItem();
-                        menuItem.Header = "Measurement Settings";
-                        menuItem.Click += (item, param) =>
-                        {
-                            SettingPanel.UpdateArgsList = e.AnnotEventArgsList;
-                            SettingPanel.BindMeasureSetting();
-                            SetInfoPanelVisble(false, true);
-                        };
-
-                        MenuItem propertyItem = new MenuItem();
-                        propertyItem.Header = "Properties";
-                        propertyItem.Click += (item, param) =>
-                        {
-                            ExpandEvent?.Invoke(this, new EventArgs());
-                        };
-                        e.PopupMenu.Items.Add(menuItem);
-                        e.PopupMenu.Items.Add(propertyItem);
-                    }
-                    break;
-
-                case CommandType.Delete:
-                    e.DoCommand();
-                    break;
-                default:
-                    break;
-            }
-        }
-
-
-
-        private void PDFView_AnnotActiveHandler(object sender, AnnotAttribEvent e)
-        {
-            if (e == null || e.IsAnnotCreateReset)
-            {
-                if (e == null)
-                {
-                    measurePropertyControl?.ClearMeasurePanel();
-                    if(PDFMeasureTool.ToolChecked()==false)
-                    {
-                        SetInfoPanelVisble(false, false);
-                    }
-                }
-                return;
-            }
-            else
-            {
-                switch (e.GetAnnotTypes())
-                {
-                    case AnnotArgsType.LineMeasure:
-                        LineMeasureArgs LineArgs = e.GetAnnotHandlerEventArgs(AnnotArgsType.LineMeasure).First() as LineMeasureArgs;
-                        panelState.RightPanel = PanelState.RightPanelState.PropertyPanel;
-                        measurePropertyControl.SetPropertyForMeasureCreate(LineArgs, e);
-                        SetInfoPanelVisble(true, false);
-                        SetMeasureInfoPanel(LineArgs.GetPDFAnnot(), LineArgs);
-                        break;
-                    case AnnotArgsType.PolygonMeasure:
-                        PolygonMeasureArgs polygonArgs = e.GetAnnotHandlerEventArgs(AnnotArgsType.PolygonMeasure).First() as PolygonMeasureArgs;
-                        panelState.RightPanel = PanelState.RightPanelState.PropertyPanel;
-                        measurePropertyControl.SetPropertyForMeasureCreate(polygonArgs, e);
-                        SetInfoPanelVisble(true, false);
-                        SetMeasureInfoPanel(polygonArgs.GetPDFAnnot(),polygonArgs);
-                        break;
-
-                    case AnnotArgsType.PolyLineMeasure:
-                        PolyLineMeasureArgs polyLineArgs = e.GetAnnotHandlerEventArgs(AnnotArgsType.PolyLineMeasure).First() as PolyLineMeasureArgs;
-                        panelState.RightPanel = PanelState.RightPanelState.PropertyPanel;
-                        measurePropertyControl.SetPropertyForMeasureCreate(polyLineArgs, e);
-                        SetInfoPanelVisble(true, false);
-                        SetMeasureInfoPanel(polyLineArgs.GetPDFAnnot(),polyLineArgs);
-                        break;
-                }
-            }
-        }
-
-        private void SetMeasureInfoPanel(CPDFAnnotation rawAnnot,AnnotHandlerEventArgs annotArgs=null)
-        {
-            if (rawAnnot == null)
-            {
-                return;
-            }
-            try
-            {
-                if (rawAnnot.Type == C_ANNOTATION_TYPE.C_ANNOTATION_LINE)
-                {
-                    CPDFLineAnnotation lineAnnot = rawAnnot as CPDFLineAnnotation;
-                    if (lineAnnot.IsMersured() && lineAnnot.Points != null && lineAnnot.Points.Count() == 2)
-                    {
-                        CPDFDistanceMeasure lineMeasure = lineAnnot.GetDistanceMeasure();
-                        CPDFMeasureInfo measureInfo = lineMeasure.MeasureInfo;
-                        Vector standVector = new Vector(1, 0);
-                        Point startPoint = new Point(lineAnnot.Points[0].x, lineAnnot.Points[0].y);
-                        Point endPoint = new Point(lineAnnot.Points[1].x, lineAnnot.Points[1].y);
-                        Vector movevector = endPoint - startPoint;
-
-                        double showLenght=lineMeasure.GetMeasurementResults(CPDFCaptionType.CPDF_CAPTION_LENGTH);
-                        MeasureEventArgs measureEvent = new MeasureEventArgs();
-                        measureEvent.Angle = (int)Math.Abs(Vector.AngleBetween(movevector, standVector));
-                        measureEvent.RulerTranslateUnit = measureInfo.RulerTranslateUnit;
-                        measureEvent.RulerTranslate = measureInfo.RulerTranslate;
-                        measureEvent.RulerBase = measureInfo.RulerBase;
-                        measureEvent.RulerBaseUnit = measureInfo.RulerBaseUnit;
-                        measureEvent.MousePos = new Point(
-                           (int)Math.Abs(movevector.X),
-                           (int)Math.Abs(movevector.Y));
-                        measureEvent.Type = CPDFMeasureType.CPDF_DISTANCE_MEASURE;
-                        NumberFormatInfo formatInfo = new NumberFormatInfo();
-                        formatInfo.NumberDecimalDigits = Math.Abs(measureInfo.Precision).ToString().Length - 1;
-                        measureEvent.Distance = showLenght.ToString("N", formatInfo) + " " + measureInfo.RulerTranslateUnit;
-                        measureEvent.Precision = GetMeasureShowPrecision(measureInfo.Precision);
-
-                        MeasureSetting.InvokeMeasureChangeEvent(this, measureEvent);
-                        if(annotArgs!=null)
-                        {
-                            SettingPanel.UpdateArgsList =new List<AnnotHandlerEventArgs> { annotArgs};
-                        }
-                    }
-                }
-
-                if (rawAnnot.Type == C_ANNOTATION_TYPE.C_ANNOTATION_POLYLINE)
-                {
-                    CPDFPolylineAnnotation polylineAnnot = rawAnnot as CPDFPolylineAnnotation;
-                    if (polylineAnnot.IsMersured() && polylineAnnot.Points != null && polylineAnnot.Points.Count() >= 2)
-                    {
-                        double totalInch = 0;
-                        for (int i = 0; i < polylineAnnot.Points.Count - 1; i++)
-                        {
-                            Point endLinePoint = new Point(
-                                polylineAnnot.Points[i + 1].x,
-                                polylineAnnot.Points[i + 1].y
-                                );
-                            Point startLinePoint = new Point(
-                                polylineAnnot.Points[i].x,
-                                polylineAnnot.Points[i].y
-                                );
-                            Vector subVector = endLinePoint - startLinePoint;
-                            totalInch += subVector.Length;
-                        }
-                        totalInch = totalInch / 72D;
-                        CPDFPerimeterMeasure lineMeasure = polylineAnnot.GetPerimeterMeasure();
-                        CPDFMeasureInfo measureInfo = lineMeasure.MeasureInfo;
-                        double showLenght = lineMeasure.GetMeasurementResults(CPDFCaptionType.CPDF_CAPTION_LENGTH);
-
-                        MeasureEventArgs measureEvent = new MeasureEventArgs();
-                        measureEvent.Angle = 0;
-                        measureEvent.RulerTranslateUnit = measureInfo.RulerTranslateUnit;
-                        measureEvent.RulerTranslate = measureInfo.RulerTranslate;
-                        measureEvent.RulerBase = measureInfo.RulerBase;
-                        measureEvent.RulerBaseUnit = measureInfo.RulerBaseUnit;
-                        measureEvent.Precision = GetMeasureShowPrecision(measureInfo.Precision);
-                        measureEvent.Type = CPDFMeasureType.CPDF_PERIMETER_MEASURE;
-                        NumberFormatInfo formatInfo = new NumberFormatInfo();
-                        formatInfo.NumberDecimalDigits = Math.Abs(measureInfo.Precision).ToString().Length - 1;
-                        measureEvent.Distance = showLenght.ToString("N", formatInfo) +" "+ measureInfo.RulerTranslateUnit;
-                        MeasureSetting.InvokeMeasureChangeEvent(this, measureEvent);
-                        if (annotArgs != null)
-                        {
-                            SettingPanel.UpdateArgsList = new List<AnnotHandlerEventArgs> { annotArgs };
-                        }
-                    }
-                }
-
-                if(rawAnnot.Type== C_ANNOTATION_TYPE.C_ANNOTATION_POLYGON)
-                {
-                    CPDFPolygonAnnotation Annot = rawAnnot as CPDFPolygonAnnotation;
-                    CPDFAreaMeasure polygonMeasure = Annot.GetAreaMeasure();
-                    CPDFMeasureInfo measureInfo = polygonMeasure.MeasureInfo;
-                    CPDFCaptionType CaptionType = measureInfo.CaptionType;
-                    bool IsArea = false;
-                    bool IsLength = false;
-                    if ((CaptionType& CPDFCaptionType.CPDF_CAPTION_AREA)== CPDFCaptionType.CPDF_CAPTION_AREA)
-                    {
-                        IsArea = true;
-                    }
-                    if ((CaptionType & CPDFCaptionType.CPDF_CAPTION_LENGTH) == CPDFCaptionType.CPDF_CAPTION_LENGTH)
-                    {
-                        IsLength = true;
-                    }
-                    SettingPanel.ChangedCheckBoxIsChecked(IsArea, IsLength);
-
-                    double inch = polygonMeasure.GetMeasurementResults(CPDFCaptionType.CPDF_CAPTION_AREA);
-                    double currentInch = polygonMeasure.GetMeasurementResults(CPDFCaptionType.CPDF_CAPTION_LENGTH);
-
-                    MeasureEventArgs measureEvent = new MeasureEventArgs();
-                    measureEvent.RulerTranslateUnit = measureInfo.RulerTranslateUnit;
-                    measureEvent.RulerTranslate = measureInfo.RulerTranslate;
-                    measureEvent.RulerBase = measureInfo.RulerBase;
-                    measureEvent.RulerBaseUnit = measureInfo.RulerBaseUnit;
-                    measureEvent.Precision = GetMeasureShowPrecision(measureInfo.Precision);
-                    measureEvent.Type = CPDFMeasureType.CPDF_AREA_MEASURE;
-
-
-                    NumberFormatInfo formatInfo = new NumberFormatInfo();
-                    formatInfo.NumberDecimalDigits = Math.Abs(measureInfo.Precision).ToString().Length - 1;
-
-                    measureEvent.Distance = currentInch.ToString("N", formatInfo) + " " + measureInfo.RulerTranslateUnit;
-                    measureEvent.Area = inch.ToString("N", formatInfo) + " sq " + measureInfo.RulerTranslateUnit;
-
-                    MeasureSetting.InvokeMeasureChangeEvent(this, measureEvent);
-                    if (annotArgs != null)
-                    {
-                        SettingPanel.UpdateArgsList = new List<AnnotHandlerEventArgs> { annotArgs };
-                    }
-                }
-            }
-            catch (Exception e)
-            {
-
-            }
-        }
+        //private void PDFView_AnnotCommandHandler(object sender, AnnotCommandArgs e)
+        //{
+        //    switch (e.CommandType)
+        //    {
+        //        case CommandType.Context:
+        //            if (e.CommandTarget == TargetType.Annot && e.PressOnAnnot)
+        //            {
+        //                e.Handle = true;
+        //                e.PopupMenu = new ContextMenu();
+        //                e.PopupMenu.Items.Add(new MenuItem() { Header = "Delete", Command = ApplicationCommands.Delete, CommandTarget = (UIElement)sender });
+        //                MenuItem menuItem = new MenuItem();
+        //                menuItem.Header = "Measurement Settings";
+        //                menuItem.Click += (item, param) =>
+        //                {
+        //                    SettingPanel.UpdateArgsList = e.AnnotEventArgsList;
+        //                    SettingPanel.BindMeasureSetting();
+        //                    SetInfoPanelVisble(false, true);
+        //                };
+
+        //                MenuItem propertyItem = new MenuItem();
+        //                propertyItem.Header = "Properties";
+        //                propertyItem.Click += (item, param) =>
+        //                {
+        //                    ExpandEvent?.Invoke(this, new EventArgs());
+        //                };
+        //                e.PopupMenu.Items.Add(menuItem);
+        //                e.PopupMenu.Items.Add(propertyItem);
+        //            }
+        //            break;
+
+        //        case CommandType.Delete:
+        //            e.DoCommand();
+        //            break;
+        //        default:
+        //            break;
+        //    }
+        //}
+
+        //private void PDFView_AnnotActiveHandler(object sender, AnnotAttribEvent e)
+        //{
+        //    if (e == null || e.IsAnnotCreateReset)
+        //    {
+        //        if (e == null)
+        //        {
+        //            measurePropertyControl?.ClearMeasurePanel();
+        //            if(PDFMeasureTool.ToolChecked()==false)
+        //            {
+        //                SetInfoPanelVisble(false, false);
+        //            }
+        //        }
+        //        return;
+        //    }
+        //    else
+        //    {
+        //        switch (e.GetAnnotTypes())
+        //        {
+        //            case AnnotArgsType.LineMeasure:
+        //                LineMeasureArgs LineArgs = e.GetAnnotHandlerEventArgs(AnnotArgsType.LineMeasure).First() as LineMeasureArgs;
+        //                panelState.RightPanel = PanelState.RightPanelState.PropertyPanel;
+        //                measurePropertyControl.SetPropertyForMeasureCreate(LineArgs, e);
+        //                SetInfoPanelVisble(true, false);
+        //                SetMeasureInfoPanel(LineArgs.GetPDFAnnot(), LineArgs);
+        //                break;
+        //            case AnnotArgsType.PolygonMeasure:
+        //                PolygonMeasureArgs polygonArgs = e.GetAnnotHandlerEventArgs(AnnotArgsType.PolygonMeasure).First() as PolygonMeasureArgs;
+        //                panelState.RightPanel = PanelState.RightPanelState.PropertyPanel;
+        //                measurePropertyControl.SetPropertyForMeasureCreate(polygonArgs, e);
+        //                SetInfoPanelVisble(true, false);
+        //                SetMeasureInfoPanel(polygonArgs.GetPDFAnnot(),polygonArgs);
+        //                break;
+
+        //            case AnnotArgsType.PolyLineMeasure:
+        //                PolyLineMeasureArgs polyLineArgs = e.GetAnnotHandlerEventArgs(AnnotArgsType.PolyLineMeasure).First() as PolyLineMeasureArgs;
+        //                panelState.RightPanel = PanelState.RightPanelState.PropertyPanel;
+        //                measurePropertyControl.SetPropertyForMeasureCreate(polyLineArgs, e);
+        //                SetInfoPanelVisble(true, false);
+        //                SetMeasureInfoPanel(polyLineArgs.GetPDFAnnot(),polyLineArgs);
+        //                break;
+        //        }
+        //    }
+        //}
+
+        //private void SetMeasureInfoPanel(CPDFAnnotation rawAnnot,AnnotHandlerEventArgs annotArgs=null)
+        //{
+        //    if (rawAnnot == null)
+        //    {
+        //        return;
+        //    }
+        //    try
+        //    {
+        //        if (rawAnnot.Type == C_ANNOTATION_TYPE.C_ANNOTATION_LINE)
+        //        {
+        //            CPDFLineAnnotation lineAnnot = rawAnnot as CPDFLineAnnotation;
+        //            if (lineAnnot.IsMersured() && lineAnnot.Points != null && lineAnnot.Points.Count() == 2)
+        //            {
+        //                CPDFDistanceMeasure lineMeasure = lineAnnot.GetDistanceMeasure();
+        //                CPDFMeasureInfo measureInfo = lineMeasure.MeasureInfo;
+        //                Vector standVector = new Vector(1, 0);
+        //                Point startPoint = new Point(lineAnnot.Points[0].x, lineAnnot.Points[0].y);
+        //                Point endPoint = new Point(lineAnnot.Points[1].x, lineAnnot.Points[1].y);
+        //                Vector movevector = endPoint - startPoint;
+
+        //                double showLenght=lineMeasure.GetMeasurementResults(CPDFCaptionType.CPDF_CAPTION_LENGTH);
+        //                MeasureEventArgs measureEvent = new MeasureEventArgs();
+        //                measureEvent.Angle = (int)Math.Abs(Vector.AngleBetween(movevector, standVector));
+        //                measureEvent.RulerTranslateUnit = measureInfo.RulerTranslateUnit;
+        //                measureEvent.RulerTranslate = measureInfo.RulerTranslate;
+        //                measureEvent.RulerBase = measureInfo.RulerBase;
+        //                measureEvent.RulerBaseUnit = measureInfo.RulerBaseUnit;
+        //                measureEvent.MousePos = new Point(
+        //                   (int)Math.Abs(movevector.X),
+        //                   (int)Math.Abs(movevector.Y));
+        //                measureEvent.Type = CPDFMeasureType.CPDF_DISTANCE_MEASURE;
+        //                NumberFormatInfo formatInfo = new NumberFormatInfo();
+        //                formatInfo.NumberDecimalDigits = Math.Abs(measureInfo.Precision).ToString().Length - 1;
+        //                measureEvent.Distance = showLenght.ToString("N", formatInfo) + " " + measureInfo.RulerTranslateUnit;
+        //                measureEvent.Precision = GetMeasureShowPrecision(measureInfo.Precision);
+
+        //                MeasureSetting.InvokeMeasureChangeEvent(this, measureEvent);
+        //                if(annotArgs!=null)
+        //                {
+        //                    SettingPanel.UpdateArgsList =new List<AnnotHandlerEventArgs> { annotArgs};
+        //                }
+        //            }
+        //        }
+
+        //        if (rawAnnot.Type == C_ANNOTATION_TYPE.C_ANNOTATION_POLYLINE)
+        //        {
+        //            CPDFPolylineAnnotation polylineAnnot = rawAnnot as CPDFPolylineAnnotation;
+        //            if (polylineAnnot.IsMersured() && polylineAnnot.Points != null && polylineAnnot.Points.Count() >= 2)
+        //            {
+        //                double totalInch = 0;
+        //                for (int i = 0; i < polylineAnnot.Points.Count - 1; i++)
+        //                {
+        //                    Point endLinePoint = new Point(
+        //                        polylineAnnot.Points[i + 1].x,
+        //                        polylineAnnot.Points[i + 1].y
+        //                        );
+        //                    Point startLinePoint = new Point(
+        //                        polylineAnnot.Points[i].x,
+        //                        polylineAnnot.Points[i].y
+        //                        );
+        //                    Vector subVector = endLinePoint - startLinePoint;
+        //                    totalInch += subVector.Length;
+        //                }
+        //                totalInch = totalInch / 72D;
+        //                CPDFPerimeterMeasure lineMeasure = polylineAnnot.GetPerimeterMeasure();
+        //                CPDFMeasureInfo measureInfo = lineMeasure.MeasureInfo;
+        //                double showLenght = lineMeasure.GetMeasurementResults(CPDFCaptionType.CPDF_CAPTION_LENGTH);
+
+        //                MeasureEventArgs measureEvent = new MeasureEventArgs();
+        //                measureEvent.Angle = 0;
+        //                measureEvent.RulerTranslateUnit = measureInfo.RulerTranslateUnit;
+        //                measureEvent.RulerTranslate = measureInfo.RulerTranslate;
+        //                measureEvent.RulerBase = measureInfo.RulerBase;
+        //                measureEvent.RulerBaseUnit = measureInfo.RulerBaseUnit;
+        //                measureEvent.Precision = GetMeasureShowPrecision(measureInfo.Precision);
+        //                measureEvent.Type = CPDFMeasureType.CPDF_PERIMETER_MEASURE;
+        //                NumberFormatInfo formatInfo = new NumberFormatInfo();
+        //                formatInfo.NumberDecimalDigits = Math.Abs(measureInfo.Precision).ToString().Length - 1;
+        //                measureEvent.Distance = showLenght.ToString("N", formatInfo) +" "+ measureInfo.RulerTranslateUnit;
+        //                MeasureSetting.InvokeMeasureChangeEvent(this, measureEvent);
+        //                if (annotArgs != null)
+        //                {
+        //                    SettingPanel.UpdateArgsList = new List<AnnotHandlerEventArgs> { annotArgs };
+        //                }
+        //            }
+        //        }
+
+        //        if(rawAnnot.Type== C_ANNOTATION_TYPE.C_ANNOTATION_POLYGON)
+        //        {
+        //            CPDFPolygonAnnotation Annot = rawAnnot as CPDFPolygonAnnotation;
+        //            CPDFAreaMeasure polygonMeasure = Annot.GetAreaMeasure();
+        //            CPDFMeasureInfo measureInfo = polygonMeasure.MeasureInfo;
+        //            CPDFCaptionType CaptionType = measureInfo.CaptionType;
+        //            bool IsArea = false;
+        //            bool IsLength = false;
+        //            if ((CaptionType& CPDFCaptionType.CPDF_CAPTION_AREA)== CPDFCaptionType.CPDF_CAPTION_AREA)
+        //            {
+        //                IsArea = true;
+        //            }
+        //            if ((CaptionType & CPDFCaptionType.CPDF_CAPTION_LENGTH) == CPDFCaptionType.CPDF_CAPTION_LENGTH)
+        //            {
+        //                IsLength = true;
+        //            }
+        //            SettingPanel.ChangedCheckBoxIsChecked(IsArea, IsLength);
+
+        //            double inch = polygonMeasure.GetMeasurementResults(CPDFCaptionType.CPDF_CAPTION_AREA);
+        //            double currentInch = polygonMeasure.GetMeasurementResults(CPDFCaptionType.CPDF_CAPTION_LENGTH);
+
+        //            MeasureEventArgs measureEvent = new MeasureEventArgs();
+        //            measureEvent.RulerTranslateUnit = measureInfo.RulerTranslateUnit;
+        //            measureEvent.RulerTranslate = measureInfo.RulerTranslate;
+        //            measureEvent.RulerBase = measureInfo.RulerBase;
+        //            measureEvent.RulerBaseUnit = measureInfo.RulerBaseUnit;
+        //            measureEvent.Precision = GetMeasureShowPrecision(measureInfo.Precision);
+        //            measureEvent.Type = CPDFMeasureType.CPDF_AREA_MEASURE;
+
+
+        //            NumberFormatInfo formatInfo = new NumberFormatInfo();
+        //            formatInfo.NumberDecimalDigits = Math.Abs(measureInfo.Precision).ToString().Length - 1;
+
+        //            measureEvent.Distance = currentInch.ToString("N", formatInfo) + " " + measureInfo.RulerTranslateUnit;
+        //            measureEvent.Area = inch.ToString("N", formatInfo) + " sq " + measureInfo.RulerTranslateUnit;
+
+        //            MeasureSetting.InvokeMeasureChangeEvent(this, measureEvent);
+        //            if (annotArgs != null)
+        //            {
+        //                SettingPanel.UpdateArgsList = new List<AnnotHandlerEventArgs> { annotArgs };
+        //            }
+        //        }
+        //    }
+        //    catch (Exception e)
+        //    {
+
+        //    }
+        //}
 
         private double GetMeasureRatio(string baseUnit)
         {

+ 46 - 48
Demo/Examples/Compdfkit_Tools/Measure/MeasureInfoPanel.xaml.cs

@@ -1,6 +1,4 @@
 using ComPDFKit.Measure;
-using ComPDFKitViewer.AnnotEvent;
-using ComPDFKitViewer.PdfViewer;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
@@ -131,52 +129,52 @@ namespace Compdfkit_Tools.Measure
             AnglePolygonText.Text = string.Empty;
         }
 
-        public void SetMeasureInfo(MeasureEventArgs info)
-        {
-            switch(info.Type)
-            {
-                case CPDFMeasureType.CPDF_DISTANCE_MEASURE:
-                    {
-                        DistanceText.Text=info.Distance;
-                        PrecisionText.Text= ((decimal)info.Precision).ToString();
-                        AngleText.Text = info.Angle.ToString()+"°";
-                        XText.Text=info.MousePos.X.ToString();
-                        YText.Text=info.MousePos.Y.ToString();
-                        ScaleText.Text = string.Format("{0} {1} = {2} {3}",
-                            info.RulerBase,
-                            info.RulerBaseUnit,
-                            info.RulerTranslate,
-                            info.RulerTranslateUnit);
-                    }
-                    break;
-                case CPDFMeasureType.CPDF_PERIMETER_MEASURE:
-                    {
-                        DistancePolyLineText.Text = info.Distance;
-                        PrecisionPolyLineText.Text = ((decimal)info.Precision).ToString();
-                        AnglePolyLineText.Text = info.Angle.ToString() + "°";
-                        ScalePolyLineText.Text = string.Format("{0} {1} = {2} {3}",
-                            info.RulerBase,
-                            info.RulerBaseUnit,
-                            info.RulerTranslate,
-                            info.RulerTranslateUnit);
-                    }
-                    break;
-                case CPDFMeasureType.CPDF_AREA_MEASURE:
-                    {
-                        RoundPolygonText.Text = info.Area;
-                        PrecisionPolygonText.Text = ((decimal)info.Precision).ToString();
-                        AnglePolygonText.Text = info.Angle.ToString() + "°";
-                        ScalePolygonText.Text = string.Format("{0} {1} = {2} {3}",
-                            info.RulerBase,
-                            info.RulerBaseUnit, 
-                            info.RulerTranslate,
-                            info.RulerTranslateUnit);
-                    }
-                    break;
-                default:
-                    break;
-            }
-        }
+        //public void SetMeasureInfo(MeasureEventArgs info)
+        //{
+        //    switch(info.Type)
+        //    {
+        //        case CPDFMeasureType.CPDF_DISTANCE_MEASURE:
+        //            {
+        //                DistanceText.Text=info.Distance;
+        //                PrecisionText.Text= ((decimal)info.Precision).ToString();
+        //                AngleText.Text = info.Angle.ToString()+"°";
+        //                XText.Text=info.MousePos.X.ToString();
+        //                YText.Text=info.MousePos.Y.ToString();
+        //                ScaleText.Text = string.Format("{0} {1} = {2} {3}",
+        //                    info.RulerBase,
+        //                    info.RulerBaseUnit,
+        //                    info.RulerTranslate,
+        //                    info.RulerTranslateUnit);
+        //            }
+        //            break;
+        //        case CPDFMeasureType.CPDF_PERIMETER_MEASURE:
+        //            {
+        //                DistancePolyLineText.Text = info.Distance;
+        //                PrecisionPolyLineText.Text = ((decimal)info.Precision).ToString();
+        //                AnglePolyLineText.Text = info.Angle.ToString() + "°";
+        //                ScalePolyLineText.Text = string.Format("{0} {1} = {2} {3}",
+        //                    info.RulerBase,
+        //                    info.RulerBaseUnit,
+        //                    info.RulerTranslate,
+        //                    info.RulerTranslateUnit);
+        //            }
+        //            break;
+        //        case CPDFMeasureType.CPDF_AREA_MEASURE:
+        //            {
+        //                RoundPolygonText.Text = info.Area;
+        //                PrecisionPolygonText.Text = ((decimal)info.Precision).ToString();
+        //                AnglePolygonText.Text = info.Angle.ToString() + "°";
+        //                ScalePolygonText.Text = string.Format("{0} {1} = {2} {3}",
+        //                    info.RulerBase,
+        //                    info.RulerBaseUnit, 
+        //                    info.RulerTranslate,
+        //                    info.RulerTranslateUnit);
+        //            }
+        //            break;
+        //        default:
+        //            break;
+        //    }
+        //}
         private void TextBlock_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         {
             SettingClick?.Invoke(this, e);

+ 53 - 54
Demo/Examples/Compdfkit_Tools/Measure/MeasurePropertyControl.xaml.cs

@@ -1,6 +1,5 @@
 using Compdfkit_Tools.Measure.Property;
 using Compdfkit_Tools.PDFControl;
-using ComPDFKitViewer.AnnotEvent;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -29,57 +28,57 @@ namespace Compdfkit_Tools.Measure
             InitializeComponent();
         }
 
-        public void SetPropertyForMeasureCreate(AnnotHandlerEventArgs Args, AnnotAttribEvent attribEvent)
-        {
-            if (Args == null)
-            {
-                ClearMeasurePanel();
-                return;
-            }
+        //public void SetPropertyForMeasureCreate(AnnotHandlerEventArgs Args, AnnotAttribEvent attribEvent)
+        //{
+        //    if (Args == null)
+        //    {
+        //        ClearMeasurePanel();
+        //        return;
+        //    }
 
-            switch (Args.EventType)
-            {
-                case AnnotArgsType.LineMeasure:
-                    StraightnessProperty straightnessProperty = new StraightnessProperty();
-                    if (attribEvent != null)
-                    {
-                        straightnessProperty.SetAnnotEventData(attribEvent);
-                    }
-                    else
-                    {
-                        straightnessProperty.SetAnnotArgsData((LineMeasureArgs)Args);
-                    }
-                    currentPanel = straightnessProperty;
-                    break;
-                case AnnotArgsType.PolyLineMeasure:
-                    MultilineProperty multilineProperty = new MultilineProperty();
-                    if (attribEvent != null)
-                    {
-                        multilineProperty.SetAnnotEventData(attribEvent);
-                    }
-                    else
-                    {
-                        multilineProperty.SetAnnotArgsData((PolyLineMeasureArgs)Args);
-                    }
-                    currentPanel = multilineProperty;
-                    break;
-                case AnnotArgsType.PolygonMeasure:
-                    PolygonalProperty polygonalProperty = new PolygonalProperty();
-                    if (attribEvent != null)
-                    {
-                        polygonalProperty.SetAnnotEventData(attribEvent);
-                    }
-                    else
-                    {
-                        polygonalProperty.SetAnnotArgsData((PolygonMeasureArgs)Args);
-                    }
-                    currentPanel = polygonalProperty;
-                    break;
-                default:
-                    break;
-            }
-            SetMeasurePanel(currentPanel);
-        }
+        //    switch (Args.EventType)
+        //    {
+        //        case AnnotArgsType.LineMeasure:
+        //            StraightnessProperty straightnessProperty = new StraightnessProperty();
+        //            if (attribEvent != null)
+        //            {
+        //                straightnessProperty.SetAnnotEventData(attribEvent);
+        //            }
+        //            else
+        //            {
+        //                straightnessProperty.SetAnnotArgsData((LineMeasureArgs)Args);
+        //            }
+        //            currentPanel = straightnessProperty;
+        //            break;
+        //        case AnnotArgsType.PolyLineMeasure:
+        //            MultilineProperty multilineProperty = new MultilineProperty();
+        //            if (attribEvent != null)
+        //            {
+        //                multilineProperty.SetAnnotEventData(attribEvent);
+        //            }
+        //            else
+        //            {
+        //                multilineProperty.SetAnnotArgsData((PolyLineMeasureArgs)Args);
+        //            }
+        //            currentPanel = multilineProperty;
+        //            break;
+        //        case AnnotArgsType.PolygonMeasure:
+        //            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)
         {
@@ -92,9 +91,9 @@ namespace Compdfkit_Tools.Measure
             MeasurePropertyPanel.Child = null;
         }
 
-        public void SetPorpertyForMeasureModify(AnnotAttribEvent annotEvent)
-        {
+        //public void SetPorpertyForMeasureModify(AnnotAttribEvent annotEvent)
+        //{
 
-        }
+        //}
     }
 }

+ 171 - 173
Demo/Examples/Compdfkit_Tools/Measure/MeasureSettingDialog.xaml.cs

@@ -1,7 +1,5 @@
 using ComPDFKit.Measure;
 using ComPDFKit.PDFAnnotation;
-using ComPDFKitViewer.AnnotEvent;
-using ComPDFKitViewer.PdfViewer;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -33,15 +31,15 @@ namespace Compdfkit_Tools.Measure
 
         public bool ReturnToInfoPanel { get; set; }
 
-        public List<AnnotHandlerEventArgs> UpdateArgsList { get; set; } = new List<AnnotHandlerEventArgs>();
+        //public List<AnnotHandlerEventArgs> UpdateArgsList { get; set; } = new List<AnnotHandlerEventArgs>();
 
         private void ButtonCancel_Click(object sender, RoutedEventArgs e)
         {
-            if (UpdateArgsList != null && UpdateArgsList.Count > 0)
-            {
-                ReturnToInfoPanel = false;
-            }
-            UpdateArgsList?.Clear();
+            //if (UpdateArgsList != null && UpdateArgsList.Count > 0)
+            //{
+            //    ReturnToInfoPanel = false;
+            //}
+            //UpdateArgsList?.Clear();
             CancelEvent?.Invoke(this, e);
             ReturnToInfoPanel = false;
             Close();
@@ -50,112 +48,112 @@ namespace Compdfkit_Tools.Measure
         private void ButtonDone_Click(object sender, RoutedEventArgs e)
         {
             SaveMeasureSetting();
-            if (UpdateArgsList != null && UpdateArgsList.Count > 0)
-            {
-                List<AnnotArgsType> allowTypeList = new List<AnnotArgsType>()
-                {
-                    AnnotArgsType.LineMeasure,
-                    AnnotArgsType.PolyLineMeasure,
-                    AnnotArgsType.PolygonMeasure
-                };
+            //if (UpdateArgsList != null && UpdateArgsList.Count > 0)
+            //{
+            //    List<AnnotArgsType> allowTypeList = new List<AnnotArgsType>()
+            //    {
+            //        AnnotArgsType.LineMeasure,
+            //        AnnotArgsType.PolyLineMeasure,
+            //        AnnotArgsType.PolygonMeasure
+            //    };
 
-                foreach (AnnotHandlerEventArgs args in UpdateArgsList)
-                {
-                    if (allowTypeList.Contains(args.EventType))
-                    {
-                        CPDFAnnotation pdfAnnot = args.GetPDFAnnot();
-                        switch (pdfAnnot.Type)
-                        {
-                            case C_ANNOTATION_TYPE.C_ANNOTATION_LINE:
-                                {
-                                    CPDFLineAnnotation lineAnnot = (CPDFLineAnnotation)pdfAnnot;
-                                    if (lineAnnot.IsMersured())
-                                    {
-                                        CPDFDistanceMeasure lineMeasure = lineAnnot.GetDistanceMeasure();
-                                        CPDFMeasureInfo measureInfo = lineMeasure.MeasureInfo;
-                                        measureInfo.Precision = MeasureSetting.GetMeasureSavePrecision();
-                                        measureInfo.RulerBase = (float)MeasureSetting.RulerBase;
-                                        measureInfo.RulerBaseUnit = MeasureSetting.RulerBaseUnit;
-                                        measureInfo.RulerTranslate = (float)MeasureSetting.RulerTranslate;
-                                        measureInfo.RulerTranslateUnit = MeasureSetting.RulerTranslateUnit;
-                                        lineMeasure.SetMeasureInfo(measureInfo);
-                                        lineMeasure.SetMeasureScale(
-                                            measureInfo.RulerBase,
-                                            measureInfo.RulerBaseUnit,
-                                            measureInfo.RulerTranslate,
-                                            measureInfo.RulerTranslateUnit);
-                                        lineMeasure.UpdateAnnotMeasure();
-                                        lineAnnot.UpdateAp();
-                                        args.Draw();
-                                    }
-                                }
-                                break;
-                            case C_ANNOTATION_TYPE.C_ANNOTATION_POLYLINE:
-                                {
-                                    CPDFPolylineAnnotation polylineAnnot = (CPDFPolylineAnnotation)pdfAnnot;
-                                    if (polylineAnnot.IsMersured())
-                                    {
-                                        CPDFPerimeterMeasure polylineMeasure = polylineAnnot.GetPerimeterMeasure();
-                                        CPDFMeasureInfo measureInfo = polylineMeasure.MeasureInfo;
-                                        measureInfo.Precision = MeasureSetting.GetMeasureSavePrecision();
-                                        measureInfo.RulerBase = (float)MeasureSetting.RulerBase;
-                                        measureInfo.RulerBaseUnit = MeasureSetting.RulerBaseUnit;
-                                        measureInfo.RulerTranslate = (float)MeasureSetting.RulerTranslate;
-                                        measureInfo.RulerTranslateUnit = MeasureSetting.RulerTranslateUnit;
-                                        polylineMeasure.SetMeasureInfo(measureInfo);
-                                        polylineMeasure.SetMeasureScale(
-                                            measureInfo.RulerBase,
-                                            measureInfo.RulerBaseUnit,
-                                            measureInfo.RulerTranslate,
-                                            measureInfo.RulerTranslateUnit);
-                                        polylineMeasure.UpdateAnnotMeasure();
-                                        polylineAnnot.UpdateAp();
-                                        args.Draw();
-                                    }
-                                }
-                                break;
-                            case C_ANNOTATION_TYPE.C_ANNOTATION_POLYGON:
-                                {
-                                    CPDFPolygonAnnotation areaAnnot = (CPDFPolygonAnnotation)pdfAnnot;
-                                    if (areaAnnot.IsMersured())
-                                    {
-                                        CPDFAreaMeasure areaMeasure = areaAnnot.GetAreaMeasure();
-                                        CPDFMeasureInfo measureInfo = areaMeasure.MeasureInfo;
-                                        measureInfo.Precision = MeasureSetting.GetMeasureSavePrecision();
-                                        measureInfo.RulerBase = (float)MeasureSetting.RulerBase;
-                                        measureInfo.RulerBaseUnit = MeasureSetting.RulerBaseUnit;
-                                        measureInfo.RulerTranslate = (float)MeasureSetting.RulerTranslate;
-                                        measureInfo.RulerTranslateUnit = MeasureSetting.RulerTranslateUnit;
+            //    foreach (AnnotHandlerEventArgs args in UpdateArgsList)
+            //    {
+            //        if (allowTypeList.Contains(args.EventType))
+            //        {
+            //            CPDFAnnotation pdfAnnot = args.GetPDFAnnot();
+            //            switch (pdfAnnot.Type)
+            //            {
+            //                case C_ANNOTATION_TYPE.C_ANNOTATION_LINE:
+            //                    {
+            //                        CPDFLineAnnotation lineAnnot = (CPDFLineAnnotation)pdfAnnot;
+            //                        if (lineAnnot.IsMersured())
+            //                        {
+            //                            CPDFDistanceMeasure lineMeasure = lineAnnot.GetDistanceMeasure();
+            //                            CPDFMeasureInfo measureInfo = lineMeasure.MeasureInfo;
+            //                            measureInfo.Precision = MeasureSetting.GetMeasureSavePrecision();
+            //                            measureInfo.RulerBase = (float)MeasureSetting.RulerBase;
+            //                            measureInfo.RulerBaseUnit = MeasureSetting.RulerBaseUnit;
+            //                            measureInfo.RulerTranslate = (float)MeasureSetting.RulerTranslate;
+            //                            measureInfo.RulerTranslateUnit = MeasureSetting.RulerTranslateUnit;
+            //                            lineMeasure.SetMeasureInfo(measureInfo);
+            //                            lineMeasure.SetMeasureScale(
+            //                                measureInfo.RulerBase,
+            //                                measureInfo.RulerBaseUnit,
+            //                                measureInfo.RulerTranslate,
+            //                                measureInfo.RulerTranslateUnit);
+            //                            lineMeasure.UpdateAnnotMeasure();
+            //                            lineAnnot.UpdateAp();
+            //                            args.Draw();
+            //                        }
+            //                    }
+            //                    break;
+            //                case C_ANNOTATION_TYPE.C_ANNOTATION_POLYLINE:
+            //                    {
+            //                        CPDFPolylineAnnotation polylineAnnot = (CPDFPolylineAnnotation)pdfAnnot;
+            //                        if (polylineAnnot.IsMersured())
+            //                        {
+            //                            CPDFPerimeterMeasure polylineMeasure = polylineAnnot.GetPerimeterMeasure();
+            //                            CPDFMeasureInfo measureInfo = polylineMeasure.MeasureInfo;
+            //                            measureInfo.Precision = MeasureSetting.GetMeasureSavePrecision();
+            //                            measureInfo.RulerBase = (float)MeasureSetting.RulerBase;
+            //                            measureInfo.RulerBaseUnit = MeasureSetting.RulerBaseUnit;
+            //                            measureInfo.RulerTranslate = (float)MeasureSetting.RulerTranslate;
+            //                            measureInfo.RulerTranslateUnit = MeasureSetting.RulerTranslateUnit;
+            //                            polylineMeasure.SetMeasureInfo(measureInfo);
+            //                            polylineMeasure.SetMeasureScale(
+            //                                measureInfo.RulerBase,
+            //                                measureInfo.RulerBaseUnit,
+            //                                measureInfo.RulerTranslate,
+            //                                measureInfo.RulerTranslateUnit);
+            //                            polylineMeasure.UpdateAnnotMeasure();
+            //                            polylineAnnot.UpdateAp();
+            //                            args.Draw();
+            //                        }
+            //                    }
+            //                    break;
+            //                case C_ANNOTATION_TYPE.C_ANNOTATION_POLYGON:
+            //                    {
+            //                        CPDFPolygonAnnotation areaAnnot = (CPDFPolygonAnnotation)pdfAnnot;
+            //                        if (areaAnnot.IsMersured())
+            //                        {
+            //                            CPDFAreaMeasure areaMeasure = areaAnnot.GetAreaMeasure();
+            //                            CPDFMeasureInfo measureInfo = areaMeasure.MeasureInfo;
+            //                            measureInfo.Precision = MeasureSetting.GetMeasureSavePrecision();
+            //                            measureInfo.RulerBase = (float)MeasureSetting.RulerBase;
+            //                            measureInfo.RulerBaseUnit = MeasureSetting.RulerBaseUnit;
+            //                            measureInfo.RulerTranslate = (float)MeasureSetting.RulerTranslate;
+            //                            measureInfo.RulerTranslateUnit = MeasureSetting.RulerTranslateUnit;
 
-                                        measureInfo.CaptionType = CPDFCaptionType.CPDF_CAPTION_NONE;
-                                        if (MeasureSetting.IsShowArea)
-                                        {
-                                            measureInfo.CaptionType |= CPDFCaptionType.CPDF_CAPTION_AREA;
-                                        }
-                                        if (MeasureSetting.IsShowLength)
-                                        {
-                                            measureInfo.CaptionType |= CPDFCaptionType.CPDF_CAPTION_LENGTH;
-                                        }
-                                        areaMeasure.SetMeasureInfo(measureInfo);
-                                        areaMeasure.SetMeasureScale(
-                                            measureInfo.RulerBase,
-                                            measureInfo.RulerBaseUnit,
-                                            measureInfo.RulerTranslate,
-                                            measureInfo.RulerTranslateUnit);
-                                        areaMeasure.UpdateAnnotMeasure();
-                                        areaAnnot.UpdateAp();
-                                        args.Draw();
-                                    }
-                                }
-                                break;
-                            default:
-                                break;
-                        }
-                    }
-                }
-                ReturnToInfoPanel = false;
-            }
-            UpdateArgsList?.Clear();
+            //                            measureInfo.CaptionType = CPDFCaptionType.CPDF_CAPTION_NONE;
+            //                            if (MeasureSetting.IsShowArea)
+            //                            {
+            //                                measureInfo.CaptionType |= CPDFCaptionType.CPDF_CAPTION_AREA;
+            //                            }
+            //                            if (MeasureSetting.IsShowLength)
+            //                            {
+            //                                measureInfo.CaptionType |= CPDFCaptionType.CPDF_CAPTION_LENGTH;
+            //                            }
+            //                            areaMeasure.SetMeasureInfo(measureInfo);
+            //                            areaMeasure.SetMeasureScale(
+            //                                measureInfo.RulerBase,
+            //                                measureInfo.RulerBaseUnit,
+            //                                measureInfo.RulerTranslate,
+            //                                measureInfo.RulerTranslateUnit);
+            //                            areaMeasure.UpdateAnnotMeasure();
+            //                            areaAnnot.UpdateAp();
+            //                            args.Draw();
+            //                        }
+            //                    }
+            //                    break;
+            //                default:
+            //                    break;
+            //            }
+            //        }
+            //    }
+            //    ReturnToInfoPanel = false;
+            //}
+            //UpdateArgsList?.Clear();
             DoneEvent?.Invoke(this, e);
             ReturnToInfoPanel = false;
             Close();
@@ -199,78 +197,78 @@ namespace Compdfkit_Tools.Measure
 
         public void BindMeasureSetting()
         {
-            RulerBaseText.Text = MeasureSetting.RulerBase.ToString();
-            RulerTranslateText.Text = MeasureSetting.RulerTranslate.ToString();
-            RulerTranslateCombo.SelectedIndex = -1;
-            RulerBaseUnitCombo.SelectedIndex = -1;
-            PrecisionBox.SelectedIndex = -1;
-            if (MeasureSetting.RulerBaseUnit == "in")
-            {
-                RulerBaseUnitCombo.SelectedIndex = 0;
-            }
-            if (MeasureSetting.RulerBaseUnit == "cm")
-            {
-                RulerBaseUnitCombo.SelectedIndex = 1;
-            }
-            if (MeasureSetting.RulerBaseUnit == "mm")
-            {
-                RulerBaseUnitCombo.SelectedIndex = 2;
-            }
+            //RulerBaseText.Text = MeasureSetting.RulerBase.ToString();
+            //RulerTranslateText.Text = MeasureSetting.RulerTranslate.ToString();
+            //RulerTranslateCombo.SelectedIndex = -1;
+            //RulerBaseUnitCombo.SelectedIndex = -1;
+            //PrecisionBox.SelectedIndex = -1;
+            //if (MeasureSetting.RulerBaseUnit == "in")
+            //{
+            //    RulerBaseUnitCombo.SelectedIndex = 0;
+            //}
+            //if (MeasureSetting.RulerBaseUnit == "cm")
+            //{
+            //    RulerBaseUnitCombo.SelectedIndex = 1;
+            //}
+            //if (MeasureSetting.RulerBaseUnit == "mm")
+            //{
+            //    RulerBaseUnitCombo.SelectedIndex = 2;
+            //}
 
-            for (int i = 0; i < RulerTranslateCombo.Items.Count; i++)
-            {
-                ComboBoxItem checkItem = RulerTranslateCombo.Items[i] as ComboBoxItem;
-                if (checkItem != null && checkItem.Content.ToString() == MeasureSetting.RulerTranslateUnit.ToString())
-                {
-                    RulerTranslateCombo.SelectedIndex = i;
-                }
-            }
+            //for (int i = 0; i < RulerTranslateCombo.Items.Count; i++)
+            //{
+            //    ComboBoxItem checkItem = RulerTranslateCombo.Items[i] as ComboBoxItem;
+            //    if (checkItem != null && checkItem.Content.ToString() == MeasureSetting.RulerTranslateUnit.ToString())
+            //    {
+            //        RulerTranslateCombo.SelectedIndex = i;
+            //    }
+            //}
 
-            for (int i = 0; i < PrecisionBox.Items.Count; i++)
-            {
-                ComboBoxItem checkItem = PrecisionBox.Items[i] as ComboBoxItem;
-                if (checkItem != null && checkItem.Content.ToString() == ((decimal)MeasureSetting.Precision).ToString())
-                {
-                    PrecisionBox.SelectedIndex = i;
-                }
-            }
+            //for (int i = 0; i < PrecisionBox.Items.Count; i++)
+            //{
+            //    ComboBoxItem checkItem = PrecisionBox.Items[i] as ComboBoxItem;
+            //    if (checkItem != null && checkItem.Content.ToString() == ((decimal)MeasureSetting.Precision).ToString())
+            //    {
+            //        PrecisionBox.SelectedIndex = i;
+            //    }
+            //}
         }
 
         private void SaveMeasureSetting()
         {
-            if (double.TryParse(RulerBaseText.Text, out double ruleBase))
-            {
-                MeasureSetting.RulerBase = ruleBase;
-            }
+            //if (double.TryParse(RulerBaseText.Text, out double ruleBase))
+            //{
+            //    MeasureSetting.RulerBase = ruleBase;
+            //}
 
-            if (RulerBaseUnitCombo.SelectedItem != null)
-            {
-                ComboBoxItem checkItem = RulerBaseUnitCombo.SelectedItem as ComboBoxItem;
-                MeasureSetting.RulerBaseUnit = checkItem.Content.ToString();
-            }
+            //if (RulerBaseUnitCombo.SelectedItem != null)
+            //{
+            //    ComboBoxItem checkItem = RulerBaseUnitCombo.SelectedItem as ComboBoxItem;
+            //    MeasureSetting.RulerBaseUnit = checkItem.Content.ToString();
+            //}
 
-            if (double.TryParse(RulerTranslateText.Text, out double ruletranBase))
-            {
-                MeasureSetting.RulerTranslate = ruletranBase;
-            }
+            //if (double.TryParse(RulerTranslateText.Text, out double ruletranBase))
+            //{
+            //    MeasureSetting.RulerTranslate = ruletranBase;
+            //}
 
-            if (RulerTranslateCombo.SelectedItem != null)
-            {
-                ComboBoxItem checkItem = RulerTranslateCombo.SelectedItem as ComboBoxItem;
-                MeasureSetting.RulerTranslateUnit = checkItem.Content.ToString();
-            }
+            //if (RulerTranslateCombo.SelectedItem != null)
+            //{
+            //    ComboBoxItem checkItem = RulerTranslateCombo.SelectedItem as ComboBoxItem;
+            //    MeasureSetting.RulerTranslateUnit = checkItem.Content.ToString();
+            //}
 
-            if (PrecisionBox.SelectedValue != null)
-            {
-                ComboBoxItem checkItem = PrecisionBox.SelectedValue as ComboBoxItem;
-                if (double.TryParse(checkItem.Content.ToString(), out double precision))
-                {
-                    MeasureSetting.Precision = precision;
-                }
-            }
+            //if (PrecisionBox.SelectedValue != null)
+            //{
+            //    ComboBoxItem checkItem = PrecisionBox.SelectedValue as ComboBoxItem;
+            //    if (double.TryParse(checkItem.Content.ToString(), out double precision))
+            //    {
+            //        MeasureSetting.Precision = precision;
+            //    }
+            //}
 
-            MeasureSetting.IsShowArea = (bool)AreaCheckBox.IsChecked;
-            MeasureSetting.IsShowLength = (bool)LengthCheckBox.IsChecked;
+            //MeasureSetting.IsShowArea = (bool)AreaCheckBox.IsChecked;
+            //MeasureSetting.IsShowLength = (bool)LengthCheckBox.IsChecked;
         }
 
         public void ChangedCheckBoxIsChecked(bool Area, bool Lenght)

+ 322 - 324
Demo/Examples/Compdfkit_Tools/Measure/MeasureSettingPanel.xaml.cs

@@ -1,8 +1,6 @@
 using ComPDFKit.Measure;
 using ComPDFKit.PDFAnnotation;
 using Compdfkit_Tools.PDFControl;
-using ComPDFKitViewer.AnnotEvent;
-using ComPDFKitViewer.PdfViewer;
 using System;
 using System.Collections.Generic;
 using System.Windows;
@@ -24,7 +22,7 @@ namespace Compdfkit_Tools.Measure
 
         public bool ReturnToInfoPanel { get; set; }
 
-        public List<AnnotHandlerEventArgs> UpdateArgsList { get; set; } = new List<AnnotHandlerEventArgs>();
+        //public List<AnnotHandlerEventArgs> UpdateArgsList { get; set; } = new List<AnnotHandlerEventArgs>();
         public MeasureSettingPanel()
         {
             InitializeComponent();
@@ -32,11 +30,11 @@ namespace Compdfkit_Tools.Measure
 
         private void ButtonCancel_Click(object sender, RoutedEventArgs e)
         {
-            if (UpdateArgsList != null && UpdateArgsList.Count > 0)
-            {
-                ReturnToInfoPanel = false;
-            }
-            UpdateArgsList?.Clear();
+            //if (UpdateArgsList != null && UpdateArgsList.Count > 0)
+            //{
+            //    ReturnToInfoPanel = false;
+            //}
+            //UpdateArgsList?.Clear();
             CancelEvent?.Invoke(this, e);
             ReturnToInfoPanel = false;
         }
@@ -79,204 +77,204 @@ namespace Compdfkit_Tools.Measure
                 }
             }
 
-            if (UpdateArgsList != null && UpdateArgsList.Count == 0)
-            {
-                SaveMeasureSetting();
-            }
-
-            if (UpdateArgsList != null && UpdateArgsList.Count > 0)
-            {
-                List<AnnotArgsType> allowTypeList = new List<AnnotArgsType>()
-                {
-                    AnnotArgsType.LineMeasure,
-                    AnnotArgsType.PolyLineMeasure,
-                    AnnotArgsType.PolygonMeasure
-                };
-
-                foreach (AnnotHandlerEventArgs args in UpdateArgsList)
-                {
-                    if (allowTypeList.Contains(args.EventType))
-                    {
-                        CPDFAnnotation pdfAnnot = args.GetPDFAnnot();
-                        switch (pdfAnnot.Type)
-                        {
-                            case C_ANNOTATION_TYPE.C_ANNOTATION_LINE:
-                                {
-                                    CPDFLineAnnotation lineAnnot = (CPDFLineAnnotation)pdfAnnot;
-                                    if (lineAnnot.IsMersured())
-                                    {
-                                        CPDFDistanceMeasure lineMeasure = lineAnnot.GetDistanceMeasure();
-                                        CPDFMeasureInfo measureInfo = lineMeasure.MeasureInfo;
-                                        if (PrecisionBox.SelectedValue != null)
-                                        {
-                                            ComboBoxItem checkItem = PrecisionBox.SelectedValue as ComboBoxItem;
-                                            if (double.TryParse(checkItem.Content.ToString(), out double precision))
-                                            {
-                                                measureInfo.Precision = GetMeasureSavePrecision(precision);
-                                            }
-                                        }
-                                        if (double.TryParse(RulerBaseText.Text, out double ruleBasedata))
-                                        {
-                                            measureInfo.RulerBase = (float)ruleBasedata;
-                                        }
-                                        if (RulerBaseUnitCombo.SelectedItem != null)
-                                        {
-                                            ComboBoxItem RulerBaseUnitcheckItem = RulerBaseUnitCombo.SelectedItem as ComboBoxItem;
-                                            measureInfo.RulerBaseUnit = RulerBaseUnitcheckItem.Content.ToString();
-                                        }
-                                        if (double.TryParse(RulerTranslateText.Text, out double ruletranBasedata))
-                                        {
-                                            measureInfo.RulerTranslate = (float)ruletranBasedata;
-                                        }
-                                        if (RulerTranslateCombo.SelectedItem != null)
-                                        {
-                                            ComboBoxItem RulerTranslatecheckItem = RulerTranslateCombo.SelectedItem as ComboBoxItem;
-                                            measureInfo.RulerTranslateUnit = RulerTranslatecheckItem.Content.ToString();
-                                        }
-                                        lineMeasure.SetMeasureInfo(measureInfo);
-                                        lineMeasure.SetMeasureScale(
-                                            measureInfo.RulerBase,
-                                            measureInfo.RulerBaseUnit,
-                                            measureInfo.RulerTranslate,
-                                            measureInfo.RulerTranslateUnit);
-                                        lineMeasure.UpdateAnnotMeasure();
-                                        lineAnnot.UpdateAp();
-                                        args.Draw();
-                                        if (PdfViewControl != null && PdfViewControl.PDFView != null)
-                                        {
-                                            CPDFViewer viewer = PdfViewControl.PDFView;
-                                            if (viewer != null && viewer.UndoManager != null)
-                                            {
-                                                viewer.UndoManager.CanSave = true;
-                                            }
-                                        }
-                                    }
-                                }
-                                break;
-                            case C_ANNOTATION_TYPE.C_ANNOTATION_POLYLINE:
-                                {
-                                    CPDFPolylineAnnotation polylineAnnot = (CPDFPolylineAnnotation)pdfAnnot;
-                                    if (polylineAnnot.IsMersured())
-                                    {
-                                        CPDFPerimeterMeasure polylineMeasure = polylineAnnot.GetPerimeterMeasure();
-                                        CPDFMeasureInfo measureInfo = polylineMeasure.MeasureInfo;
-                                        if (PrecisionBox.SelectedValue != null)
-                                        {
-                                            ComboBoxItem checkItem = PrecisionBox.SelectedValue as ComboBoxItem;
-                                            if (double.TryParse(checkItem.Content.ToString(), out double precision))
-                                            {
-                                                measureInfo.Precision = GetMeasureSavePrecision(precision);
-                                            }
-                                        }
-                                        if (double.TryParse(RulerBaseText.Text, out double ruleBasedata))
-                                        {
-                                            measureInfo.RulerBase = (float)ruleBasedata;
-                                        }
-                                        if (RulerBaseUnitCombo.SelectedItem != null)
-                                        {
-                                            ComboBoxItem RulerBaseUnitcheckItem = RulerBaseUnitCombo.SelectedItem as ComboBoxItem;
-                                            measureInfo.RulerBaseUnit = RulerBaseUnitcheckItem.Content.ToString();
-                                        }
-                                        if (double.TryParse(RulerTranslateText.Text, out double ruletranBasedata))
-                                        {
-                                            measureInfo.RulerTranslate = (float)ruletranBasedata;
-                                        }
-                                        if (RulerTranslateCombo.SelectedItem != null)
-                                        {
-                                            ComboBoxItem RulerTranslatecheckItem = RulerTranslateCombo.SelectedItem as ComboBoxItem;
-                                            measureInfo.RulerTranslateUnit = RulerTranslatecheckItem.Content.ToString();
-                                        }
-                                        polylineMeasure.SetMeasureInfo(measureInfo);
-                                        polylineMeasure.SetMeasureScale(
-                                            measureInfo.RulerBase,
-                                            measureInfo.RulerBaseUnit,
-                                            measureInfo.RulerTranslate,
-                                            measureInfo.RulerTranslateUnit);
-                                        polylineMeasure.UpdateAnnotMeasure();
-                                        polylineAnnot.UpdateAp();
-                                        args.Draw();
-                                        if (PdfViewControl != null && PdfViewControl.PDFView != null)
-                                        {
-                                            CPDFViewer viewer = PdfViewControl.PDFView;
-                                            if (viewer != null && viewer.UndoManager != null)
-                                            {
-                                                viewer.UndoManager.CanSave = true;
-                                            }
-                                        }
-                                    }
-                                }
-                                break;
-                            case C_ANNOTATION_TYPE.C_ANNOTATION_POLYGON:
-                                {
-                                    CPDFPolygonAnnotation areaAnnot = (CPDFPolygonAnnotation)pdfAnnot;
-                                    if (areaAnnot.IsMersured())
-                                    {
-                                        CPDFAreaMeasure areaMeasure = areaAnnot.GetAreaMeasure();
-                                        CPDFMeasureInfo measureInfo = areaMeasure.MeasureInfo;
-                                        if (PrecisionBox.SelectedValue != null)
-                                        {
-                                            ComboBoxItem checkItem = PrecisionBox.SelectedValue as ComboBoxItem;
-                                            if (double.TryParse(checkItem.Content.ToString(), out double precision))
-                                            {
-                                                measureInfo.Precision = GetMeasureSavePrecision(precision);
-                                            }
-                                        }
-                                        if (double.TryParse(RulerBaseText.Text, out double ruleBasedata))
-                                        {
-                                            measureInfo.RulerBase = (float)ruleBasedata;
-                                        }
-                                        if (RulerBaseUnitCombo.SelectedItem != null)
-                                        {
-                                            ComboBoxItem RulerBaseUnitcheckItem = RulerBaseUnitCombo.SelectedItem as ComboBoxItem;
-                                            measureInfo.RulerBaseUnit = RulerBaseUnitcheckItem.Content.ToString();
-                                        }
-                                        if (double.TryParse(RulerTranslateText.Text, out double ruletranBasedata))
-                                        {
-                                            measureInfo.RulerTranslate = (float)ruletranBasedata;
-                                        }
-                                        if (RulerTranslateCombo.SelectedItem != null)
-                                        {
-                                            ComboBoxItem RulerTranslatecheckItem = RulerTranslateCombo.SelectedItem as ComboBoxItem;
-                                            measureInfo.RulerTranslateUnit = RulerTranslatecheckItem.Content.ToString();
-                                        }
-
-                                        measureInfo.CaptionType = CPDFCaptionType.CPDF_CAPTION_NONE;
-                                        if ((bool)AreaCheckBox.IsChecked)
-                                        {
-                                            measureInfo.CaptionType |= CPDFCaptionType.CPDF_CAPTION_AREA;
-                                        }
-                                        if ((bool)LengthCheckBox.IsChecked)
-                                        {
-                                            measureInfo.CaptionType |= CPDFCaptionType.CPDF_CAPTION_LENGTH;
-                                        }
-                                        areaMeasure.SetMeasureInfo(measureInfo);
-                                        areaMeasure.SetMeasureScale(
-                                            measureInfo.RulerBase,
-                                            measureInfo.RulerBaseUnit,
-                                            measureInfo.RulerTranslate,
-                                            measureInfo.RulerTranslateUnit);
-                                        areaMeasure.UpdateAnnotMeasure();
-                                        areaAnnot.UpdateAp();
-                                        args.Draw();
-                                        if(PdfViewControl!=null && PdfViewControl.PDFView!=null)
-                                        {
-                                            CPDFViewer viewer = PdfViewControl.PDFView;
-                                            if(viewer!=null && viewer.UndoManager!=null)
-                                            {
-                                                viewer.UndoManager.CanSave = true;
-                                            }
-                                        }
-                                    }
-                                }
-                                break;
-                            default:
-                                break;
-                        }
-                    }
-                }
-                ReturnToInfoPanel = false;
-            }
-            UpdateArgsList?.Clear();
+            //if (UpdateArgsList != null && UpdateArgsList.Count == 0)
+            //{
+            //    SaveMeasureSetting();
+            //}
+
+            //if (UpdateArgsList != null && UpdateArgsList.Count > 0)
+            //{
+            //    List<AnnotArgsType> allowTypeList = new List<AnnotArgsType>()
+            //    {
+            //        AnnotArgsType.LineMeasure,
+            //        AnnotArgsType.PolyLineMeasure,
+            //        AnnotArgsType.PolygonMeasure
+            //    };
+
+            //    foreach (AnnotHandlerEventArgs args in UpdateArgsList)
+            //    {
+            //        if (allowTypeList.Contains(args.EventType))
+            //        {
+            //            CPDFAnnotation pdfAnnot = args.GetPDFAnnot();
+            //            switch (pdfAnnot.Type)
+            //            {
+            //                case C_ANNOTATION_TYPE.C_ANNOTATION_LINE:
+            //                    {
+            //                        CPDFLineAnnotation lineAnnot = (CPDFLineAnnotation)pdfAnnot;
+            //                        if (lineAnnot.IsMersured())
+            //                        {
+            //                            CPDFDistanceMeasure lineMeasure = lineAnnot.GetDistanceMeasure();
+            //                            CPDFMeasureInfo measureInfo = lineMeasure.MeasureInfo;
+            //                            if (PrecisionBox.SelectedValue != null)
+            //                            {
+            //                                ComboBoxItem checkItem = PrecisionBox.SelectedValue as ComboBoxItem;
+            //                                if (double.TryParse(checkItem.Content.ToString(), out double precision))
+            //                                {
+            //                                    measureInfo.Precision = GetMeasureSavePrecision(precision);
+            //                                }
+            //                            }
+            //                            if (double.TryParse(RulerBaseText.Text, out double ruleBasedata))
+            //                            {
+            //                                measureInfo.RulerBase = (float)ruleBasedata;
+            //                            }
+            //                            if (RulerBaseUnitCombo.SelectedItem != null)
+            //                            {
+            //                                ComboBoxItem RulerBaseUnitcheckItem = RulerBaseUnitCombo.SelectedItem as ComboBoxItem;
+            //                                measureInfo.RulerBaseUnit = RulerBaseUnitcheckItem.Content.ToString();
+            //                            }
+            //                            if (double.TryParse(RulerTranslateText.Text, out double ruletranBasedata))
+            //                            {
+            //                                measureInfo.RulerTranslate = (float)ruletranBasedata;
+            //                            }
+            //                            if (RulerTranslateCombo.SelectedItem != null)
+            //                            {
+            //                                ComboBoxItem RulerTranslatecheckItem = RulerTranslateCombo.SelectedItem as ComboBoxItem;
+            //                                measureInfo.RulerTranslateUnit = RulerTranslatecheckItem.Content.ToString();
+            //                            }
+            //                            lineMeasure.SetMeasureInfo(measureInfo);
+            //                            lineMeasure.SetMeasureScale(
+            //                                measureInfo.RulerBase,
+            //                                measureInfo.RulerBaseUnit,
+            //                                measureInfo.RulerTranslate,
+            //                                measureInfo.RulerTranslateUnit);
+            //                            lineMeasure.UpdateAnnotMeasure();
+            //                            lineAnnot.UpdateAp();
+            //                            args.Draw();
+            //                            if (PdfViewControl != null && PdfViewControl.PDFView != null)
+            //                            {
+            //                                CPDFViewer viewer = PdfViewControl.PDFView;
+            //                                if (viewer != null && viewer.UndoManager != null)
+            //                                {
+            //                                    viewer.UndoManager.CanSave = true;
+            //                                }
+            //                            }
+            //                        }
+            //                    }
+            //                    break;
+            //                case C_ANNOTATION_TYPE.C_ANNOTATION_POLYLINE:
+            //                    {
+            //                        CPDFPolylineAnnotation polylineAnnot = (CPDFPolylineAnnotation)pdfAnnot;
+            //                        if (polylineAnnot.IsMersured())
+            //                        {
+            //                            CPDFPerimeterMeasure polylineMeasure = polylineAnnot.GetPerimeterMeasure();
+            //                            CPDFMeasureInfo measureInfo = polylineMeasure.MeasureInfo;
+            //                            if (PrecisionBox.SelectedValue != null)
+            //                            {
+            //                                ComboBoxItem checkItem = PrecisionBox.SelectedValue as ComboBoxItem;
+            //                                if (double.TryParse(checkItem.Content.ToString(), out double precision))
+            //                                {
+            //                                    measureInfo.Precision = GetMeasureSavePrecision(precision);
+            //                                }
+            //                            }
+            //                            if (double.TryParse(RulerBaseText.Text, out double ruleBasedata))
+            //                            {
+            //                                measureInfo.RulerBase = (float)ruleBasedata;
+            //                            }
+            //                            if (RulerBaseUnitCombo.SelectedItem != null)
+            //                            {
+            //                                ComboBoxItem RulerBaseUnitcheckItem = RulerBaseUnitCombo.SelectedItem as ComboBoxItem;
+            //                                measureInfo.RulerBaseUnit = RulerBaseUnitcheckItem.Content.ToString();
+            //                            }
+            //                            if (double.TryParse(RulerTranslateText.Text, out double ruletranBasedata))
+            //                            {
+            //                                measureInfo.RulerTranslate = (float)ruletranBasedata;
+            //                            }
+            //                            if (RulerTranslateCombo.SelectedItem != null)
+            //                            {
+            //                                ComboBoxItem RulerTranslatecheckItem = RulerTranslateCombo.SelectedItem as ComboBoxItem;
+            //                                measureInfo.RulerTranslateUnit = RulerTranslatecheckItem.Content.ToString();
+            //                            }
+            //                            polylineMeasure.SetMeasureInfo(measureInfo);
+            //                            polylineMeasure.SetMeasureScale(
+            //                                measureInfo.RulerBase,
+            //                                measureInfo.RulerBaseUnit,
+            //                                measureInfo.RulerTranslate,
+            //                                measureInfo.RulerTranslateUnit);
+            //                            polylineMeasure.UpdateAnnotMeasure();
+            //                            polylineAnnot.UpdateAp();
+            //                            args.Draw();
+            //                            if (PdfViewControl != null && PdfViewControl.PDFView != null)
+            //                            {
+            //                                CPDFViewer viewer = PdfViewControl.PDFView;
+            //                                if (viewer != null && viewer.UndoManager != null)
+            //                                {
+            //                                    viewer.UndoManager.CanSave = true;
+            //                                }
+            //                            }
+            //                        }
+            //                    }
+            //                    break;
+            //                case C_ANNOTATION_TYPE.C_ANNOTATION_POLYGON:
+            //                    {
+            //                        CPDFPolygonAnnotation areaAnnot = (CPDFPolygonAnnotation)pdfAnnot;
+            //                        if (areaAnnot.IsMersured())
+            //                        {
+            //                            CPDFAreaMeasure areaMeasure = areaAnnot.GetAreaMeasure();
+            //                            CPDFMeasureInfo measureInfo = areaMeasure.MeasureInfo;
+            //                            if (PrecisionBox.SelectedValue != null)
+            //                            {
+            //                                ComboBoxItem checkItem = PrecisionBox.SelectedValue as ComboBoxItem;
+            //                                if (double.TryParse(checkItem.Content.ToString(), out double precision))
+            //                                {
+            //                                    measureInfo.Precision = GetMeasureSavePrecision(precision);
+            //                                }
+            //                            }
+            //                            if (double.TryParse(RulerBaseText.Text, out double ruleBasedata))
+            //                            {
+            //                                measureInfo.RulerBase = (float)ruleBasedata;
+            //                            }
+            //                            if (RulerBaseUnitCombo.SelectedItem != null)
+            //                            {
+            //                                ComboBoxItem RulerBaseUnitcheckItem = RulerBaseUnitCombo.SelectedItem as ComboBoxItem;
+            //                                measureInfo.RulerBaseUnit = RulerBaseUnitcheckItem.Content.ToString();
+            //                            }
+            //                            if (double.TryParse(RulerTranslateText.Text, out double ruletranBasedata))
+            //                            {
+            //                                measureInfo.RulerTranslate = (float)ruletranBasedata;
+            //                            }
+            //                            if (RulerTranslateCombo.SelectedItem != null)
+            //                            {
+            //                                ComboBoxItem RulerTranslatecheckItem = RulerTranslateCombo.SelectedItem as ComboBoxItem;
+            //                                measureInfo.RulerTranslateUnit = RulerTranslatecheckItem.Content.ToString();
+            //                            }
+
+            //                            measureInfo.CaptionType = CPDFCaptionType.CPDF_CAPTION_NONE;
+            //                            if ((bool)AreaCheckBox.IsChecked)
+            //                            {
+            //                                measureInfo.CaptionType |= CPDFCaptionType.CPDF_CAPTION_AREA;
+            //                            }
+            //                            if ((bool)LengthCheckBox.IsChecked)
+            //                            {
+            //                                measureInfo.CaptionType |= CPDFCaptionType.CPDF_CAPTION_LENGTH;
+            //                            }
+            //                            areaMeasure.SetMeasureInfo(measureInfo);
+            //                            areaMeasure.SetMeasureScale(
+            //                                measureInfo.RulerBase,
+            //                                measureInfo.RulerBaseUnit,
+            //                                measureInfo.RulerTranslate,
+            //                                measureInfo.RulerTranslateUnit);
+            //                            areaMeasure.UpdateAnnotMeasure();
+            //                            areaAnnot.UpdateAp();
+            //                            args.Draw();
+            //                            if(PdfViewControl!=null && PdfViewControl.PDFView!=null)
+            //                            {
+            //                                CPDFViewer viewer = PdfViewControl.PDFView;
+            //                                if(viewer!=null && viewer.UndoManager!=null)
+            //                                {
+            //                                    viewer.UndoManager.CanSave = true;
+            //                                }
+            //                            }
+            //                        }
+            //                    }
+            //                    break;
+            //                default:
+            //                    break;
+            //            }
+            //        }
+            //    }
+            //    ReturnToInfoPanel = false;
+            //}
+            //UpdateArgsList?.Clear();
             DoneEvent?.Invoke(this, e);
             ReturnToInfoPanel = false;
         }
@@ -344,125 +342,125 @@ namespace Compdfkit_Tools.Measure
 
         public void BindMeasureSetting()
         {
-            if (UpdateArgsList != null && UpdateArgsList.Count>0)
-            {
-                return;
-            }
-            RulerBaseText.Text = MeasureSetting.RulerBase.ToString();
-            RulerTranslateText.Text = MeasureSetting.RulerTranslate.ToString();
-            RulerTranslateCombo.SelectedIndex = -1;
-            RulerBaseUnitCombo.SelectedIndex = -1;
-            PrecisionBox.SelectedIndex = -1;
-            if (MeasureSetting.RulerBaseUnit == "in")
-            {
-                RulerBaseUnitCombo.SelectedIndex = 0;
-            }
-            if (MeasureSetting.RulerBaseUnit == "cm")
-            {
-                RulerBaseUnitCombo.SelectedIndex = 1;
-            }
-            if (MeasureSetting.RulerBaseUnit == "mm")
-            {
-                RulerBaseUnitCombo.SelectedIndex = 2;
-            }
-
-            for (int i = 0; i < RulerTranslateCombo.Items.Count; i++)
-            {
-                ComboBoxItem checkItem = RulerTranslateCombo.Items[i] as ComboBoxItem;
-                if (checkItem != null && checkItem.Content.ToString() == MeasureSetting.RulerTranslateUnit.ToString())
-                {
-                    RulerTranslateCombo.SelectedIndex = i;
-                }
-            }
-
-            for (int i = 0; i < PrecisionBox.Items.Count; i++)
-            {
-                ComboBoxItem checkItem = PrecisionBox.Items[i] as ComboBoxItem;
-                if (checkItem != null && checkItem.Content.ToString() == ((decimal)MeasureSetting.Precision).ToString())
-                {
-                    PrecisionBox.SelectedIndex = i;
-                }
-            }
-        }
-        public void BindMeasureSetting(MeasureEventArgs measureEventArgs)
-        {
-            if (measureEventArgs != null)
-            {
-
-                RulerBaseText.Text = measureEventArgs.RulerBase.ToString();
-                RulerTranslateText.Text = measureEventArgs.RulerTranslate.ToString();
-                RulerTranslateCombo.SelectedIndex = -1;
-                RulerBaseUnitCombo.SelectedIndex = -1;
-                PrecisionBox.SelectedIndex = -1;
-                if (measureEventArgs.RulerBaseUnit == "in")
-                {
-                    RulerBaseUnitCombo.SelectedIndex = 0;
-                }
-                if (measureEventArgs.RulerBaseUnit == "cm")
-                {
-                    RulerBaseUnitCombo.SelectedIndex = 1;
-                }
-                if (measureEventArgs.RulerBaseUnit == "mm")
-                {
-                    RulerBaseUnitCombo.SelectedIndex = 2;
-                }
-
-                for (int i = 0; i < RulerTranslateCombo.Items.Count; i++)
-                {
-                    ComboBoxItem checkItem = RulerTranslateCombo.Items[i] as ComboBoxItem;
-                    if (checkItem != null && checkItem.Content.ToString() == measureEventArgs.RulerTranslateUnit.ToString())
-                    {
-                        RulerTranslateCombo.SelectedIndex = i;
-                    }
-                }
-
-                for (int i = 0; i < PrecisionBox.Items.Count; i++)
-                {
-                    ComboBoxItem checkItem = PrecisionBox.Items[i] as ComboBoxItem;
-                    if (checkItem != null && checkItem.Content.ToString() == ((decimal)measureEventArgs.Precision).ToString())
-                    {
-                        PrecisionBox.SelectedIndex = i;
-                    }
-                }
-            }
-        }
-
-        private void SaveMeasureSetting()
-        {
-            if (double.TryParse(RulerBaseText.Text, out double ruleBase))
-            {
-                MeasureSetting.RulerBase = ruleBase;
-            }
-
-            if (RulerBaseUnitCombo.SelectedItem != null)
-            {
-                ComboBoxItem checkItem = RulerBaseUnitCombo.SelectedItem as ComboBoxItem;
-                MeasureSetting.RulerBaseUnit = checkItem.Content.ToString();
-            }
-
-            if (double.TryParse(RulerTranslateText.Text, out double ruletranBase))
-            {
-                MeasureSetting.RulerTranslate = ruletranBase;
-            }
-
-            if (RulerTranslateCombo.SelectedItem != null)
-            {
-                ComboBoxItem checkItem = RulerTranslateCombo.SelectedItem as ComboBoxItem;
-                MeasureSetting.RulerTranslateUnit = checkItem.Content.ToString();
-            }
-
-            if (PrecisionBox.SelectedValue != null)
-            {
-                ComboBoxItem checkItem = PrecisionBox.SelectedValue as ComboBoxItem;
-                if (double.TryParse(checkItem.Content.ToString(), out double precision))
-                {
-                    MeasureSetting.Precision = precision;
-                }
-            }
-
-            MeasureSetting.IsShowArea = (bool)AreaCheckBox.IsChecked;
-            MeasureSetting.IsShowLength = (bool)LengthCheckBox.IsChecked;
+            //if (UpdateArgsList != null && UpdateArgsList.Count>0)
+            //{
+            //    return;
+            //}
+            //RulerBaseText.Text = MeasureSetting.RulerBase.ToString();
+            //RulerTranslateText.Text = MeasureSetting.RulerTranslate.ToString();
+            //RulerTranslateCombo.SelectedIndex = -1;
+            //RulerBaseUnitCombo.SelectedIndex = -1;
+            //PrecisionBox.SelectedIndex = -1;
+            //if (MeasureSetting.RulerBaseUnit == "in")
+            //{
+            //    RulerBaseUnitCombo.SelectedIndex = 0;
+            //}
+            //if (MeasureSetting.RulerBaseUnit == "cm")
+            //{
+            //    RulerBaseUnitCombo.SelectedIndex = 1;
+            //}
+            //if (MeasureSetting.RulerBaseUnit == "mm")
+            //{
+            //    RulerBaseUnitCombo.SelectedIndex = 2;
+            //}
+
+            //for (int i = 0; i < RulerTranslateCombo.Items.Count; i++)
+            //{
+            //    ComboBoxItem checkItem = RulerTranslateCombo.Items[i] as ComboBoxItem;
+            //    if (checkItem != null && checkItem.Content.ToString() == MeasureSetting.RulerTranslateUnit.ToString())
+            //    {
+            //        RulerTranslateCombo.SelectedIndex = i;
+            //    }
+            //}
+
+            //for (int i = 0; i < PrecisionBox.Items.Count; i++)
+            //{
+            //    ComboBoxItem checkItem = PrecisionBox.Items[i] as ComboBoxItem;
+            //    if (checkItem != null && checkItem.Content.ToString() == ((decimal)MeasureSetting.Precision).ToString())
+            //    {
+            //        PrecisionBox.SelectedIndex = i;
+            //    }
+            //}
         }
+        //public void BindMeasureSetting(MeasureEventArgs measureEventArgs)
+        //{
+        //    if (measureEventArgs != null)
+        //    {
+
+        //        RulerBaseText.Text = measureEventArgs.RulerBase.ToString();
+        //        RulerTranslateText.Text = measureEventArgs.RulerTranslate.ToString();
+        //        RulerTranslateCombo.SelectedIndex = -1;
+        //        RulerBaseUnitCombo.SelectedIndex = -1;
+        //        PrecisionBox.SelectedIndex = -1;
+        //        if (measureEventArgs.RulerBaseUnit == "in")
+        //        {
+        //            RulerBaseUnitCombo.SelectedIndex = 0;
+        //        }
+        //        if (measureEventArgs.RulerBaseUnit == "cm")
+        //        {
+        //            RulerBaseUnitCombo.SelectedIndex = 1;
+        //        }
+        //        if (measureEventArgs.RulerBaseUnit == "mm")
+        //        {
+        //            RulerBaseUnitCombo.SelectedIndex = 2;
+        //        }
+
+        //        for (int i = 0; i < RulerTranslateCombo.Items.Count; i++)
+        //        {
+        //            ComboBoxItem checkItem = RulerTranslateCombo.Items[i] as ComboBoxItem;
+        //            if (checkItem != null && checkItem.Content.ToString() == measureEventArgs.RulerTranslateUnit.ToString())
+        //            {
+        //                RulerTranslateCombo.SelectedIndex = i;
+        //            }
+        //        }
+
+        //        for (int i = 0; i < PrecisionBox.Items.Count; i++)
+        //        {
+        //            ComboBoxItem checkItem = PrecisionBox.Items[i] as ComboBoxItem;
+        //            if (checkItem != null && checkItem.Content.ToString() == ((decimal)measureEventArgs.Precision).ToString())
+        //            {
+        //                PrecisionBox.SelectedIndex = i;
+        //            }
+        //        }
+        //    }
+        //}
+
+        //private void SaveMeasureSetting()
+        //{
+        //    if (double.TryParse(RulerBaseText.Text, out double ruleBase))
+        //    {
+        //        MeasureSetting.RulerBase = ruleBase;
+        //    }
+
+        //    if (RulerBaseUnitCombo.SelectedItem != null)
+        //    {
+        //        ComboBoxItem checkItem = RulerBaseUnitCombo.SelectedItem as ComboBoxItem;
+        //        MeasureSetting.RulerBaseUnit = checkItem.Content.ToString();
+        //    }
+
+        //    if (double.TryParse(RulerTranslateText.Text, out double ruletranBase))
+        //    {
+        //        MeasureSetting.RulerTranslate = ruletranBase;
+        //    }
+
+        //    if (RulerTranslateCombo.SelectedItem != null)
+        //    {
+        //        ComboBoxItem checkItem = RulerTranslateCombo.SelectedItem as ComboBoxItem;
+        //        MeasureSetting.RulerTranslateUnit = checkItem.Content.ToString();
+        //    }
+
+        //    if (PrecisionBox.SelectedValue != null)
+        //    {
+        //        ComboBoxItem checkItem = PrecisionBox.SelectedValue as ComboBoxItem;
+        //        if (double.TryParse(checkItem.Content.ToString(), out double precision))
+        //        {
+        //            MeasureSetting.Precision = precision;
+        //        }
+        //    }
+
+        //    MeasureSetting.IsShowArea = (bool)AreaCheckBox.IsChecked;
+        //    MeasureSetting.IsShowLength = (bool)LengthCheckBox.IsChecked;
+        //}
 
         public void ChangedCheckBoxIsChecked(bool Area, bool Lenght)
         {

+ 110 - 111
Demo/Examples/Compdfkit_Tools/Measure/Property/MultilineProperty.xaml.cs

@@ -1,7 +1,6 @@
 using ComPDFKit.PDFAnnotation;
 using Compdfkit_Tools.Data;
 using ComPDFKitViewer;
-using ComPDFKitViewer.AnnotEvent;
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
@@ -25,7 +24,7 @@ namespace Compdfkit_Tools.Measure.Property
     /// </summary>
     public partial class MultilineProperty : UserControl
     {
-        private AnnotAttribEvent MultilineEvent { get; set; }
+        //private AnnotAttribEvent MultilineEvent { get; set; }
 
         public ObservableCollection<int> SizeList { get; set; } = new ObservableCollection<int>
         {
@@ -43,8 +42,8 @@ namespace Compdfkit_Tools.Measure.Property
         {
             if (IsLoadedData)
             {
-                MultilineEvent?.UpdateAttrib(AnnotAttrib.NoteText, NoteTextBox.Text);
-                MultilineEvent?.UpdateAnnot();
+                //MultilineEvent?.UpdateAttrib(AnnotAttrib.NoteText, NoteTextBox.Text);
+                //MultilineEvent?.UpdateAnnot();
             }
         }
 
@@ -77,9 +76,9 @@ namespace Compdfkit_Tools.Measure.Property
                     default:
                         break;
                 }
-                MultilineEvent?.UpdateAttrib(AnnotAttrib.IsBold, isBold);
-                MultilineEvent?.UpdateAttrib(AnnotAttrib.IsItalic, isItalic);
-                MultilineEvent?.UpdateAnnot();
+                //MultilineEvent?.UpdateAttrib(AnnotAttrib.IsBold, isBold);
+                //MultilineEvent?.UpdateAttrib(AnnotAttrib.IsItalic, isItalic);
+                //MultilineEvent?.UpdateAnnot();
             }
         }
 
@@ -88,8 +87,8 @@ namespace Compdfkit_Tools.Measure.Property
             ComboBoxItem selectItem = FontCombox.SelectedItem as ComboBoxItem;
             if (selectItem != null && selectItem.Content != null)
             {
-                MultilineEvent?.UpdateAttrib(AnnotAttrib.FontName, selectItem.Content.ToString());
-                MultilineEvent?.UpdateAnnot();
+                //MultilineEvent?.UpdateAttrib(AnnotAttrib.FontName, selectItem.Content.ToString());
+                //MultilineEvent?.UpdateAnnot();
             }
         }
 
@@ -97,8 +96,8 @@ namespace Compdfkit_Tools.Measure.Property
         {
             if (IsLoadedData)
             {
-                MultilineEvent?.UpdateAttrib(AnnotAttrib.FontSize, (sender as ComboBox).SelectedItem);
-                MultilineEvent?.UpdateAnnot();
+                //MultilineEvent?.UpdateAttrib(AnnotAttrib.FontSize, (sender as ComboBox).SelectedItem);
+                //MultilineEvent?.UpdateAnnot();
             }
         }
 
@@ -107,8 +106,8 @@ namespace Compdfkit_Tools.Measure.Property
             SolidColorBrush checkBrush = BorderColorPickerControl.GetBrush() as SolidColorBrush;
             if (checkBrush != null)
             {
-                MultilineEvent?.UpdateAttrib(AnnotAttrib.Color, checkBrush.Color);
-                MultilineEvent?.UpdateAnnot();
+                //MultilineEvent?.UpdateAttrib(AnnotAttrib.Color, checkBrush.Color);
+                //MultilineEvent?.UpdateAnnot();
             }
         }
 
@@ -116,8 +115,8 @@ namespace Compdfkit_Tools.Measure.Property
         {
             if (IsLoadedData)
             {
-                MultilineEvent?.UpdateAttrib(AnnotAttrib.Transparency, CPDFOpacityControl.OpacityValue / 100D);
-                MultilineEvent?.UpdateAnnot();
+                //MultilineEvent?.UpdateAttrib(AnnotAttrib.Transparency, CPDFOpacityControl.OpacityValue / 100D);
+                //MultilineEvent?.UpdateAnnot();
             }
         }
 
@@ -125,15 +124,15 @@ namespace Compdfkit_Tools.Measure.Property
         {
             if (IsLoadedData)
             {
-                MultilineEvent?.UpdateAttrib(AnnotAttrib.Thickness, CPDFThicknessControl.Thickness);
-                MultilineEvent?.UpdateAnnot();
+                //MultilineEvent?.UpdateAttrib(AnnotAttrib.Thickness, CPDFThicknessControl.Thickness);
+                //MultilineEvent?.UpdateAnnot();
             }
         }
 
         private void CPDFLineStyleControl_LineStyleChanged(object sender, EventArgs e)
         {
-                MultilineEvent?.UpdateAttrib(AnnotAttrib.LineStyle, CPDFLineStyleControl.DashStyle);
-                MultilineEvent?.UpdateAnnot();
+                //MultilineEvent?.UpdateAttrib(AnnotAttrib.LineStyle, CPDFLineStyleControl.DashStyle);
+                //MultilineEvent?.UpdateAnnot();
         }
 
         private void FontColorPickerControl_ColorChanged(object sender, EventArgs e)
@@ -141,108 +140,108 @@ namespace Compdfkit_Tools.Measure.Property
             SolidColorBrush checkBrush = FontColorPickerControl.GetBrush() as SolidColorBrush;
             if (checkBrush != null)
             {
-                MultilineEvent?.UpdateAttrib(AnnotAttrib.FontColor, checkBrush.Color);
-                MultilineEvent?.UpdateAnnot();
+                //MultilineEvent?.UpdateAttrib(AnnotAttrib.FontColor, checkBrush.Color);
+                //MultilineEvent?.UpdateAnnot();
             }
         }
 
-        public void SetAnnotArgsData(PolyLineMeasureArgs annotArgs)
-        {
-            Dictionary<AnnotAttrib, object> attribDict = new Dictionary<AnnotAttrib, object>();
-            attribDict[AnnotAttrib.Color] = annotArgs.LineColor;
-            attribDict[AnnotAttrib.Transparency] = annotArgs.Transparency;
-            attribDict[AnnotAttrib.Thickness] = annotArgs.LineWidth;
-            attribDict[AnnotAttrib.LineStyle] = annotArgs.LineDash;
-            attribDict[AnnotAttrib.FontColor] = annotArgs.FontColor;
-            attribDict[AnnotAttrib.FontName] = annotArgs.FontName;
-            attribDict[AnnotAttrib.IsBold] = annotArgs.IsBold;
-            attribDict[AnnotAttrib.IsItalic] = annotArgs.IsItalic;
-            attribDict[AnnotAttrib.FontSize] = annotArgs.FontSize;
-            attribDict[AnnotAttrib.NoteText] = annotArgs.Content;
+        //public void SetAnnotArgsData(PolyLineMeasureArgs annotArgs)
+        //{
+        //    Dictionary<AnnotAttrib, object> attribDict = new Dictionary<AnnotAttrib, object>();
+        //    attribDict[AnnotAttrib.Color] = annotArgs.LineColor;
+        //    attribDict[AnnotAttrib.Transparency] = annotArgs.Transparency;
+        //    attribDict[AnnotAttrib.Thickness] = annotArgs.LineWidth;
+        //    attribDict[AnnotAttrib.LineStyle] = annotArgs.LineDash;
+        //    attribDict[AnnotAttrib.FontColor] = annotArgs.FontColor;
+        //    attribDict[AnnotAttrib.FontName] = annotArgs.FontName;
+        //    attribDict[AnnotAttrib.IsBold] = annotArgs.IsBold;
+        //    attribDict[AnnotAttrib.IsItalic] = annotArgs.IsItalic;
+        //    attribDict[AnnotAttrib.FontSize] = annotArgs.FontSize;
+        //    attribDict[AnnotAttrib.NoteText] = annotArgs.Content;
 
-            AnnotAttribEvent annotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annotArgs, attribDict);
-            SetAnnotEventData(annotEvent);
-        }
+        //    AnnotAttribEvent annotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annotArgs, attribDict);
+        //    SetAnnotEventData(annotEvent);
+        //}
 
-        public void SetAnnotEventData(AnnotAttribEvent annotEvent)
-        {
-            MultilineEvent = null;
-            if (annotEvent != null)
-            {
-                foreach (AnnotAttrib attrib in annotEvent.Attribs.Keys)
-                {
-                    switch (attrib)
-                    {
-                        case AnnotAttrib.Color:
-                            BorderColorPickerControl.SetCheckedForColor((Color)annotEvent.Attribs[attrib]);
-                            break;
-                        case AnnotAttrib.Transparency:
-                            double transparennt = Convert.ToDouble(annotEvent.Attribs[attrib]);
-                            if (transparennt > 1)
-                            {
-                                transparennt = (transparennt / 255D);
-                            }
-                            CPDFOpacityControl.OpacityValue = (int)(transparennt * 100);
-                            break;
-                        case AnnotAttrib.Thickness:
-                            CPDFThicknessControl.Thickness = Convert.ToInt16(annotEvent.Attribs[attrib]);
-                            break;
-                        case AnnotAttrib.LineStyle:
-                            CPDFLineStyleControl.DashStyle = (DashStyle)(annotEvent.Attribs[attrib]);
-                            break;
-                        case AnnotAttrib.FontColor:
-                            FontColorPickerControl.SetCheckedForColor((Color)annotEvent.Attribs[attrib]);
-                            break;
-                        case AnnotAttrib.FontName:
-                            {
-                                string fontName = (string)annotEvent.Attribs[AnnotAttrib.FontName];
-                                if (fontName.Contains("Courier"))
-                                {
-                                    FontCombox.SelectedIndex = 1;
-                                }
-                                else if (fontName == "Arial" || fontName.Contains("Helvetica"))
-                                {
-                                    FontCombox.SelectedIndex = 0;
+        //public void SetAnnotEventData(AnnotAttribEvent annotEvent)
+        //{
+        //    MultilineEvent = null;
+        //    if (annotEvent != null)
+        //    {
+        //        foreach (AnnotAttrib attrib in annotEvent.Attribs.Keys)
+        //        {
+        //            switch (attrib)
+        //            {
+        //                case AnnotAttrib.Color:
+        //                    BorderColorPickerControl.SetCheckedForColor((Color)annotEvent.Attribs[attrib]);
+        //                    break;
+        //                case AnnotAttrib.Transparency:
+        //                    double transparennt = Convert.ToDouble(annotEvent.Attribs[attrib]);
+        //                    if (transparennt > 1)
+        //                    {
+        //                        transparennt = (transparennt / 255D);
+        //                    }
+        //                    CPDFOpacityControl.OpacityValue = (int)(transparennt * 100);
+        //                    break;
+        //                case AnnotAttrib.Thickness:
+        //                    CPDFThicknessControl.Thickness = Convert.ToInt16(annotEvent.Attribs[attrib]);
+        //                    break;
+        //                case AnnotAttrib.LineStyle:
+        //                    CPDFLineStyleControl.DashStyle = (DashStyle)(annotEvent.Attribs[attrib]);
+        //                    break;
+        //                case AnnotAttrib.FontColor:
+        //                    FontColorPickerControl.SetCheckedForColor((Color)annotEvent.Attribs[attrib]);
+        //                    break;
+        //                case AnnotAttrib.FontName:
+        //                    {
+        //                        string fontName = (string)annotEvent.Attribs[AnnotAttrib.FontName];
+        //                        if (fontName.Contains("Courier"))
+        //                        {
+        //                            FontCombox.SelectedIndex = 1;
+        //                        }
+        //                        else if (fontName == "Arial" || fontName.Contains("Helvetica"))
+        //                        {
+        //                            FontCombox.SelectedIndex = 0;
 
-                                }
-                                else if (fontName.Contains("Times"))
-                                {   
-                                    FontCombox.SelectedIndex = 2;
-                                }
-                                else
-                                {
-                                    FontCombox.SelectedIndex = -1;
-                                }
-                            }
-                            break;
-                        case AnnotAttrib.FontSize:
-                            SetFontSize(Convert.ToDouble(annotEvent.Attribs[attrib]));
-                            break;
-                        case AnnotAttrib.NoteText:
-                            NoteTextBox.Text = annotEvent.Attribs[attrib].ToString();
-                            break;
-                        default:
-                            break;
-                    }
-                }
+        //                        }
+        //                        else if (fontName.Contains("Times"))
+        //                        {   
+        //                            FontCombox.SelectedIndex = 2;
+        //                        }
+        //                        else
+        //                        {
+        //                            FontCombox.SelectedIndex = -1;
+        //                        }
+        //                    }
+        //                    break;
+        //                case AnnotAttrib.FontSize:
+        //                    SetFontSize(Convert.ToDouble(annotEvent.Attribs[attrib]));
+        //                    break;
+        //                case AnnotAttrib.NoteText:
+        //                    NoteTextBox.Text = annotEvent.Attribs[attrib].ToString();
+        //                    break;
+        //                default:
+        //                    break;
+        //            }
+        //        }
 
 
-                bool isBold = false;
-                bool isItalic = false;
-                if (annotEvent.Attribs.ContainsKey(AnnotAttrib.IsBold))
-                {
-                    isBold = (bool)annotEvent.Attribs[AnnotAttrib.IsBold];
-                }
-                if (annotEvent.Attribs.ContainsKey(AnnotAttrib.IsItalic))
-                {
-                    isItalic = (bool)annotEvent.Attribs[AnnotAttrib.IsItalic];
-                }
+        //        bool isBold = false;
+        //        bool isItalic = false;
+        //        if (annotEvent.Attribs.ContainsKey(AnnotAttrib.IsBold))
+        //        {
+        //            isBold = (bool)annotEvent.Attribs[AnnotAttrib.IsBold];
+        //        }
+        //        if (annotEvent.Attribs.ContainsKey(AnnotAttrib.IsItalic))
+        //        {
+        //            isItalic = (bool)annotEvent.Attribs[AnnotAttrib.IsItalic];
+        //        }
 
-                SetFontStyle(isBold, isItalic);
-            }
+        //        SetFontStyle(isBold, isItalic);
+        //    }
 
-            MultilineEvent = annotEvent;
-        }
+        //    MultilineEvent = annotEvent;
+        //}
 
         public void SetFontStyle(bool isBold, bool isItalic)
         {

+ 111 - 112
Demo/Examples/Compdfkit_Tools/Measure/Property/PolygonalProperty.xaml.cs

@@ -1,6 +1,5 @@
 using Compdfkit_Tools.Common;
 using ComPDFKitViewer;
-using ComPDFKitViewer.AnnotEvent;
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
@@ -32,7 +31,7 @@ namespace Compdfkit_Tools.Measure.Property
         bool IsLoadedData = false;
 
 
-        private AnnotAttribEvent PolygonalEvent { get; set; }
+        //private AnnotAttribEvent PolygonalEvent { get; set; }
 
         public PolygonalProperty()
         {
@@ -43,8 +42,8 @@ namespace Compdfkit_Tools.Measure.Property
         {
             if (IsLoadedData)
             {
-                PolygonalEvent?.UpdateAttrib(AnnotAttrib.NoteText, NoteTextBox.Text);
-                PolygonalEvent?.UpdateAnnot();
+                //PolygonalEvent?.UpdateAttrib(AnnotAttrib.NoteText, NoteTextBox.Text);
+                //PolygonalEvent?.UpdateAnnot();
             }
         }
 
@@ -77,9 +76,9 @@ namespace Compdfkit_Tools.Measure.Property
                     default:
                         break;
                 }
-                PolygonalEvent?.UpdateAttrib(AnnotAttrib.IsBold, isBold);
-                PolygonalEvent?.UpdateAttrib(AnnotAttrib.IsItalic, isItalic);
-                PolygonalEvent?.UpdateAnnot();
+                //PolygonalEvent?.UpdateAttrib(AnnotAttrib.IsBold, isBold);
+                //PolygonalEvent?.UpdateAttrib(AnnotAttrib.IsItalic, isItalic);
+                //PolygonalEvent?.UpdateAnnot();
             }
         }
 
@@ -87,8 +86,8 @@ namespace Compdfkit_Tools.Measure.Property
         {
             if (IsLoadedData)
             {
-                PolygonalEvent?.UpdateAttrib(AnnotAttrib.FontSize, (sender as ComboBox).SelectedItem);
-                PolygonalEvent?.UpdateAnnot();
+                //PolygonalEvent?.UpdateAttrib(AnnotAttrib.FontSize, (sender as ComboBox).SelectedItem);
+                //PolygonalEvent?.UpdateAnnot();
             }
         }
 
@@ -97,8 +96,8 @@ namespace Compdfkit_Tools.Measure.Property
             ComboBoxItem selectItem = FontCombox.SelectedItem as ComboBoxItem;
             if (selectItem != null && selectItem.Content != null)
             {
-                PolygonalEvent?.UpdateAttrib(AnnotAttrib.FontName, selectItem.Content.ToString());
-                PolygonalEvent?.UpdateAnnot();
+                //PolygonalEvent?.UpdateAttrib(AnnotAttrib.FontName, selectItem.Content.ToString());
+                //PolygonalEvent?.UpdateAnnot();
             }
         }
 
@@ -121,8 +120,8 @@ namespace Compdfkit_Tools.Measure.Property
             SolidColorBrush checkBrush = BorderColorPickerControl.GetBrush() as SolidColorBrush;
             if (checkBrush != null)
             {
-                PolygonalEvent?.UpdateAttrib(AnnotAttrib.Color, checkBrush.Color);
-                PolygonalEvent?.UpdateAnnot();
+                //PolygonalEvent?.UpdateAttrib(AnnotAttrib.Color, checkBrush.Color);
+                //PolygonalEvent?.UpdateAnnot();
             }
         }
 
@@ -131,8 +130,8 @@ namespace Compdfkit_Tools.Measure.Property
             SolidColorBrush checkBrush = FillColorPickerControl.GetBrush() as SolidColorBrush;
             if (checkBrush != null)
             {
-                PolygonalEvent?.UpdateAttrib(AnnotAttrib.FillColor, checkBrush.Color);
-                PolygonalEvent?.UpdateAnnot();
+                //PolygonalEvent?.UpdateAttrib(AnnotAttrib.FillColor, checkBrush.Color);
+                //PolygonalEvent?.UpdateAnnot();
             }
         }
 
@@ -140,8 +139,8 @@ namespace Compdfkit_Tools.Measure.Property
         {
             if (IsLoadedData)
             {
-                PolygonalEvent?.UpdateAttrib(AnnotAttrib.Transparency, CPDFOpacityControl.OpacityValue / 100D);
-                PolygonalEvent?.UpdateAnnot();
+                //PolygonalEvent?.UpdateAttrib(AnnotAttrib.Transparency, CPDFOpacityControl.OpacityValue / 100D);
+                //PolygonalEvent?.UpdateAnnot();
             }
         }
 
@@ -149,8 +148,8 @@ namespace Compdfkit_Tools.Measure.Property
         {
             if (IsLoadedData)
             {
-                PolygonalEvent?.UpdateAttrib(AnnotAttrib.LineStyle, CPDFLineStyleControl.DashStyle);
-                PolygonalEvent?.UpdateAnnot();
+                //PolygonalEvent?.UpdateAttrib(AnnotAttrib.LineStyle, CPDFLineStyleControl.DashStyle);
+                //PolygonalEvent?.UpdateAnnot();
             }
         }
 
@@ -159,109 +158,109 @@ namespace Compdfkit_Tools.Measure.Property
             SolidColorBrush checkBrush = FontColorPickerControl.GetBrush() as SolidColorBrush;
             if (checkBrush != null)
             {
-                PolygonalEvent?.UpdateAttrib(AnnotAttrib.FontColor, checkBrush.Color);
-                PolygonalEvent?.UpdateAnnot();
+                //PolygonalEvent?.UpdateAttrib(AnnotAttrib.FontColor, checkBrush.Color);
+                //PolygonalEvent?.UpdateAnnot();
             }
         }
 
-        public void SetAnnotArgsData(PolygonMeasureArgs annotArgs)
-        {
-            Dictionary<AnnotAttrib, object> attribDict = new Dictionary<AnnotAttrib, object>();
-            attribDict[AnnotAttrib.Color] = annotArgs.LineColor;
-            attribDict[AnnotAttrib.Transparency] = annotArgs.Transparency;
-            attribDict[AnnotAttrib.Thickness] = annotArgs.LineWidth;
-            attribDict[AnnotAttrib.LineStyle] = annotArgs.LineDash;
-            attribDict[AnnotAttrib.FontColor] = annotArgs.FontColor;
-            attribDict[AnnotAttrib.FillColor] = annotArgs.FillColor;
-            attribDict[AnnotAttrib.FontName] = annotArgs.FontName;
-            attribDict[AnnotAttrib.IsBold] = annotArgs.IsBold;
-            attribDict[AnnotAttrib.IsItalic] = annotArgs.IsItalic;
-            attribDict[AnnotAttrib.FontSize] = annotArgs.FontSize;
-            attribDict[AnnotAttrib.NoteText] = annotArgs.Content;
+        //public void SetAnnotArgsData(PolygonMeasureArgs annotArgs)
+        //{
+        //    Dictionary<AnnotAttrib, object> attribDict = new Dictionary<AnnotAttrib, object>();
+        //    attribDict[AnnotAttrib.Color] = annotArgs.LineColor;
+        //    attribDict[AnnotAttrib.Transparency] = annotArgs.Transparency;
+        //    attribDict[AnnotAttrib.Thickness] = annotArgs.LineWidth;
+        //    attribDict[AnnotAttrib.LineStyle] = annotArgs.LineDash;
+        //    attribDict[AnnotAttrib.FontColor] = annotArgs.FontColor;
+        //    attribDict[AnnotAttrib.FillColor] = annotArgs.FillColor;
+        //    attribDict[AnnotAttrib.FontName] = annotArgs.FontName;
+        //    attribDict[AnnotAttrib.IsBold] = annotArgs.IsBold;
+        //    attribDict[AnnotAttrib.IsItalic] = annotArgs.IsItalic;
+        //    attribDict[AnnotAttrib.FontSize] = annotArgs.FontSize;
+        //    attribDict[AnnotAttrib.NoteText] = annotArgs.Content;
 
-            AnnotAttribEvent annotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annotArgs, attribDict);
-            SetAnnotEventData(annotEvent);
-        }
+        //    AnnotAttribEvent annotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annotArgs, attribDict);
+        //    SetAnnotEventData(annotEvent);
+        //}
 
-        public void SetAnnotEventData(AnnotAttribEvent annotEvent)
-        {
-            PolygonalEvent = null;
-            if (annotEvent != null)
-            {
-                foreach (AnnotAttrib attrib in annotEvent.Attribs.Keys)
-                {
-                    switch (attrib)
-                    {
-                        case AnnotAttrib.Color:
-                            BorderColorPickerControl.SetCheckedForColor((Color)annotEvent.Attribs[attrib]);
-                            break;
-                        case AnnotAttrib.FillColor:
-                            FillColorPickerControl.SetCheckedForColor((Color)annotEvent.Attribs[attrib]);
-                            break;
-                        case AnnotAttrib.Transparency:
-                            double transparennt = Convert.ToDouble(annotEvent.Attribs[attrib]);
-                            if (transparennt > 1)
-                            {
-                                transparennt = (transparennt / 255D);
-                            }
-                            CPDFOpacityControl.OpacityValue = (int)(transparennt * 100);
-                            break;
-                        case AnnotAttrib.LineStyle:
-                            CPDFLineStyleControl.DashStyle = (DashStyle)(annotEvent.Attribs[attrib]);
-                            break;
-                        case AnnotAttrib.FontColor:
-                            FontColorPickerControl.SetCheckedForColor((Color)annotEvent.Attribs[attrib]);
-                            break;
-                        case AnnotAttrib.FontName:
-                            {
-                                string fontName = (string)annotEvent.Attribs[AnnotAttrib.FontName];
-                                if (fontName.Contains("Courier"))
-                                {
-                                    FontCombox.SelectedIndex = 1;
-                                }
-                                else if (fontName == "Arial" || fontName.Contains("Helvetica"))
-                                {
-                                    FontCombox.SelectedIndex = 0;
+        //public void SetAnnotEventData(AnnotAttribEvent annotEvent)
+        //{
+        //    PolygonalEvent = null;
+        //    if (annotEvent != null)
+        //    {
+        //        foreach (AnnotAttrib attrib in annotEvent.Attribs.Keys)
+        //        {
+        //            switch (attrib)
+        //            {
+        //                case AnnotAttrib.Color:
+        //                    BorderColorPickerControl.SetCheckedForColor((Color)annotEvent.Attribs[attrib]);
+        //                    break;
+        //                case AnnotAttrib.FillColor:
+        //                    FillColorPickerControl.SetCheckedForColor((Color)annotEvent.Attribs[attrib]);
+        //                    break;
+        //                case AnnotAttrib.Transparency:
+        //                    double transparennt = Convert.ToDouble(annotEvent.Attribs[attrib]);
+        //                    if (transparennt > 1)
+        //                    {
+        //                        transparennt = (transparennt / 255D);
+        //                    }
+        //                    CPDFOpacityControl.OpacityValue = (int)(transparennt * 100);
+        //                    break;
+        //                case AnnotAttrib.LineStyle:
+        //                    CPDFLineStyleControl.DashStyle = (DashStyle)(annotEvent.Attribs[attrib]);
+        //                    break;
+        //                case AnnotAttrib.FontColor:
+        //                    FontColorPickerControl.SetCheckedForColor((Color)annotEvent.Attribs[attrib]);
+        //                    break;
+        //                case AnnotAttrib.FontName:
+        //                    {
+        //                        string fontName = (string)annotEvent.Attribs[AnnotAttrib.FontName];
+        //                        if (fontName.Contains("Courier"))
+        //                        {
+        //                            FontCombox.SelectedIndex = 1;
+        //                        }
+        //                        else if (fontName == "Arial" || fontName.Contains("Helvetica"))
+        //                        {
+        //                            FontCombox.SelectedIndex = 0;
 
-                                }
-                                else if (fontName.Contains("Times"))
-                                {
-                                    FontCombox.SelectedIndex = 2;
-                                }
-                                else
-                                {
-                                    FontCombox.SelectedIndex = -1;
-                                }
-                            }
-                            break;
-                        case AnnotAttrib.FontSize:
-                            SetFontSize(Convert.ToDouble(annotEvent.Attribs[attrib]));
-                            break;
-                        case AnnotAttrib.NoteText:
-                            NoteTextBox.Text = annotEvent.Attribs[attrib].ToString();
-                            break;
-                        default:
-                            break;
-                    }
-                }
+        //                        }
+        //                        else if (fontName.Contains("Times"))
+        //                        {
+        //                            FontCombox.SelectedIndex = 2;
+        //                        }
+        //                        else
+        //                        {
+        //                            FontCombox.SelectedIndex = -1;
+        //                        }
+        //                    }
+        //                    break;
+        //                case AnnotAttrib.FontSize:
+        //                    SetFontSize(Convert.ToDouble(annotEvent.Attribs[attrib]));
+        //                    break;
+        //                case AnnotAttrib.NoteText:
+        //                    NoteTextBox.Text = annotEvent.Attribs[attrib].ToString();
+        //                    break;
+        //                default:
+        //                    break;
+        //            }
+        //        }
 
 
-                bool isBold = false;
-                bool isItalic = false;
-                if (annotEvent.Attribs.ContainsKey(AnnotAttrib.IsBold))
-                {
-                    isBold = (bool)annotEvent.Attribs[AnnotAttrib.IsBold];
-                }
-                if (annotEvent.Attribs.ContainsKey(AnnotAttrib.IsItalic))
-                {
-                    isItalic = (bool)annotEvent.Attribs[AnnotAttrib.IsItalic];
-                }
+        //        bool isBold = false;
+        //        bool isItalic = false;
+        //        if (annotEvent.Attribs.ContainsKey(AnnotAttrib.IsBold))
+        //        {
+        //            isBold = (bool)annotEvent.Attribs[AnnotAttrib.IsBold];
+        //        }
+        //        if (annotEvent.Attribs.ContainsKey(AnnotAttrib.IsItalic))
+        //        {
+        //            isItalic = (bool)annotEvent.Attribs[AnnotAttrib.IsItalic];
+        //        }
 
-                SetFontStyle(isBold, isItalic);
-            }
+        //        SetFontStyle(isBold, isItalic);
+        //    }
 
-            PolygonalEvent = annotEvent;
-        }
+        //    PolygonalEvent = annotEvent;
+        //}
 
         public void SetFontStyle(bool isBold, bool isItalic)
         {

+ 131 - 132
Demo/Examples/Compdfkit_Tools/Measure/Property/StraightnessProperty.xaml.cs

@@ -2,7 +2,6 @@
 using Compdfkit_Tools.Common;
 using Compdfkit_Tools.Data;
 using ComPDFKitViewer;
-using ComPDFKitViewer.AnnotEvent;
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
@@ -27,7 +26,7 @@ namespace Compdfkit_Tools.Measure.Property
     /// </summary>
     public partial class StraightnessProperty : UserControl
     {
-        private AnnotAttribEvent LineEvent { get; set; }
+        //private AnnotAttribEvent LineEvent { get; set; }
         public ObservableCollection<int> SizeList { get; set; } = new ObservableCollection<int>
         {
             6,8,9,10,12,14,18,20,24,26,28,32,30,32,48,72
@@ -42,8 +41,8 @@ namespace Compdfkit_Tools.Measure.Property
 
         private void NoteTextBox_TextChanged(object sender, TextChangedEventArgs e)
         {
-            LineEvent?.UpdateAttrib(AnnotAttrib.NoteText, NoteTextBox.Text);
-            LineEvent?.UpdateAnnot();
+            //LineEvent?.UpdateAttrib(AnnotAttrib.NoteText, NoteTextBox.Text);
+            //LineEvent?.UpdateAnnot();
         }
 
         private void FontStyleCombox_SelectionChanged(object sender, SelectionChangedEventArgs e)
@@ -73,17 +72,17 @@ namespace Compdfkit_Tools.Measure.Property
                 default:
                     break;
             }
-            LineEvent?.UpdateAttrib(AnnotAttrib.IsBold, isBold);
-            LineEvent?.UpdateAttrib(AnnotAttrib.IsItalic, isItalic);
-            LineEvent?.UpdateAnnot();
+            //LineEvent?.UpdateAttrib(AnnotAttrib.IsBold, isBold);
+            //LineEvent?.UpdateAttrib(AnnotAttrib.IsItalic, isItalic);
+            //LineEvent?.UpdateAnnot();
         }
 
         private void FontSizeComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
         {
             if (IsLoadedData)
             {
-                LineEvent?.UpdateAttrib(AnnotAttrib.FontSize, (sender as ComboBox).SelectedItem);
-                LineEvent?.UpdateAnnot();
+                //LineEvent?.UpdateAttrib(AnnotAttrib.FontSize, (sender as ComboBox).SelectedItem);
+                //LineEvent?.UpdateAnnot();
             }
         }
 
@@ -92,8 +91,8 @@ namespace Compdfkit_Tools.Measure.Property
             ComboBoxItem selectItem = FontCombox.SelectedItem as ComboBoxItem;
             if (selectItem != null && selectItem.Content != null)
             {
-                LineEvent?.UpdateAttrib(AnnotAttrib.FontName, selectItem.Content.ToString());
-                LineEvent?.UpdateAnnot();
+                //LineEvent?.UpdateAttrib(AnnotAttrib.FontName, selectItem.Content.ToString());
+                //LineEvent?.UpdateAnnot();
             }
         }
 
@@ -102,133 +101,133 @@ namespace Compdfkit_Tools.Measure.Property
             SolidColorBrush checkBrush = BorderColorPickerControl.GetBrush() as SolidColorBrush;
             if (checkBrush != null)
             {
-                LineEvent?.UpdateAttrib(AnnotAttrib.Color, checkBrush.Color);
-                LineEvent?.UpdateAnnot();
+                //LineEvent?.UpdateAttrib(AnnotAttrib.Color, checkBrush.Color);
+                //LineEvent?.UpdateAnnot();
             }
         }
 
         private void CPDFOpacityControl_OpacityChanged(object sender, EventArgs e)
         {
-            LineEvent?.UpdateAttrib(AnnotAttrib.Transparency, CPDFOpacityControl.OpacityValue/100D);
-            LineEvent?.UpdateAnnot();
+            //LineEvent?.UpdateAttrib(AnnotAttrib.Transparency, CPDFOpacityControl.OpacityValue/100D);
+            //LineEvent?.UpdateAnnot();
         }
 
-        public void SetAnnotEventData(AnnotAttribEvent annotEvent)
-        {
-            LineEvent = null;
-            if(annotEvent!=null)
-            {
-                foreach(AnnotAttrib attrib in annotEvent.Attribs.Keys)
-                {
-                    switch(attrib)
-                    {
-                        case AnnotAttrib.Color:
-                            BorderColorPickerControl.SetCheckedForColor((Color)annotEvent.Attribs[attrib]);
-                            break;
-                        case AnnotAttrib.Transparency:
-                            double transparennt= Convert.ToDouble(annotEvent.Attribs[attrib]);
-                            if(transparennt>1)
-                            {
-                                transparennt =(transparennt / 255D);
-                            }
-                            CPDFOpacityControl.OpacityValue = (int)(transparennt*100);
-                            break;
-                        case AnnotAttrib.Thickness:
-                            CPDFThicknessControl.Thickness = Convert.ToInt16(annotEvent.Attribs[attrib]);
-                            break;
-                        case AnnotAttrib.LineStyle:
-                            CPDFLineStyleControl.DashStyle= (DashStyle)(annotEvent.Attribs[attrib]);
-                            break;
-                        case AnnotAttrib.FontColor:
-                            FontColorPickerControl.SetCheckedForColor((Color)annotEvent.Attribs[attrib]);
-                            break;
-                        case AnnotAttrib.FontName:
-                            {
-                                string fontName= (string)annotEvent.Attribs[AnnotAttrib.FontName];
-                                if (fontName.Contains("Courier"))
-                                {
-                                    FontCombox.SelectedIndex = 1;
-                                }
-                                else if (fontName == "Arial" || fontName.Contains("Helvetica"))
-                                {
-                                    FontCombox.SelectedIndex = 0;
+        //public void SetAnnotEventData(AnnotAttribEvent annotEvent)
+        //{
+        //    LineEvent = null;
+        //    if(annotEvent!=null)
+        //    {
+        //        foreach(AnnotAttrib attrib in annotEvent.Attribs.Keys)
+        //        {
+        //            switch(attrib)
+        //            {
+        //                case AnnotAttrib.Color:
+        //                    BorderColorPickerControl.SetCheckedForColor((Color)annotEvent.Attribs[attrib]);
+        //                    break;
+        //                case AnnotAttrib.Transparency:
+        //                    double transparennt= Convert.ToDouble(annotEvent.Attribs[attrib]);
+        //                    if(transparennt>1)
+        //                    {
+        //                        transparennt =(transparennt / 255D);
+        //                    }
+        //                    CPDFOpacityControl.OpacityValue = (int)(transparennt*100);
+        //                    break;
+        //                case AnnotAttrib.Thickness:
+        //                    CPDFThicknessControl.Thickness = Convert.ToInt16(annotEvent.Attribs[attrib]);
+        //                    break;
+        //                case AnnotAttrib.LineStyle:
+        //                    CPDFLineStyleControl.DashStyle= (DashStyle)(annotEvent.Attribs[attrib]);
+        //                    break;
+        //                case AnnotAttrib.FontColor:
+        //                    FontColorPickerControl.SetCheckedForColor((Color)annotEvent.Attribs[attrib]);
+        //                    break;
+        //                case AnnotAttrib.FontName:
+        //                    {
+        //                        string fontName= (string)annotEvent.Attribs[AnnotAttrib.FontName];
+        //                        if (fontName.Contains("Courier"))
+        //                        {
+        //                            FontCombox.SelectedIndex = 1;
+        //                        }
+        //                        else if (fontName == "Arial" || fontName.Contains("Helvetica"))
+        //                        {
+        //                            FontCombox.SelectedIndex = 0;
 
-                                }
-                                else if (fontName.Contains("Times"))
-                                {
-                                    FontCombox.SelectedIndex = 2;
-                                }
-                                else
-                                {
-                                    FontCombox.SelectedIndex = -1;
-                                }
-                            }
-                            break;
-                        case AnnotAttrib.FontSize:
-                            SetFontSize(Convert.ToDouble(annotEvent.Attribs[attrib]));
-                            break;
-                        case AnnotAttrib.NoteText:
-                            NoteTextBox.Text= annotEvent.Attribs[attrib].ToString();
-                            break;
-                        default:
-                            break;
-                    }
-                }
+        //                        }
+        //                        else if (fontName.Contains("Times"))
+        //                        {
+        //                            FontCombox.SelectedIndex = 2;
+        //                        }
+        //                        else
+        //                        {
+        //                            FontCombox.SelectedIndex = -1;
+        //                        }
+        //                    }
+        //                    break;
+        //                case AnnotAttrib.FontSize:
+        //                    SetFontSize(Convert.ToDouble(annotEvent.Attribs[attrib]));
+        //                    break;
+        //                case AnnotAttrib.NoteText:
+        //                    NoteTextBox.Text= annotEvent.Attribs[attrib].ToString();
+        //                    break;
+        //                default:
+        //                    break;
+        //            }
+        //        }
 
-                C_LINE_TYPE headLineType = C_LINE_TYPE.LINETYPE_NONE;
-                C_LINE_TYPE tailLineType = C_LINE_TYPE.LINETYPE_NONE;
+        //        C_LINE_TYPE headLineType = C_LINE_TYPE.LINETYPE_NONE;
+        //        C_LINE_TYPE tailLineType = C_LINE_TYPE.LINETYPE_NONE;
 
-                if(annotEvent.Attribs.ContainsKey(AnnotAttrib.LineStart))
-                {
-                    headLineType = (C_LINE_TYPE)annotEvent.Attribs[AnnotAttrib.LineStart];
-                }
-                if (annotEvent.Attribs.ContainsKey(AnnotAttrib.LineEnd))
-                {
-                    tailLineType = (C_LINE_TYPE)annotEvent.Attribs[AnnotAttrib.LineEnd];
-                }
-                LineType lineType = new LineType()
-                {
-                    HeadLineType = headLineType,
-                    TailLineType = tailLineType
-                };
-                CPDFArrowControl.LineType = lineType;
+        //        if(annotEvent.Attribs.ContainsKey(AnnotAttrib.LineStart))
+        //        {
+        //            headLineType = (C_LINE_TYPE)annotEvent.Attribs[AnnotAttrib.LineStart];
+        //        }
+        //        if (annotEvent.Attribs.ContainsKey(AnnotAttrib.LineEnd))
+        //        {
+        //            tailLineType = (C_LINE_TYPE)annotEvent.Attribs[AnnotAttrib.LineEnd];
+        //        }
+        //        LineType lineType = new LineType()
+        //        {
+        //            HeadLineType = headLineType,
+        //            TailLineType = tailLineType
+        //        };
+        //        CPDFArrowControl.LineType = lineType;
 
-                bool isBold=false; 
-                bool isItalic=false;
-                if (annotEvent.Attribs.ContainsKey(AnnotAttrib.IsBold))
-                {
-                    isBold = (bool)annotEvent.Attribs[AnnotAttrib.IsBold];
-                }
-                if (annotEvent.Attribs.ContainsKey(AnnotAttrib.IsItalic))
-                {
-                    isItalic = (bool)annotEvent.Attribs[AnnotAttrib.IsItalic];
-                }
+        //        bool isBold=false; 
+        //        bool isItalic=false;
+        //        if (annotEvent.Attribs.ContainsKey(AnnotAttrib.IsBold))
+        //        {
+        //            isBold = (bool)annotEvent.Attribs[AnnotAttrib.IsBold];
+        //        }
+        //        if (annotEvent.Attribs.ContainsKey(AnnotAttrib.IsItalic))
+        //        {
+        //            isItalic = (bool)annotEvent.Attribs[AnnotAttrib.IsItalic];
+        //        }
 
-                SetFontStyle(isBold, isItalic);
-            }
+        //        SetFontStyle(isBold, isItalic);
+        //    }
 
-            LineEvent =annotEvent;
-        }
+        //    LineEvent =annotEvent;
+        //}
 
-        public void SetAnnotArgsData(LineMeasureArgs annotArgs)
-        {
-            Dictionary<AnnotAttrib, object> attribDict = new Dictionary<AnnotAttrib, object>();
-            attribDict[AnnotAttrib.Color] = annotArgs.LineColor;
-            attribDict[AnnotAttrib.Transparency] = annotArgs.Transparency;
-            attribDict[AnnotAttrib.Thickness] = annotArgs.LineWidth;
-            attribDict[AnnotAttrib.LineStyle] = annotArgs.LineDash;
-            attribDict[AnnotAttrib.LineStart] = annotArgs.HeadLineType;
-            attribDict[AnnotAttrib.LineEnd] = annotArgs.TailLineType;
-            attribDict[AnnotAttrib.FontColor] = annotArgs.FontColor;
-            attribDict[AnnotAttrib.FontName] = annotArgs.FontName;
-            attribDict[AnnotAttrib.IsBold] = annotArgs.IsBold;
-            attribDict[AnnotAttrib.IsItalic] = annotArgs.IsItalic;
-            attribDict[AnnotAttrib.FontSize] = annotArgs.FontSize;
-            attribDict[AnnotAttrib.NoteText] = annotArgs.Content;
+        //public void SetAnnotArgsData(LineMeasureArgs annotArgs)
+        //{
+        //    Dictionary<AnnotAttrib, object> attribDict = new Dictionary<AnnotAttrib, object>();
+        //    attribDict[AnnotAttrib.Color] = annotArgs.LineColor;
+        //    attribDict[AnnotAttrib.Transparency] = annotArgs.Transparency;
+        //    attribDict[AnnotAttrib.Thickness] = annotArgs.LineWidth;
+        //    attribDict[AnnotAttrib.LineStyle] = annotArgs.LineDash;
+        //    attribDict[AnnotAttrib.LineStart] = annotArgs.HeadLineType;
+        //    attribDict[AnnotAttrib.LineEnd] = annotArgs.TailLineType;
+        //    attribDict[AnnotAttrib.FontColor] = annotArgs.FontColor;
+        //    attribDict[AnnotAttrib.FontName] = annotArgs.FontName;
+        //    attribDict[AnnotAttrib.IsBold] = annotArgs.IsBold;
+        //    attribDict[AnnotAttrib.IsItalic] = annotArgs.IsItalic;
+        //    attribDict[AnnotAttrib.FontSize] = annotArgs.FontSize;
+        //    attribDict[AnnotAttrib.NoteText] = annotArgs.Content;
 
-            AnnotAttribEvent annotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annotArgs, attribDict);
-            SetAnnotEventData(annotEvent);
-        }
+        //    AnnotAttribEvent annotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annotArgs, attribDict);
+        //    SetAnnotEventData(annotEvent);
+        //}
 
         public void SetFontStyle(bool isBold, bool isItalic)
         {
@@ -264,21 +263,21 @@ namespace Compdfkit_Tools.Measure.Property
 
         private void CPDFThicknessControl_ThicknessChanged(object sender, EventArgs e)
         {
-            LineEvent?.UpdateAttrib(AnnotAttrib.Thickness, CPDFThicknessControl.Thickness);
-            LineEvent?.UpdateAnnot();
+            //LineEvent?.UpdateAttrib(AnnotAttrib.Thickness, CPDFThicknessControl.Thickness);
+            //LineEvent?.UpdateAnnot();
         }
 
         private void CPDFLineStyleControl_LineStyleChanged(object sender, EventArgs e)
         {
-            LineEvent?.UpdateAttrib(AnnotAttrib.LineStyle, CPDFLineStyleControl.DashStyle);
-            LineEvent?.UpdateAnnot();
+            //LineEvent?.UpdateAttrib(AnnotAttrib.LineStyle, CPDFLineStyleControl.DashStyle);
+            //LineEvent?.UpdateAnnot();
         }
 
         private void CPDFArrowControl_ArrowChanged(object sender, EventArgs e)
         {
-            LineEvent?.UpdateAttrib(AnnotAttrib.LineStart, CPDFArrowControl.LineType.HeadLineType);
-            LineEvent?.UpdateAttrib(AnnotAttrib.LineEnd, CPDFArrowControl.LineType.TailLineType);
-            LineEvent?.UpdateAnnot();
+            //LineEvent?.UpdateAttrib(AnnotAttrib.LineStart, CPDFArrowControl.LineType.HeadLineType);
+            //LineEvent?.UpdateAttrib(AnnotAttrib.LineEnd, CPDFArrowControl.LineType.TailLineType);
+            //LineEvent?.UpdateAnnot();
         }
 
         private void FontColorPickerControl_ColorChanged(object sender, EventArgs e)
@@ -286,8 +285,8 @@ namespace Compdfkit_Tools.Measure.Property
             SolidColorBrush checkBrush = FontColorPickerControl.GetBrush() as SolidColorBrush;
             if (checkBrush != null)
             {
-                LineEvent?.UpdateAttrib(AnnotAttrib.FontColor, checkBrush.Color);
-                LineEvent?.UpdateAnnot();
+                //LineEvent?.UpdateAttrib(AnnotAttrib.FontColor, checkBrush.Color);
+                //LineEvent?.UpdateAnnot();
             }
         }
 

+ 0 - 4
Demo/Examples/ContentEditor/ContentEditor.csproj

@@ -120,10 +120,6 @@
       <Project>{783263cf-0da3-4095-9df8-2c4a6b3ff908}</Project>
       <Name>ComPDFKit.Viewer</Name>
     </ProjectReference>
-    <ProjectReference Include="..\..\..\..\compdfkit_windows\ComPDFKit\ComPDFKitCSharp\ComPDFKit.Desk.csproj">
-      <Project>{56e518ad-c126-4b48-9a09-0a64c87020e4}</Project>
-      <Name>ComPDFKit.Desk</Name>
-    </ProjectReference>
     <ProjectReference Include="..\Compdfkit_Tools\Compdfkit_Tools.csproj">
       <Project>{9363bcb1-3a67-446a-8093-5708b86bf418}</Project>
       <Name>Compdfkit_Tools</Name>

+ 20 - 0
Demo/Examples/Examlpes.sln

@@ -124,6 +124,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UrlLoadTest", "Samples\UrlL
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StreamLoadTest", "Samples\StreamLoadTest\StreamLoadTest.csproj", "{5498DB67-4E92-4C6C-A8B9-4729165DEDB2}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Measure", "Measure\Measure.csproj", "{75A0C673-E1D8-4FCE-8804-95E4F0630200}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -1125,6 +1127,24 @@ Global
 		{5498DB67-4E92-4C6C-A8B9-4729165DEDB2}.Release|x64.Build.0 = Release|Any CPU
 		{5498DB67-4E92-4C6C-A8B9-4729165DEDB2}.Release|x86.ActiveCfg = Release|Any CPU
 		{5498DB67-4E92-4C6C-A8B9-4729165DEDB2}.Release|x86.Build.0 = Release|Any CPU
+		{75A0C673-E1D8-4FCE-8804-95E4F0630200}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{75A0C673-E1D8-4FCE-8804-95E4F0630200}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{75A0C673-E1D8-4FCE-8804-95E4F0630200}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{75A0C673-E1D8-4FCE-8804-95E4F0630200}.Debug|x64.Build.0 = Debug|Any CPU
+		{75A0C673-E1D8-4FCE-8804-95E4F0630200}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{75A0C673-E1D8-4FCE-8804-95E4F0630200}.Debug|x86.Build.0 = Debug|Any CPU
+		{75A0C673-E1D8-4FCE-8804-95E4F0630200}.DemoTest|Any CPU.ActiveCfg = Debug|Any CPU
+		{75A0C673-E1D8-4FCE-8804-95E4F0630200}.DemoTest|Any CPU.Build.0 = Debug|Any CPU
+		{75A0C673-E1D8-4FCE-8804-95E4F0630200}.DemoTest|x64.ActiveCfg = Debug|Any CPU
+		{75A0C673-E1D8-4FCE-8804-95E4F0630200}.DemoTest|x64.Build.0 = Debug|Any CPU
+		{75A0C673-E1D8-4FCE-8804-95E4F0630200}.DemoTest|x86.ActiveCfg = Debug|Any CPU
+		{75A0C673-E1D8-4FCE-8804-95E4F0630200}.DemoTest|x86.Build.0 = Debug|Any CPU
+		{75A0C673-E1D8-4FCE-8804-95E4F0630200}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{75A0C673-E1D8-4FCE-8804-95E4F0630200}.Release|Any CPU.Build.0 = Release|Any CPU
+		{75A0C673-E1D8-4FCE-8804-95E4F0630200}.Release|x64.ActiveCfg = Release|Any CPU
+		{75A0C673-E1D8-4FCE-8804-95E4F0630200}.Release|x64.Build.0 = Release|Any CPU
+		{75A0C673-E1D8-4FCE-8804-95E4F0630200}.Release|x86.ActiveCfg = Release|Any CPU
+		{75A0C673-E1D8-4FCE-8804-95E4F0630200}.Release|x86.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 0 - 7
Demo/Examples/Measure/Measure.csproj

@@ -156,11 +156,4 @@
     </BootstrapperPackage>
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-  <Import Project="..\packages\ComPDFKit.NetFramework.1.9.1\build\ComPDFKit.NetFramework.targets" Condition="Exists('..\packages\ComPDFKit.NetFramework.1.9.1\build\ComPDFKit.NetFramework.targets')" />
-  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
-    <PropertyGroup>
-      <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
-    </PropertyGroup>
-    <Error Condition="!Exists('..\packages\ComPDFKit.NetFramework.1.9.1\build\ComPDFKit.NetFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\ComPDFKit.NetFramework.1.9.1\build\ComPDFKit.NetFramework.targets'))" />
-  </Target>
 </Project>

+ 1 - 0
Demo/Examples/PDFViewer/MainPage.xaml

@@ -182,6 +182,7 @@
                     <ComboBoxItem Tag="Content Editor" Content="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Func_ContentEditor}"></ComboBoxItem>
                     <ComboBoxItem Tag="Document Editor" Content="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Func_DocEditor}"></ComboBoxItem>
                     <ComboBoxItem Tag="Digital Signature" Content="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Func_Signatures}"></ComboBoxItem>
+                    <ComboBoxItem Tag="Measurement" Content="Measurement"></ComboBoxItem>
                 </ComboBox>
 
                 <StackPanel Orientation="Horizontal" Grid.Column="2">

+ 19 - 0
Demo/Examples/PDFViewer/MainPage.xaml.cs

@@ -1,5 +1,7 @@
 using ComPDFKit.PDFDocument;
+using ComPDFKit.Tool;
 using Compdfkit_Tools.Helper;
+using Compdfkit_Tools.Measure;
 using Compdfkit_Tools.PDFControl;
 using Compdfkit_Tools.PDFView;
 using ComPDFKitViewer;
@@ -29,6 +31,7 @@ namespace PDFViewer
         private FormControl formControl = new FormControl();
         private ContentEditControl contentEditControl = new ContentEditControl();
         private PageEditControl pageEditControl = new PageEditControl();
+        private MeasureControl measureControl = new MeasureControl();
         private DigitalSignatureControl digitalSignatureControl = new DigitalSignatureControl();
         private SignatureStatusBarControl signatureStatusBarControl = new SignatureStatusBarControl();
         private CPDFBOTABarControl botaBarControl = new CPDFBOTABarControl();
@@ -480,6 +483,12 @@ namespace PDFViewer
                 digitalSignatureControl.ClearViewerControl();
                 botaBarControl.RemoveBOTAContent(BOTATools.Signature);
             }
+            else if (currentMode == "Measurement")
+            {
+                RightPanelButton.Visibility = Visibility.Visible;
+                measureControl.ClearAllToolState();
+                measureControl.ClearViewerControl();
+            }
 
             if (item.Tag as string == "Viewer")
             {
@@ -585,6 +594,16 @@ namespace PDFViewer
                     digitalSignatureControl.AfterFillSignature += DigitalSignatureControl_AfterFillSignature;
                 }
             }
+            else if (item.Tag as string == "Measurement")
+            {
+                if (contentEditControl.pdfContentEditControl != null && viewControl != null)
+                {
+                    RightPanelButton.Visibility = Visibility.Visible;
+                    PDFGrid.Child = measureControl;
+                    viewControl.PDFViewTool.SetViewerModel(MouseModes.kPanTool);
+                    measureControl.InitWithPDFViewer(viewControl);
+                }
+            }
             currentMode = item.Tag as string;
             RightToolPanelButtonIsChecked = false;
         }

+ 1 - 1
Demo/Examples/PDFViewer/PDFViewer.csproj

@@ -209,7 +209,7 @@
       <Name>ComPDFKit.Viewer</Name>
     </ProjectReference>
     <ProjectReference Include="..\..\..\..\compdfkit_windows\ComPDFKit\ComPDFKitCSharp\ComPDFKit.Desk.csproj">
-      <Project>{56E518AD-C126-4B48-9A09-0A64C87020E4}</Project>
+      <Project>{56e518ad-c126-4b48-9a09-0a64c87020e4}</Project>
       <Name>ComPDFKit.Desk</Name>
     </ProjectReference>
     <ProjectReference Include="..\Compdfkit_Tools\Compdfkit_Tools.csproj">

BIN
Demo/Examples/packages/ComPDFKit.NetFramework.1.9.1/build/x64/ComPDFKit.dll


BIN
Demo/Examples/packages/ComPDFKit.NetFramework.1.9.1/build/x86/ComPDFKit.dll