Browse Source

compdfkit(win) - 测量Demo 部分ui

zhuyi 1 năm trước cách đây
mục cha
commit
45a2d6b7af

+ 21 - 0
Demo/Examples/Compdfkit_Tools/Common/BarControl/CPDFMeasureBarControl.xaml

@@ -0,0 +1,21 @@
+<UserControl x:Class="Compdfkit_Tools.PDFControl.CPDFMeasureBarControl"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:local="clr-namespace:Compdfkit_Tools.PDFControl"
+             mc:Ignorable="d" 
+             Loaded="UserControl_Loaded"
+             d:DesignHeight="450" d:DesignWidth="800">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="../../Asset/Styles/ToggleButtonStyle.xaml"></ResourceDictionary>
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>
+    </UserControl.Resources>
+    <Border>
+        <StackPanel  Name="MeasureGrid" Orientation="Horizontal" HorizontalAlignment="Center">
+        </StackPanel>
+    </Border>
+</UserControl>

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 212 - 0
Demo/Examples/Compdfkit_Tools/Common/BarControl/CPDFMeasureBarControl.xaml.cs


+ 21 - 0
Demo/Examples/Compdfkit_Tools/Compdfkit_Tools.csproj

@@ -108,6 +108,9 @@
     <Compile Include="Common\BarControl\CPDFDigitalSignatureBarControl.xaml.cs">
       <DependentUpon>CPDFDigitalSignatureBarControl.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Common\BarControl\CPDFMeasureBarControl.xaml.cs">
+      <DependentUpon>CPDFMeasureBarControl.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Common\BarControl\CPDFPageEditBarControl.xaml.cs">
       <DependentUpon>CPDFPageEditBarControl.xaml</DependentUpon>
     </Compile>
@@ -320,6 +323,12 @@
     <Compile Include="Form\Property\TextFieldProperty.xaml.cs">
       <DependentUpon>TextFieldProperty.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Measure\MeasureControl.xaml.cs">
+      <DependentUpon>MeasureControl.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Measure\MeasurePropertyControl.xaml.cs">
+      <DependentUpon>MeasurePropertyControl.xaml</DependentUpon>
+    </Compile>
     <Compile Include="PageEdit\PageEditControl\PageEditControl.xaml.cs">
       <DependentUpon>PageEditControl.xaml</DependentUpon>
     </Compile>
@@ -560,6 +569,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Common\BarControl\CPDFMeasureBarControl.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Common\BarControl\CPDFPageEditBarControl.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -810,6 +823,14 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Measure\MeasureControl.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Measure\MeasurePropertyControl.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="PageEdit\PageEditControl\PageEditControl.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 58 - 0
Demo/Examples/Compdfkit_Tools/Measure/MeasureControl.xaml

@@ -0,0 +1,58 @@
+<UserControl x:Class="Compdfkit_Tools.Measure.MeasureControl"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:local="clr-namespace:Compdfkit_Tools.Measure"
+             mc:Ignorable="d" 
+             xmlns:cpdftools="clr-namespace:Compdfkit_Tools.PDFControl"
+             xmlns:cpdfcommon="clr-namespace:Compdfkit_Tools.Common"
+             d:DesignHeight="450" d:DesignWidth="800">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="../Asset/Styles/ToggleButtonStyle.xaml"></ResourceDictionary>
+                <ResourceDictionary Source="../Asset/Styles/ButtonStyle.xaml"></ResourceDictionary>
+                <ResourceDictionary Source="../Asset/Styles/ComboBoxStyle.xaml"></ResourceDictionary>
+            </ResourceDictionary.MergedDictionaries>
+            <RoutedUICommand x:Key="Undo" Text="Undo"></RoutedUICommand>
+            <RoutedUICommand x:Key="Redo" Text="Redo"></RoutedUICommand>
+        </ResourceDictionary>
+    </UserControl.Resources>
+    <Grid Name="BodyGrid">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="auto"/>
+            <RowDefinition Height="*"/>
+        </Grid.RowDefinitions>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="0"></ColumnDefinition>
+            <ColumnDefinition Width="0"></ColumnDefinition>
+            <ColumnDefinition Width="*"></ColumnDefinition>
+            <ColumnDefinition Width="auto"></ColumnDefinition>
+        </Grid.ColumnDefinitions>
+        <Border x:Name="ToolBarContainer" Height="45" Visibility="Visible" BorderThickness="1" BorderBrush="#1A000000" Background="#F2F3F5" Grid.ColumnSpan="4">
+            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
+                <cpdftools:CPDFMeasureBarControl x:Name="PDFMeasureTool"  Grid.ColumnSpan="4" Height="44"/>
+            </StackPanel>
+        </Border>
+        <Border Grid.Row="1" Visibility="Collapsed" Name="BotaContainer"></Border>
+        <GridSplitter  Grid.Row="1" Name="Splitter" Grid.Column="1" Width="15" ResizeBehavior="PreviousAndNext" Visibility="Collapsed">
+            <GridSplitter.Template>
+                <ControlTemplate TargetType="{x:Type GridSplitter}">
+                    <Border BorderThickness="{TemplateBinding Border.BorderThickness}"
+                            BorderBrush="{TemplateBinding Border.BorderBrush}"
+                            Background="{TemplateBinding Panel.Background}" >
+                        <Path Fill="Gray" VerticalAlignment="Center">
+                            <Path.Data>
+                                M15 3.75H1V2.25H15V3.75ZM15 8.75H1V7.25H15V8.75ZM1 13.75H15V12.25H1V13.75Z
+                            </Path.Data>
+                        </Path>
+                    </Border>
+                </ControlTemplate>
+            </GridSplitter.Template>
+        </GridSplitter>
+        <Border x:Name="PDFGrid" Background="#CECECE" Grid.Row="1" Grid.Column="2"></Border>
+        <Border Grid.Column="3" Name="PropertyContainer" Grid.Row="1" Visibility="Collapsed" ></Border>
+        <cpdfcommon:PageNumberControl  Grid.Column="2" Grid.Row="1" x:Name="FloatPageTool" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,20"></cpdfcommon:PageNumberControl>
+    </Grid>
+</UserControl>

+ 128 - 0
Demo/Examples/Compdfkit_Tools/Measure/MeasureControl.xaml.cs

@@ -0,0 +1,128 @@
+using Compdfkit_Tools.Helper;
+using Compdfkit_Tools.PDFControl;
+using ComPDFKitViewer.PdfViewer;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace Compdfkit_Tools.Measure
+{
+    /// <summary>
+    /// MeasureControl.xaml 的交互逻辑
+    /// </summary>
+    public partial class MeasureControl : UserControl
+    {
+        public PDFViewControl PdfViewControl = new PDFViewControl();
+        public MeasurePropertyControl FromPropertyControl = new MeasurePropertyControl();
+        private CPDFDisplaySettingsControl displaySettingsControl;
+
+
+        private PanelState panelState = PanelState.GetInstance();
+
+        public MeasureControl()
+        {
+            InitializeComponent();
+        }
+        #region Init PDFViewer
+
+        public void InitWithPDFViewer(CPDFViewer pdfViewer)
+        {
+            PdfViewControl.PDFView = pdfViewer;
+            PDFMeasureTool.InitWithPDFViewer(pdfViewer, FromPropertyControl);
+            FloatPageTool.InitWithPDFViewer(pdfViewer);
+            PDFGrid.Child = PdfViewControl;
+
+            panelState.PropertyChanged += PanelState_PropertyChanged;
+        }
+
+        public void SetSettingsControl(CPDFDisplaySettingsControl cPDFDisplaySettingsControl)
+        {
+            displaySettingsControl = cPDFDisplaySettingsControl;
+        }
+
+        private void PanelState_PropertyChanged(object sender, PropertyChangedEventArgs e)
+        {
+            if (e.PropertyName == nameof(PanelState.IsLeftPanelExpand))
+            {
+                ExpandLeftPanel(panelState.IsLeftPanelExpand);
+            }
+            else if (e.PropertyName == nameof(PanelState.RightPanel))
+            {
+                if (panelState.RightPanel == PanelState.RightPanelState.PropertyPanel)
+                {
+                    ExpandRightPropertyPanel(FromPropertyControl, Visibility.Visible);
+                }
+                else if (panelState.RightPanel == PanelState.RightPanelState.ViewSettings)
+                {
+                    ExpandRightPropertyPanel(displaySettingsControl, Visibility.Visible);
+                }
+                else
+                {
+                    ExpandRightPropertyPanel(null, Visibility.Collapsed);
+                }
+            }
+        }
+
+        #endregion
+
+        #region Expand and collapse Panel
+
+        public void ExpandRightPropertyPanel(Visibility visible)
+        {
+            ExpandRightPropertyPanel(FromPropertyControl, visible);
+        }
+
+        public void ExpandNullRightPropertyPanel(Visibility visible)
+        {
+            ExpandRightPropertyPanel(null, visible);
+        }
+
+        public void ExpandViewSettings(Visibility visible)
+        {
+            SetViewSettings(displaySettingsControl, visible);
+        }
+
+        private void ExpandRightPropertyPanel(UIElement propertytPanel, Visibility visible)
+        {
+            PropertyContainer.Width = 260;
+            PropertyContainer.Child = propertytPanel;
+            PropertyContainer.Visibility = visible;
+        }
+
+        private void SetViewSettings(CPDFDisplaySettingsControl displaySettingsControl,Visibility visibility)
+        {
+            PropertyContainer.Child = displaySettingsControl;
+            PropertyContainer.Visibility = visibility;
+        }
+
+        public void ExpandLeftPanel(bool isExpand)
+        {
+            BotaContainer.Visibility = isExpand ? Visibility.Visible : Visibility.Collapsed;
+            Splitter.Visibility = isExpand ? Visibility.Visible : Visibility.Collapsed;
+            if (isExpand)
+            {
+                BodyGrid.ColumnDefinitions[0].Width = new GridLength(320);
+                BodyGrid.ColumnDefinitions[1].Width = new GridLength(15);
+            }
+            else
+            {
+                BodyGrid.ColumnDefinitions[0].Width = new GridLength(0);
+                BodyGrid.ColumnDefinitions[1].Width = new GridLength(0);
+            }
+        }
+
+        #endregion
+    }
+}

+ 13 - 0
Demo/Examples/Compdfkit_Tools/Measure/MeasurePropertyControl.xaml

@@ -0,0 +1,13 @@
+<UserControl x:Class="Compdfkit_Tools.Measure.MeasurePropertyControl"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:local="clr-namespace:Compdfkit_Tools.Measure"
+             mc:Ignorable="d" 
+             d:DesignHeight="450" d:DesignWidth="800" Background="#FAFCFF">
+    <Grid>
+        <TextBlock Name="NoResultText" Foreground="#43474D" FontSize="14" LineHeight="16" TextWrapping="Wrap" Width="190" TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center">The property panel is empty</TextBlock>
+        <Border x:Name="MeasurePropertyPanel"></Border>
+    </Grid>
+</UserControl>

+ 34 - 0
Demo/Examples/Compdfkit_Tools/Measure/MeasurePropertyControl.xaml.cs

@@ -0,0 +1,34 @@
+using ComPDFKitViewer.AnnotEvent;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace Compdfkit_Tools.Measure
+{
+    /// <summary>
+    /// MeasurePropertyControl.xaml 的交互逻辑
+    /// </summary>
+    public partial class MeasurePropertyControl : UserControl
+    {
+        public MeasurePropertyControl()
+        {
+            InitializeComponent();
+        }
+
+        public void SetPropertyForType(WidgetArgs Args, AnnotAttribEvent e)
+        {
+            
+        }
+    }
+}

Demo/Examples/PDFMeasure/App.config → Demo/Examples/Measure/App.config


+ 2 - 2
Demo/Examples/PDFMeasure/App.xaml

@@ -1,7 +1,7 @@
-<Application x:Class="PDFMeasure.App"
+<Application x:Class="Measure.App"
              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-             xmlns:local="clr-namespace:PDFMeasure"
+             xmlns:local="clr-namespace:Measure"
              StartupUri="MainWindow.xaml">
     <Application.Resources>
          

+ 1 - 1
Demo/Examples/PDFMeasure/App.xaml.cs

@@ -9,7 +9,7 @@ using System.Threading.Tasks;
 using System.Windows;
 using static ComPDFKit.NativeMethod.CPDFSDKVerifier;
 
-namespace PDFMeasure
+namespace Measure
 {
     /// <summary>
     /// App.xaml 的交互逻辑

Demo/Examples/PDFMeasure/ComPDFKit_Logo.ico → Demo/Examples/Measure/ComPDFKit_Logo.ico


+ 18 - 8
Demo/Examples/PDFMeasure/MainWindow.xaml

@@ -1,9 +1,9 @@
-<Window x:Class="PDFMeasure.MainWindow"
+<Window x:Class="Measure.MainWindow"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
-        xmlns:local="clr-namespace:PDFMeasure"
+        xmlns:local="clr-namespace:Measure"
                xmlns:cpdftools="clr-namespace:Compdfkit_Tools.PDFControl;assembly=Compdfkit_Tools"
         xmlns:cpdfcommon="clr-namespace:Compdfkit_Tools.Common;assembly=Compdfkit_Tools"
         mc:Ignorable="d"
@@ -168,8 +168,9 @@
                     <cpdftools:CPDFScalingControl x:Name="CPDFSaclingControl"></cpdftools:CPDFScalingControl>
                 </StackPanel>
 
-                <ComboBox Width="120" Height="26" Grid.Column="1" HorizontalAlignment="Center" FontSize="14" Foreground="#001A4E">
+                <ComboBox Width="120" Height="26" Grid.Column="1" HorizontalAlignment="Center" FontSize="14" Foreground="#001A4E" SelectionChanged="ComboBox_SelectionChanged">
                     <ComboBoxItem IsSelected="True">Viewer</ComboBoxItem>
+                    <ComboBoxItem IsSelected="True">Measure</ComboBoxItem>
                 </ComboBox>
 
                 <StackPanel Orientation="Horizontal" Grid.Column="2">
@@ -190,7 +191,20 @@
                             <ToolTip Content="Search"></ToolTip>
                         </Button.ToolTip>
                     </Button>
-
+                 
+                    <ToggleButton  x:Name="RightPanelButton" BorderThickness="0" Width="40" Height="40" Style="{StaticResource ToggleButtonStyle}" Background="Transparent" Click="RightPanelButton_Click">
+                        <ToggleButton.Content>
+                            <Path Fill="#43474D" Width="30" Height="30">
+                                <Path.Data>
+                                    M22.5 8.5H7.5V12.25H13H22.5V8.5ZM12.25 13.75H7.5V21.5H12.25V13.75ZM13.75 21.5V13.75H22.5V21.5H13.75ZM7.5 7H6V8.5V21.5V23H7.5H22.5H24V21.5V8.5V7H22.5H7.5Z
+                                </Path.Data>
+                            </Path>
+                        </ToggleButton.Content>
+                        <ToggleButton.ToolTip>
+                            <ToolTip Content="Properties"></ToolTip>
+                        </ToggleButton.ToolTip>
+                    </ToggleButton>
+                    
                     <ToggleButton Name="ViewSettingBtn" BorderThickness="0" Width="40" Height="40" Style="{StaticResource ToggleButtonStyle}" Background="Transparent" Click="ViewSettingBtn_Click">
                         <ToggleButton.Content>
                             <Path Stroke="#43474D" VerticalAlignment="Center" StrokeThickness="2">
@@ -258,11 +272,7 @@
 
                 <Grid Grid.Column="2" >
                     <Border x:Name="PDFGrid" Background="#CECECE"></Border>
-
-                    <cpdfcommon:PageNumberControl Name="FloatPageTool" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,20"></cpdfcommon:PageNumberControl>
                 </Grid>
-
-                <Border Name="PropertyContainer" Grid.Column="3" Visibility="Hidden"></Border>
             </Grid>
         </Grid>
 

+ 89 - 9
Demo/Examples/PDFMeasure/MainWindow.xaml.cs

@@ -26,8 +26,9 @@ using System.Windows.Navigation;
 using System.Windows.Shapes;
 using System.Drawing;
 using Path = System.IO.Path;
+using Compdfkit_Tools.Measure;
 
-namespace PDFMeasure
+namespace Measure
 {
     /// <summary>
     /// MainWindow.xaml 的交互逻辑
@@ -37,6 +38,8 @@ namespace PDFMeasure
         #region Property
         private PDFViewControl passwordViewer;
         private PDFViewControl pdfViewControl;
+
+        private MeasureControl measureControl = new MeasureControl();
         CPDFDisplaySettingsControl displayPanel = new CPDFDisplaySettingsControl();
 
         private int[] zoomLevelList = { 10, 25, 50, 100, 150, 200, 300, 400, 500, 1000 };
@@ -98,12 +101,11 @@ namespace PDFMeasure
             CPDFSaclingControl.InitWithPDFViewer(pdfViewControl.PDFView);
             CPDFSaclingControl.SetZoomTextBoxText(string.Format("{0}", (int)(pdfViewControl.PDFView.ZoomFactor * 100)));
 
-            FloatPageTool.InitWithPDFViewer(pdfViewControl.PDFView);
             BotaSideTool.InitWithPDFViewer(pdfViewControl.PDFView);
             BotaSideTool.SelectBotaTool(BOTATools.Thumbnail);
             ViewSettingBtn.IsChecked = false;
-            PropertyContainer.Child = null;
-            PropertyContainer.Visibility = Visibility.Collapsed;
+
+            LoadMeasureRes();
         }
 
         private void LoadDefaultDocument()
@@ -227,18 +229,53 @@ namespace PDFMeasure
 
         private void ShowViewSettings()
         {
+            if (RightPanelButton != null)
+            {
+                if (RightPanelButton.IsChecked == true)
+                {
+                    RightPanelButton.IsChecked = false;
+                    measureControl.ExpandRightPropertyPanel(Visibility.Collapsed);
+                }
+            }
             if (ViewSettingBtn != null)
             {
                 if (ViewSettingBtn.IsChecked == true)
                 {
-                    displayPanel.InitWithPDFViewer(pdfViewControl.PDFView);
-                    PropertyContainer.Child = displayPanel;
-                    PropertyContainer.Visibility = Visibility.Visible;
+                    measureControl.ExpandViewSettings(Visibility.Visible);
                 }
                 else
                 {
-                    PropertyContainer.Child = null;
-                    PropertyContainer.Visibility = Visibility.Collapsed;
+                    measureControl.ExpandViewSettings(Visibility.Collapsed);
+                }
+            }
+        }
+
+        private void ControlRightPanel()
+        {
+            if (ViewSettingBtn != null)
+            {
+                if (ViewSettingBtn.IsChecked == true)
+                {
+                    ViewSettingBtn.IsChecked = false;
+                    measureControl.ExpandViewSettings(Visibility.Collapsed);
+                }
+            }
+            if (RightPanelButton != null)
+            {
+                if (RightPanelButton.IsChecked == true)
+                {
+                    if (measureControl.FromPropertyControl != null)
+                    {
+                        measureControl.ExpandRightPropertyPanel(Visibility.Visible);
+                        if ((bool)ViewSettingBtn.IsChecked)
+                        {
+                            ViewSettingBtn.IsChecked = false;
+                        }
+                    }
+                }
+                else
+                {
+                    measureControl.ExpandRightPropertyPanel(Visibility.Collapsed);
                 }
             }
         }
@@ -248,6 +285,11 @@ namespace PDFMeasure
             ShowViewSettings();
         }
 
+        private void RightPanelButton_Click(object sender, RoutedEventArgs e)
+        {
+            ControlRightPanel();
+        }
+
         private void ZoomInBtn_Click(object sender, RoutedEventArgs e)
         {
             if (pdfViewControl != null)
@@ -747,5 +789,43 @@ namespace PDFMeasure
         {
 
         }
+
+        #region Measure
+
+        private void LoadMeasureRes()
+        {
+            displayPanel.InitWithPDFViewer(pdfViewControl.PDFView);
+            measureControl.InitWithPDFViewer(pdfViewControl.PDFView);
+            measureControl.SetSettingsControl(displayPanel);
+            PDFGrid.Child = measureControl;
+        }
+
+        private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            var item = (sender as ComboBox).SelectedItem as ComboBoxItem;
+            //if ((string)item.Content == "Viewer")
+            //{
+            //    measureControl.ClearAllToolState();
+            //    measureControl.SetToolBarContainerVisibility(Visibility.Collapsed);
+            //    measureControl.ExpandRightPropertyPanel(null, Visibility.Collapsed);
+            //    //formControl.FromPropertyControl.AnnotationCancel();
+            //    RightPanelButton.IsChecked = false;
+            //    if (measureControl.PdfViewControl != null && measureControl.PdfViewControl.PDFView != null)
+            //    {
+            //        measureControl.PdfViewControl.PDFView.SetMouseMode(MouseModes.Viewer);
+            //    }
+            //}
+            //else if ((string)item.Content == "Form")
+            //{
+            //    measureControl.SetToolBarContainerVisibility(Visibility.Visible);
+            //    if (measureControl.PdfViewControl != null && measureControl.PdfViewControl.PDFView != null)
+            //    {
+            //        measureControl.PdfViewControl.PDFView.SetMouseMode(MouseModes.FormEditTool);
+            //    }
+            //}
+        }
+
+
+        #endregion
     }
 }

+ 30 - 3
Demo/Examples/PDFMeasure/PDFMeasure.csproj

@@ -6,7 +6,7 @@
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
     <ProjectGuid>{75A0C673-E1D8-4FCE-8804-95E4F0630200}</ProjectGuid>
     <OutputType>WinExe</OutputType>
-    <RootNamespace>PDFMeasure</RootNamespace>
+    <RootNamespace>Measure</RootNamespace>
     <AssemblyName>ComPDFKit.Demo</AssemblyName>
     <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
@@ -16,6 +16,21 @@
     <Deterministic>true</Deterministic>
     <NuGetPackageImportStamp>
     </NuGetPackageImportStamp>
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <PlatformTarget>AnyCPU</PlatformTarget>
@@ -105,11 +120,11 @@
     <None Include="App.config" />
   </ItemGroup>
   <ItemGroup>
-    <ProjectReference Include="..\..\..\..\ComPDFKit_Dev_Measure\ComPDFKit\ComPDFKitCSharp\ComPDFKit.Desk.csproj">
+    <ProjectReference Include="..\..\..\..\compdfkit_windows\ComPDFKit\ComPDFKitCSharp\ComPDFKit.Desk.csproj">
       <Project>{56e518ad-c126-4b48-9a09-0a64c87020e4}</Project>
       <Name>ComPDFKit.Desk</Name>
     </ProjectReference>
-    <ProjectReference Include="..\..\..\..\ComPDFKit_Dev_Measure\ComPDFKit\ComPDFKitDesktop\ComPDFKit.Viewer\ComPDFKit.Viewer.csproj">
+    <ProjectReference Include="..\..\..\..\compdfkit_windows\ComPDFKit\ComPDFKitDesktop\ComPDFKit.Viewer\ComPDFKit.Viewer.csproj">
       <Project>{18ec356d-8130-49d4-b4e6-ac290e1065b7}</Project>
       <Name>ComPDFKit.Viewer</Name>
     </ProjectReference>
@@ -126,6 +141,18 @@
   <ItemGroup>
     <Resource Include="ComPDFKit_Logo.ico" />
   </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include=".NETFramework,Version=v4.6.1">
+      <Visible>False</Visible>
+      <ProductName>Microsoft .NET Framework 4.6.1 %28x86 和 x64%29</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>false</Install>
+    </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">

Demo/Examples/PDFMeasure/PDF32000_2008.pdf → Demo/Examples/Measure/PDF32000_2008.pdf


Demo/Examples/PDFMeasure/Properties/AssemblyInfo.cs → Demo/Examples/Measure/Properties/AssemblyInfo.cs


+ 24 - 32
Demo/Examples/PDFMeasure/Properties/Resources.Designer.cs

@@ -1,69 +1,61 @@
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     此代码由工具生成。
-//     运行时版本: 4.0.30319.42000
+//     运行时版本:4.0.30319.42000
 //
-//     对此文件的更改可能导致不正确的行为,如果
-//     重新生成代码,则所做更改将丢失。
+//     对此文件的更改可能导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
 // </auto-generated>
 //------------------------------------------------------------------------------
 
-namespace PDFMeasure.Properties
-{
-
-
+namespace Measure.Properties {
+    using System;
+    
+    
     /// <summary>
-    ///   强类型资源类,用于查找本地化字符串等。
+    ///   一个强类型资源类,用于查找本地化字符串等。
     /// </summary>
     // 此类是由 StronglyTypedResourceBuilder
     // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
     // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
     // (以 /str 作为命令选项),或重新生成 VS 项目。
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    internal class Resources
-    {
-
+    internal class Resources {
+        
         private static global::System.Resources.ResourceManager resourceMan;
-
+        
         private static global::System.Globalization.CultureInfo resourceCulture;
-
+        
         [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        internal Resources()
-        {
+        internal Resources() {
         }
-
+        
         /// <summary>
-        ///   返回此类使用的缓存 ResourceManager 实例。
+        ///   返回此类使用的缓存 ResourceManager 实例。
         /// </summary>
         [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Resources.ResourceManager ResourceManager
-        {
-            get
-            {
-                if ((resourceMan == null))
-                {
-                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PDFMeasure.Properties.Resources", typeof(Resources).Assembly);
+        internal static global::System.Resources.ResourceManager ResourceManager {
+            get {
+                if (object.ReferenceEquals(resourceMan, null)) {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Measure.Properties.Resources", typeof(Resources).Assembly);
                     resourceMan = temp;
                 }
                 return resourceMan;
             }
         }
-
+        
         /// <summary>
         ///   重写当前线程的 CurrentUICulture 属性,对
         ///   使用此强类型资源类的所有资源查找执行重写。
         /// </summary>
         [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Globalization.CultureInfo Culture
-        {
-            get
-            {
+        internal static global::System.Globalization.CultureInfo Culture {
+            get {
                 return resourceCulture;
             }
-            set
-            {
+            set {
                 resourceCulture = value;
             }
         }

Demo/Examples/PDFMeasure/Properties/Resources.resx → Demo/Examples/Measure/Properties/Resources.resx


+ 13 - 17
Demo/Examples/PDFMeasure/Properties/Settings.Designer.cs

@@ -1,28 +1,24 @@
 //------------------------------------------------------------------------------
 // <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:4.0.30319.42000
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
 //
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
 // </auto-generated>
 //------------------------------------------------------------------------------
 
-namespace PDFMeasure.Properties
-{
-
-
+namespace Measure.Properties {
+    
+    
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
-    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
-    {
-
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.7.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+        
         private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
-        public static Settings Default
-        {
-            get
-            {
+        
+        public static Settings Default {
+            get {
                 return defaultInstance;
             }
         }

Demo/Examples/PDFMeasure/Properties/Settings.settings → Demo/Examples/Measure/Properties/Settings.settings


Demo/Examples/PDFMeasure/license_key_windows.xml → Demo/Examples/Measure/license_key_windows.xml