浏览代码

ComPDFKit.Tool(win) - 修正IsMeasured接口名

TangJinZhou 7 月之前
父节点
当前提交
f28f88f4e5

+ 17 - 17
Demo/Examples/ComPDFKit.Tool/CPDFToolManager.cs

@@ -621,7 +621,7 @@ namespace ComPDFKit.Tool
             switch (e.annotData.AnnotType)
             {
                 case C_ANNOTATION_TYPE.C_ANNOTATION_LINE:
-                    if ((e.annotData.Annot as CPDFLineAnnotation).IsMersured())
+                    if ((e.annotData.Annot as CPDFLineAnnotation).IsMeasured())
                     {
                         List<Point> cPoints = new List<Point>();
                         for (int i = 0; i < e.Points.Count; i++)
@@ -686,7 +686,7 @@ namespace ComPDFKit.Tool
                         }
                         lineMeasure.UpdateAnnotMeasure();
                         annotLine.UpdateAp();
-                        if (annotLine.IsMersured())
+                        if (annotLine.IsMeasured())
                         {
                             PostMeasureInfo(this, annotLine);
                         }
@@ -736,7 +736,7 @@ namespace ComPDFKit.Tool
                             (float)top));
                         annotLine.GetAreaMeasure().UpdateAnnotMeasure();
                         annotLine.UpdateAp();
-                        if (annotLine.IsMersured())
+                        if (annotLine.IsMeasured())
                         {
                             PostMeasureInfo(this, annotLine);
                         }
@@ -768,7 +768,7 @@ namespace ComPDFKit.Tool
 
                         annotLine.GetPerimeterMeasure().UpdateAnnotMeasure();
                         annotLine.UpdateAp();
-                        if (annotLine.IsMersured())
+                        if (annotLine.IsMeasured())
                         {
                             PostMeasureInfo(this, annotLine);
                         }
@@ -1083,7 +1083,7 @@ namespace ComPDFKit.Tool
                 {
                     case C_ANNOTATION_TYPE.C_ANNOTATION_LINE:
                         {
-                            if ((cPDFAnnotation as CPDFLineAnnotation).IsMersured())
+                            if ((cPDFAnnotation as CPDFLineAnnotation).IsMeasured())
                             {
                                 MeasureSetting measureSetting = viewerTool.GetMeasureSetting();
                                 if (viewerTool.GetMoveLength() > measureSetting.MoveDetectionLength)
@@ -1094,7 +1094,7 @@ namespace ComPDFKit.Tool
                         }
                         break;
                     case C_ANNOTATION_TYPE.C_ANNOTATION_POLYGON:
-                        if ((cPDFAnnotation as CPDFPolygonAnnotation).IsMersured())
+                        if ((cPDFAnnotation as CPDFPolygonAnnotation).IsMeasured())
                         {
                             DefaultSettingParam defSetting = viewerTool.GetDefaultSettingParam();
                             if (defSetting.IsCreateSquarePolygonMeasure)
@@ -1161,7 +1161,7 @@ namespace ComPDFKit.Tool
                         return;
                     case C_ANNOTATION_TYPE.C_ANNOTATION_LINE:
                         {
-                            if ((annotation as CPDFLineAnnotation).IsMersured())
+                            if ((annotation as CPDFLineAnnotation).IsMeasured())
                             {
                                 if (measurepoints.Count > 1)
                                 {
@@ -1205,7 +1205,7 @@ namespace ComPDFKit.Tool
                         break;
                     case C_ANNOTATION_TYPE.C_ANNOTATION_POLYGON:
                         {
-                            if ((annotation as CPDFPolygonAnnotation).IsMersured())
+                            if ((annotation as CPDFPolygonAnnotation).IsMeasured())
                             {
                                 List<CPoint> cPoints = new List<CPoint>();
                                 foreach (Point item in measurepoints)
@@ -1220,7 +1220,7 @@ namespace ComPDFKit.Tool
                         break;
                     case C_ANNOTATION_TYPE.C_ANNOTATION_POLYLINE:
                         {
-                            if ((annotation as CPDFPolylineAnnotation).IsMersured())
+                            if ((annotation as CPDFPolylineAnnotation).IsMeasured())
                             {
                                 List<CPoint> cPoints = new List<CPoint>();
                                 foreach (Point item in measurepoints)
@@ -1454,7 +1454,7 @@ namespace ComPDFKit.Tool
                 if (rawAnnot.Type == C_ANNOTATION_TYPE.C_ANNOTATION_LINE)
                 {
                     CPDFLineAnnotation lineAnnot = rawAnnot as CPDFLineAnnotation;
-                    if (lineAnnot.IsMersured() && lineAnnot.Points != null && lineAnnot.Points.Count() == 2)
+                    if (lineAnnot.IsMeasured() && lineAnnot.Points != null && lineAnnot.Points.Count() == 2)
                     {
                         CPDFDistanceMeasure lineMeasure = lineAnnot.GetDistanceMeasure();
                         CPDFMeasureInfo measureInfo = lineMeasure.MeasureInfo;
@@ -1487,7 +1487,7 @@ namespace ComPDFKit.Tool
                 if (rawAnnot.Type == C_ANNOTATION_TYPE.C_ANNOTATION_POLYLINE)
                 {
                     CPDFPolylineAnnotation polylineAnnot = rawAnnot as CPDFPolylineAnnotation;
-                    if (polylineAnnot.IsMersured() && polylineAnnot.Points != null && polylineAnnot.Points.Count() >= 2)
+                    if (polylineAnnot.IsMeasured() && polylineAnnot.Points != null && polylineAnnot.Points.Count() >= 2)
                     {
                         double totalInch = 0;
                         for (int i = 0; i < polylineAnnot.Points.Count - 1; i++)
@@ -1527,7 +1527,7 @@ namespace ComPDFKit.Tool
                 if (rawAnnot.Type == C_ANNOTATION_TYPE.C_ANNOTATION_POLYGON)
                 {
                     CPDFPolygonAnnotation polygonAnnot = rawAnnot as CPDFPolygonAnnotation;
-                    if (polygonAnnot.IsMersured() && polygonAnnot.Points != null && polygonAnnot.Points.Count() >= 2)
+                    if (polygonAnnot.IsMeasured() && polygonAnnot.Points != null && polygonAnnot.Points.Count() >= 2)
                     {
                         double totalInch = 0;
                         for (int i = 0; i < polygonAnnot.Points.Count - 1; i++)
@@ -2012,7 +2012,7 @@ namespace ComPDFKit.Tool
                                                     CPDFLineAnnotation LineAnnotation = (cPDFAnnotation as CPDFLineAnnotation);
                                                     if (LineAnnotation != null)
                                                     {
-                                                        if (LineAnnotation.IsMersured())
+                                                        if (LineAnnotation.IsMeasured())
                                                         {
                                                             cansave = false;
                                                         }
@@ -2024,10 +2024,10 @@ namespace ComPDFKit.Tool
                                                 {
                                                     bool cansave = true;
                                                     CPDFPolygonAnnotation PolyAnnotation = (cPDFAnnotation as CPDFPolygonAnnotation);
-                                                    PolyAnnotation?.IsMersured();
+                                                    PolyAnnotation?.IsMeasured();
                                                     if (PolyAnnotation != null)
                                                     {
-                                                        if (PolyAnnotation.IsMersured())
+                                                        if (PolyAnnotation.IsMeasured())
                                                         {
                                                             cansave = false;
                                                         }
@@ -2039,10 +2039,10 @@ namespace ComPDFKit.Tool
                                                 {
                                                     bool cansave = true;
                                                     CPDFPolylineAnnotation PolyAnnotation = (cPDFAnnotation as CPDFPolylineAnnotation);
-                                                    PolyAnnotation?.IsMersured();
+                                                    PolyAnnotation?.IsMeasured();
                                                     if (PolyAnnotation != null)
                                                     {
-                                                        if (PolyAnnotation.IsMersured())
+                                                        if (PolyAnnotation.IsMeasured())
                                                         {
                                                             cansave = false;
                                                         }

+ 3 - 3
Demo/Examples/ComPDFKit.Tool/CPDFViewerTool.DataMethod.cs

@@ -720,7 +720,7 @@ namespace ComPDFKit.Tool
             {
                 return;
             }
-            if (!LineAnnotation.IsMersured() && annotParam != null)
+            if (!LineAnnotation.IsMeasured() && annotParam != null)
             {
                 return;
             }
@@ -783,7 +783,7 @@ namespace ComPDFKit.Tool
             {
                 return;
             }
-            if (!PolyAnnotation.IsMersured() && annotParam != null)
+            if (!PolyAnnotation.IsMeasured() && annotParam != null)
             {
                 return;
             }
@@ -850,7 +850,7 @@ namespace ComPDFKit.Tool
             {
                 return;
             }
-            if (!PolyAnnotation.IsMersured() && annotParam != null)
+            if (!PolyAnnotation.IsMeasured() && annotParam != null)
             {
                 return;
             }

+ 6 - 6
Demo/Examples/ComPDFKit.Tool/CPDFViewerTool.xaml.cs

@@ -361,7 +361,7 @@ namespace ComPDFKit.Tool
                         BuildPopTextUI(cacheHitTestAnnot);
                         isDrawSelectRect = false;
                         mouseEventObject.annotType = cacheHitTestAnnot.GetAnnotData().AnnotType;
-                        mouseEventObject.IsMersured = cacheHitTestAnnot.GetAnnotData().Annot.IsMersured();
+                        mouseEventObject.IsMersured = cacheHitTestAnnot.GetAnnotData().Annot.IsMeasured();
                         MouseLeftButtonDownHandler?.Invoke(this, mouseEventObject);
                         return;
                     }
@@ -375,7 +375,7 @@ namespace ComPDFKit.Tool
                 {
                     mouseEventObject.hitTestType = MouseHitTestType.SelectRect;
                     mouseEventObject.annotType = cacheHitTestAnnot.GetAnnotData().AnnotType;
-                    mouseEventObject.IsMersured = cacheHitTestAnnot.GetAnnotData().Annot.IsMersured();
+                    mouseEventObject.IsMersured = cacheHitTestAnnot.GetAnnotData().Annot.IsMeasured();
                     MouseLeftButtonDownHandler?.Invoke(this, mouseEventObject);
                     return;
                 }
@@ -392,7 +392,7 @@ namespace ComPDFKit.Tool
                 {
                     mouseEventObject.hitTestType = MouseHitTestType.SelectRect;
                     mouseEventObject.annotType = cacheHitTestAnnot.GetAnnotData().AnnotType;
-                    mouseEventObject.IsMersured = cacheHitTestAnnot.GetAnnotData().Annot.IsMersured();
+                    mouseEventObject.IsMersured = cacheHitTestAnnot.GetAnnotData().Annot.IsMeasured();
                     MouseLeftButtonDownHandler?.Invoke(this, mouseEventObject);
                     return;
                 }
@@ -424,7 +424,7 @@ namespace ComPDFKit.Tool
                         };
                         if (cacheHitTestAnnot != null && list.Contains(cacheHitTestAnnot.CurrentType))
                         {
-                            mouseEventObject.IsMersured = cacheHitTestAnnot.GetAnnotData().Annot.IsMersured();
+                            mouseEventObject.IsMersured = cacheHitTestAnnot.GetAnnotData().Annot.IsMeasured();
                             SetEditAnnotObject();
                         }
                         else
@@ -657,7 +657,7 @@ namespace ComPDFKit.Tool
                     }
 
                     mouseEventObject.annotType = caheMoveAnnot.GetAnnotData().AnnotType;
-                    mouseEventObject.IsMersured = caheMoveAnnot.GetAnnotData().Annot.IsMersured();
+                    mouseEventObject.IsMersured = caheMoveAnnot.GetAnnotData().Annot.IsMeasured();
                 }
                 else
                 {
@@ -705,7 +705,7 @@ namespace ComPDFKit.Tool
                     if (cacheHitTestAnnot != null)
                     {
                         mouseEventObject.annotType = cacheHitTestAnnot.GetAnnotData().AnnotType;
-                        mouseEventObject.IsMersured = cacheHitTestAnnot.GetAnnotData().Annot.IsMersured();
+                        mouseEventObject.IsMersured = cacheHitTestAnnot.GetAnnotData().Annot.IsMeasured();
                     }
                     else
                     {

+ 6 - 6
Demo/Examples/ComPDFKit.Tool/DrawTool/AnnotEdit.cs

@@ -169,7 +169,7 @@ namespace ComPDFKit.Tool.DrawTool
                             );
                         activePoints.Add(point);
                     }
-                    if ((annotData.Annot as CPDFLineAnnotation).IsMersured())
+                    if ((annotData.Annot as CPDFLineAnnotation).IsMeasured())
                     {
                         CRect rawRect = annotData.Annot.GetRect();
                         Rect rect = DataConversionForWPF.CRectConversionForRect(rawRect);
@@ -197,7 +197,7 @@ namespace ComPDFKit.Tool.DrawTool
                             );
                         activePoints.Add(point);
                     }
-                    if ((annotData.Annot as CPDFPolygonAnnotation).IsMersured())
+                    if ((annotData.Annot as CPDFPolygonAnnotation).IsMeasured())
                     {
                         CRect rawRect = annotData.Annot.GetRect();
                         Rect rect = DataConversionForWPF.CRectConversionForRect(rawRect);
@@ -220,7 +220,7 @@ namespace ComPDFKit.Tool.DrawTool
                             );
                         activePoints.Add(point);
                     }
-                    if ((annotData.Annot as CPDFPolylineAnnotation).IsMersured())
+                    if ((annotData.Annot as CPDFPolylineAnnotation).IsMeasured())
                     {
                         CRect rawRect = annotData.Annot.GetRect();
                         Rect rect = DataConversionForWPF.CRectConversionForRect(rawRect);
@@ -389,7 +389,7 @@ namespace ComPDFKit.Tool.DrawTool
             Draw();
             if (annotData!=null&&annotData.AnnotType == C_ANNOTATION_TYPE.C_ANNOTATION_LINE)
             {
-                if ((annotData.Annot as CPDFLineAnnotation).IsMersured())
+                if ((annotData.Annot as CPDFLineAnnotation).IsMeasured())
                 {
                     activePoints.Clear();
 
@@ -443,7 +443,7 @@ namespace ComPDFKit.Tool.DrawTool
                 {
                     if (annotData.AnnotType == C_ANNOTATION_TYPE.C_ANNOTATION_LINE)
                     {
-                        if (!(annotData.Annot as CPDFLineAnnotation).IsMersured())
+                        if (!(annotData.Annot as CPDFLineAnnotation).IsMeasured())
                         {
                             currentPoint.X += moveOffset.X;
                             currentPoint.Y += moveOffset.Y;
@@ -486,7 +486,7 @@ namespace ComPDFKit.Tool.DrawTool
                 {
                     case C_ANNOTATION_TYPE.C_ANNOTATION_LINE:
                         {
-                            if ((annotData.Annot as CPDFLineAnnotation).IsMersured())
+                            if ((annotData.Annot as CPDFLineAnnotation).IsMeasured())
                             {
                                 DrawLineMeasure(drawDC);
                             }

+ 4 - 4
Demo/Examples/ComPDFKit.Tool/DrawTool/CreateAnnotTool.cs

@@ -338,7 +338,7 @@ namespace ComPDFKit.Tool.DrawTool
                         DrawText();
                         break;
                     case C_ANNOTATION_TYPE.C_ANNOTATION_LINE:
-                        if ((cPDFAnnotation as CPDFLineAnnotation).IsMersured())
+                        if ((cPDFAnnotation as CPDFLineAnnotation).IsMeasured())
                         {
                             DrawLineMeasure(drawDC);
                         }
@@ -859,7 +859,7 @@ namespace ComPDFKit.Tool.DrawTool
             Pen DrawPen = new Pen(new SolidColorBrush(color), polyLine.GetBorderWidth());
             SolidColorBrush TextBrush = Brushes.Red;
 
-            if (polyLine.IsMersured())
+            if (polyLine.IsMeasured())
             {
                 CPDFPerimeterMeasure measureInfo = polyLine.GetPerimeterMeasure();
                 if (measureInfo != null && measureInfo.TextAttribute != null && measureInfo.TextAttribute.FontColor != null && measureInfo.TextAttribute.FontColor.Length >= 3)
@@ -1042,7 +1042,7 @@ namespace ComPDFKit.Tool.DrawTool
             Pen EndDrawPen = new Pen(Brushes.Black, polyLine.GetBorderWidth());
             SolidColorBrush TextBrush = Brushes.Red;
 
-            if (polyLine.IsMersured())
+            if (polyLine.IsMeasured())
             {
                 CPDFAreaMeasure measureInfo = polyLine.GetAreaMeasure();
                 if (measureInfo != null && measureInfo.TextAttribute != null && measureInfo.TextAttribute.FontColor != null && measureInfo.TextAttribute.FontColor.Length >= 3)
@@ -1307,7 +1307,7 @@ namespace ComPDFKit.Tool.DrawTool
             Pen DrawPen = new Pen(new SolidColorBrush(color), polyLine.GetBorderWidth());
             SolidColorBrush TextBrush = Brushes.Red;
 
-            if (polyLine.IsMersured())
+            if (polyLine.IsMeasured())
             {
                 CPDFDistanceMeasure measureInfo = polyLine.GetDistanceMeasure();
                 if (measureInfo != null && measureInfo.TextAttribute != null && measureInfo.TextAttribute.FontColor != null && measureInfo.TextAttribute.FontColor.Length >= 3)

+ 7 - 7
Demo/Examples/ComPDFKit.Tool/Help/ParamConverter.cs

@@ -64,7 +64,7 @@ namespace ComPDFKit.Tool.Help
                     annotHistory = new FreeTextAnnotHistory();
                     break;
                 case C_ANNOTATION_TYPE.C_ANNOTATION_LINE:
-                    if ((cPDFAnnotation as CPDFLineAnnotation).IsMersured())
+                    if ((cPDFAnnotation as CPDFLineAnnotation).IsMeasured())
                     {
                         annotHistory = new LineMeasureAnnotHistory();
                     }
@@ -821,7 +821,7 @@ namespace ComPDFKit.Tool.Help
                         CPDFLineAnnotation lineAnnot = pdfAnnot as CPDFLineAnnotation;
                         if (lineAnnot != null)
                         {
-                            if(lineAnnot.IsMersured())
+                            if(lineAnnot.IsMeasured())
                             {
                                 return GetLineMeasureParam(lineAnnot);
                             }
@@ -932,7 +932,7 @@ namespace ComPDFKit.Tool.Help
                 case C_ANNOTATION_TYPE.C_ANNOTATION_POLYLINE:
                     {
                         CPDFPolylineAnnotation polylineAnnot= pdfAnnot as CPDFPolylineAnnotation;
-                        if (polylineAnnot!=null && polylineAnnot.IsMersured())
+                        if (polylineAnnot!=null && polylineAnnot.IsMeasured())
                         {
                             return GetPolyLineMeasureParam(polylineAnnot);
                         }
@@ -941,7 +941,7 @@ namespace ComPDFKit.Tool.Help
                 case C_ANNOTATION_TYPE.C_ANNOTATION_POLYGON:
                     {
                         CPDFPolygonAnnotation polygonAnnot= pdfAnnot as CPDFPolygonAnnotation;
-                        if(polygonAnnot!=null && polygonAnnot.IsMersured())
+                        if(polygonAnnot!=null && polygonAnnot.IsMeasured())
                         {
                             return GetPolygonMeasureParam(polygonAnnot);
                         }
@@ -1231,7 +1231,7 @@ namespace ComPDFKit.Tool.Help
 
         internal static LineMeasureParam GetLineMeasureParam(CPDFLineAnnotation lineAnnot)
         {
-            if (lineAnnot == null || lineAnnot.IsValid() == false || lineAnnot.IsMersured()==false)
+            if (lineAnnot == null || lineAnnot.IsValid() == false || lineAnnot.IsMeasured()==false)
             {
                 return null;
             }
@@ -1732,7 +1732,7 @@ namespace ComPDFKit.Tool.Help
 
         internal static PolyLineMeasureParam GetPolyLineMeasureParam(CPDFPolylineAnnotation polylineAnnot)
         {
-            if (polylineAnnot == null || polylineAnnot.IsValid() == false || polylineAnnot.IsMersured()==false)
+            if (polylineAnnot == null || polylineAnnot.IsValid() == false || polylineAnnot.IsMeasured()==false)
             {
                 return null;
             }
@@ -1766,7 +1766,7 @@ namespace ComPDFKit.Tool.Help
 
         internal static PolygonMeasureParam GetPolygonMeasureParam(CPDFPolygonAnnotation polygonAnnot)
         {
-            if (polygonAnnot == null || polygonAnnot.IsValid() == false || polygonAnnot.IsMersured() == false)
+            if (polygonAnnot == null || polygonAnnot.IsValid() == false || polygonAnnot.IsMeasured() == false)
             {
                 return null;
             }

+ 1 - 1
Demo/Examples/ComPDFKit.Tool/UndoManger/AnnotHistory/LineMeasureAnnotHistory.cs

@@ -143,7 +143,7 @@ namespace ComPDFKit.Tool.UndoManger
             if (MakeAnnotValid(CurrentParam))
             {
                 CPDFLineAnnotation polygonAnnot = Annot as CPDFLineAnnotation;
-                if (polygonAnnot == null || !polygonAnnot.IsValid() || !polygonAnnot.IsMersured())
+                if (polygonAnnot == null || !polygonAnnot.IsValid() || !polygonAnnot.IsMeasured())
                 {
                     return false;
                 }

+ 1 - 1
Demo/Examples/ComPDFKit.Tool/UndoManger/AnnotHistory/PolyLineMeasureAnnotHistory.cs

@@ -137,7 +137,7 @@ namespace ComPDFKit.Tool.UndoManger
             if (MakeAnnotValid(CurrentParam))
             {
                 CPDFPolylineAnnotation polygonAnnot = Annot as CPDFPolylineAnnotation;
-                if (polygonAnnot == null || !polygonAnnot.IsValid() || !polygonAnnot.IsMersured())
+                if (polygonAnnot == null || !polygonAnnot.IsValid() || !polygonAnnot.IsMeasured())
                 {
                     return false;
                 }

+ 1 - 1
Demo/Examples/ComPDFKit.Tool/UndoManger/AnnotHistory/PolygonMeasureAnnotHistory.cs

@@ -146,7 +146,7 @@ namespace ComPDFKit.Tool.UndoManger
             if (MakeAnnotValid(CurrentParam))
             {
                 CPDFPolygonAnnotation polygonAnnot = Annot as CPDFPolygonAnnotation;
-                if (polygonAnnot == null || !polygonAnnot.IsValid() || !polygonAnnot.IsMersured())
+                if (polygonAnnot == null || !polygonAnnot.IsValid() || !polygonAnnot.IsMeasured())
                 {
                     return false;
                 }