liyijie před 2 roky
rodič
revize
4dea8bde74
19 změnil soubory, kde provedl 715 přidání a 604 odebrání
  1. 8 7
      .gitignore
  2. 188 188
      PDF Office/App.xaml.cs
  3. 66 66
      PDF Office/CustomControl/NumericUpDown.xaml.cs
  4. 85 85
      PDF Office/Model/DialogNames.cs
  5. 28 0
      PDF Office/Model/MainPageToolsDialogs/MainPageExtractDialogModel.cs
  6. 26 0
      PDF Office/Model/MainPageToolsDialogs/MainPageInsertDialogModel.cs
  7. 44 0
      PDF Office/Model/MainPageToolsDialogs/MainPageSplitDialogModel.cs
  8. 41 33
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageExtractDialogViewModel.cs
  9. 3 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageInsertDialogViewModel.cs
  10. 31 31
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDialogViewModel.cs
  11. 1 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterPageSetDialogViewModel.cs
  12. 32 32
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageSplitDialogViewModel.cs
  13. 37 37
      PDF Office/ViewModels/HomePanel/HomeGuidContentViewModel.cs
  14. 2 2
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageExtractDialog.xaml
  15. 28 28
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageExtractDialog.xaml.cs
  16. 1 1
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageInsertDialog.xaml
  17. 1 1
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageInsertDialog.xaml.cs
  18. 65 65
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageSplitDialog.xaml
  19. 28 28
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageSplitDialog.xaml.cs

+ 8 - 7
.gitignore

@@ -1,7 +1,8 @@
-PDF Office/packages/
-PDF Office/obj/
-PDF Office/bin/
-PDF Office/.vs/
-PDF Office/PDF Office.csproj.user
-PDFSettings/obj/
-PDFSettings/bin/
+PDF Office/packages/
+PDF Office/obj/
+PDF Office/bin/
+PDF Office/.vs/
+PDF Office/PDF Office.csproj.user
+PDFSettings/obj/
+PDFSettings/bin/
+*.htm

+ 188 - 188
PDF Office/App.xaml.cs

@@ -1,201 +1,201 @@
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-using System.Data;
-using System.IO;
-using System.Linq;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-using ComPDFKit.NativeMethod;
-using ComPDFKit_Conversion.Converter;
-using PDF_Office.CustomControl;
-using PDF_Office.CustomControl.SystemControl;
-using PDF_Office.ViewModels;
-using PDF_Office.Views;
-using PDF_Office.Views.BOTA;
-using PDF_Office.Views.Dialog;
-using PDF_Office.Views.HomePanel;
-using Prism.DryIoc;
-using Prism.Ioc;
-using Prism.Regions;
-using PDF_Office.Model;
-using PDF_Office.Views.PageEdit;
-using PDF_Office.Properties;
-using PDFSettings.Settings;
-using PDF_Office.Views.Tools; 
-using PDF_Office.Views.Dialog.ToolsDialogs.SaftyDialogs;
-using PDF_Office.Views.Dialog.ToolsDialogs.CompressDialogs;
-using PDF_Office.Views.Dialog.PageEditDialogs;
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using ComPDFKit.NativeMethod;
+using ComPDFKit_Conversion.Converter;
+using PDF_Office.CustomControl;
+using PDF_Office.CustomControl.SystemControl;
+using PDF_Office.ViewModels;
+using PDF_Office.Views;
+using PDF_Office.Views.BOTA;
+using PDF_Office.Views.Dialog;
+using PDF_Office.Views.HomePanel;
+using Prism.DryIoc;
+using Prism.Ioc;
+using Prism.Regions;
+using PDF_Office.Model;
+using PDF_Office.Views.PageEdit;
+using PDF_Office.Properties;
+using PDFSettings.Settings;
+using PDF_Office.Views.Tools; 
+using PDF_Office.Views.Dialog.ToolsDialogs.SaftyDialogs;
+using PDF_Office.Views.Dialog.ToolsDialogs.CompressDialogs;
+using PDF_Office.Views.Dialog.PageEditDialogs;
 using PDF_Office.Views.Dialog.HomePageToolsDialogs ;
 using PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePagePrinter;
 
 
-namespace PDF_Office
-{
-    /// <summary>
-    /// App.xaml 的交互逻辑
-    /// </summary>
-    public partial class App : PrismApplication
-    {
-        public static string CurrentPath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "PDF Office");
-
-        public static MainWindowViewModel mainWindowViewModel;
-
-        public static List<string> OpenedFileList = new List<string>();
-
-        public static bool IsFirstOpen = true;
-
-        public App()
-        {
-
-#if !DEBUG
-            //接入Appcenter后台数据检测
-            string appkey = "b099dccc-1ca5-4ea1-a2fa-afd4a6e1f8bb"
-            AppCenter.Start(appkey, typeof(Analytics), typeof(Crashes));
-            var countryCode = RegionInfo.CurrentRegion.TwoLetterISORegionName;//上传国家信息
-            AppCenter.SetCountryCode(countryCode);
-#endif
-            LicenseVerify();
-
-
-            if (Settings.Default.RecentOpenFiles == null)
-                Settings.Default.RecentOpenFiles = new RecentOpenFiles();
-
-            try
-            {
-                DirectoryInfo info = new DirectoryInfo(CurrentPath);
-                if (File.Exists(CurrentPath))
-                    File.Delete(CurrentPath);
-                if (!info.Exists)
-                {
-                    info.Create();
-                }
-            }
-            catch (Exception ex)
-            {
-
-            }
-        }
-
-        /// <summary>
-        /// 创建启动窗口
-        /// </summary>
-        /// <returns></returns>
-        protected override Window CreateShell()
-        {
- 
-            return Container.Resolve<MainWindow>();
-        }
-
-
-        protected override void RegisterTypes(IContainerRegistry containerRegistry)
-        {
-            //注册内容组件
-            containerRegistry.RegisterForNavigation<HomeContent>();
-            containerRegistry.RegisterForNavigation<ViewContent>();
-            containerRegistry.RegisterForNavigation<MainContent>();
-            containerRegistry.RegisterForNavigation<HomeCloudContent>("Cloud");
-            containerRegistry.RegisterForNavigation<HomeToolsContent>("Tools");
-            containerRegistry.RegisterForNavigation<HomeGuidContent>("Guid");
-            containerRegistry.RegisterForNavigation<BOTAContent>();
-            containerRegistry.RegisterForNavigation<PageEditContent>();
-            containerRegistry.RegisterForNavigation<ToolsBarContent>();
+namespace PDF_Office
+{
+    /// <summary>
+    /// App.xaml 的交互逻辑
+    /// </summary>
+    public partial class App : PrismApplication
+    {
+        public static string CurrentPath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "PDF Office");
+
+        public static MainWindowViewModel mainWindowViewModel;
+
+        public static List<string> OpenedFileList = new List<string>();
+
+        public static bool IsFirstOpen = true;
+
+        public App()
+        {
+
+#if !DEBUG
+            //接入Appcenter后台数据检测
+            string appkey = "b099dccc-1ca5-4ea1-a2fa-afd4a6e1f8bb"
+            AppCenter.Start(appkey, typeof(Analytics), typeof(Crashes));
+            var countryCode = RegionInfo.CurrentRegion.TwoLetterISORegionName;//上传国家信息
+            AppCenter.SetCountryCode(countryCode);
+#endif
+            LicenseVerify();
+
+
+            if (Settings.Default.RecentOpenFiles == null)
+                Settings.Default.RecentOpenFiles = new RecentOpenFiles();
+
+            try
+            {
+                DirectoryInfo info = new DirectoryInfo(CurrentPath);
+                if (File.Exists(CurrentPath))
+                    File.Delete(CurrentPath);
+                if (!info.Exists)
+                {
+                    info.Create();
+                }
+            }
+            catch (Exception ex)
+            {
+
+            }
+        }
+
+        /// <summary>
+        /// 创建启动窗口
+        /// </summary>
+        /// <returns></returns>
+        protected override Window CreateShell()
+        {
+ 
+            return Container.Resolve<MainWindow>();
+        }
+
+
+        protected override void RegisterTypes(IContainerRegistry containerRegistry)
+        {
+            //注册内容组件
+            containerRegistry.RegisterForNavigation<HomeContent>();
+            containerRegistry.RegisterForNavigation<ViewContent>();
+            containerRegistry.RegisterForNavigation<MainContent>();
+            containerRegistry.RegisterForNavigation<HomeCloudContent>("Cloud");
+            containerRegistry.RegisterForNavigation<HomeToolsContent>("Tools");
+            containerRegistry.RegisterForNavigation<HomeGuidContent>("Guid");
+            containerRegistry.RegisterForNavigation<BOTAContent>();
+            containerRegistry.RegisterForNavigation<PageEditContent>();
+            containerRegistry.RegisterForNavigation<ToolsBarContent>();
             containerRegistry.RegisterForNavigation<HomePagePrinterModSizeContent>();
             containerRegistry.RegisterForNavigation<HomePagePrinterModPosterContent>();
             containerRegistry.RegisterForNavigation<HomePagePrinterModMutipleContent>();
             containerRegistry.RegisterForNavigation<HomePagePrinterModBookletContent>();
-            //注册弹窗
-            containerRegistry.RegisterDialog<VerifyPassWordDialog>(DialogNames.VerifyPassWordDialog);
-            containerRegistry.RegisterDialog<FullScreenWindow>(DialogNames.FullScreenDialog);
-            containerRegistry.RegisterDialog<CompressDialog>(DialogNames.CompressDialog);
-            containerRegistry.RegisterDialog<SetPasswordDialog>(DialogNames.SetPasswordDialog);
-            containerRegistry.RegisterDialog<CheckPasswordDialog>(DialogNames.CheckPasswordDialog);
-            containerRegistry.RegisterDialog<DeleteSafetySettingsDialog>(DialogNames.DeleteSafetySettingsDialog);
-            containerRegistry.RegisterDialog<CompressProgressBarDialog, PDF_Office.ViewModels.Dialog.ToolsDialogs.CompressDialogs.CompresProgressBarDialogViewModel>(DialogNames.CompressProgressBarDialog);
-            containerRegistry.RegisterDialog<InsertDialog>(DialogNames.InsertDialog);
-            containerRegistry.RegisterDialog<SplitDialog>(DialogNames.SplitDialog);
-            containerRegistry.RegisterDialog<ExtractDialog>(DialogNames.ExtractDialog);
+            //注册弹窗
+            containerRegistry.RegisterDialog<VerifyPassWordDialog>(DialogNames.VerifyPassWordDialog);
+            containerRegistry.RegisterDialog<FullScreenWindow>(DialogNames.FullScreenDialog);
+            containerRegistry.RegisterDialog<CompressDialog>(DialogNames.CompressDialog);
+            containerRegistry.RegisterDialog<SetPasswordDialog>(DialogNames.SetPasswordDialog);
+            containerRegistry.RegisterDialog<CheckPasswordDialog>(DialogNames.CheckPasswordDialog);
+            containerRegistry.RegisterDialog<DeleteSafetySettingsDialog>(DialogNames.DeleteSafetySettingsDialog);
+            containerRegistry.RegisterDialog<CompressProgressBarDialog, PDF_Office.ViewModels.Dialog.ToolsDialogs.CompressDialogs.CompresProgressBarDialogViewModel>(DialogNames.CompressProgressBarDialog);
+            containerRegistry.RegisterDialog<InsertDialog>(DialogNames.InsertDialog);
+            containerRegistry.RegisterDialog<SplitDialog>(DialogNames.SplitDialog);
+            containerRegistry.RegisterDialog<ExtractDialog>(DialogNames.ExtractDialog);
             containerRegistry.RegisterDialog<HomePageExtractDialog>(DialogNames.HomePageExtractDialog);
             containerRegistry.RegisterDialog<HomePageInsertDialog>(DialogNames.HomePageInsertDialog);
             containerRegistry.RegisterDialog<HomePageSplitDialog>(DialogNames.HomePageSplitDialog);
             containerRegistry.RegisterDialog<HomePagePrinterDialog>(DialogNames.HomePagePrinterDialog);
             containerRegistry.RegisterDialog<HomePagePrinterPageSetDialog>(DialogNames.HomePagePrinterPageSetDialog);
-
-        }
-
-        protected override void ConfigureRegionAdapterMappings(RegionAdapterMappings regionAdapterMappings)
-        {
-            var region = new SingleActiveRegion() { Name = RegionNames.MainRegion };
-
-            region.Behaviors.Add(DragablzWindowBehavior.BehaviorKey, new DragablzWindowBehavior());
-
-            Container.Resolve<IRegionManager>().Regions.Add(region);
-
-            base.ConfigureRegionAdapterMappings(regionAdapterMappings);
-        }
-
-        private static bool LicenseVerify()
-        {
-            bool result = false;
-            try
-            {
-                result = CPDFSDKVerifier.LoadNativeLibrary();
-                if (!result)
-                    return false;
-            }
-            catch{ }
-            string devKey = "";
-            string devSecret = "";
-#if DEBUG
-            devKey = "sTHSivIW4YnZQavIYDLVw4vaFcN5DQTUtRGrVyv5p9aeaHX3GirG/MBxl6Wy9TJbNOwR4CU6LPjHmGe3Po3OtBCPqIRheam9+LomScw3AvoUTHFlG1134e2J4enF43WJQ6PyOnjwZqsG1kUdlBPNztkoPzDAE2pQKgZWf6V2i34=";
-            devSecret = "mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4gQurxTxGuBlGAhs0P1mD3X3bHT+AHfcLiymaqE4DY7kTFHoPs9I3tl5ErS+BHdzHRhrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBw1367/WkJ00tM7U7tttD6cfaiHpW8pgW2aur3AxuQIBBLuJD5gcmNxTYW3KA32JLG8alfyXjKFVS3gka9bngvwfZ7GuNXybjKlmz1tnN6iVHpnbSj+xOHhWEperY4HHrSg==";
-#endif
-
-            string userKey = "iBPRM/Tz8b6Z1G2GQt52X7hiNCGfVYXztnPjalgrgARvqfKV6lFNH8QeScTzBRYI8GGFpwelfgh790Kd9JmL7V4adI1jCiFHUT2DLT7QucxY5Nkgys2aJItQS482Ck2G2Xf8gNgojxYxRt65o/MEzkj93foj8qIdfHagXsSorSs=";
-            string userSecret = "mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4ivEHOmPIqbfhpDnKKj+7Ymj2rXQvfZRmke06HMV+3tt064G64WjPW8+EbGCNZaAh1hrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBw1FKJi6HYB+DuugQyaqI2prfej861QnJrU4s2T/npZK/";
-
-            try
-            {
-                CPDFSDKVerifier.LicenseErrorCode verifyResult = CPDFSDKVerifier.LicenseVerify(devKey, devSecret, userKey, userSecret);
-                if (verifyResult != CPDFSDKVerifier.LicenseErrorCode.LICENSE_ERR_SUCCESS)
-                    return false;
-            }
-            catch{ }
-
-
-
-            string ConverterDevKey = "mDDCTNY5rV2+FUj2JESUBruJ0643Tv7rNuxACu6g3L/0guIw1r8zZB+o3aw3rs4rrOThmxBXpEDcItvyGx096mF/3Ixg7aD6QZk5HvBEScIPerdM3KnhgwMwCjE0DYOSMCRwAhbA2xjXfXgT5VVo7JZroKOGQB5Qmf2kLl5nQuU=";
-            string ConverterDevSecret = "mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4g3S5AixMY+3TX1FpQaugG9sTsnCq4QxIEDzyAI3s3dWjNe3wDsMrmFq51HtjPa2tSFAoV6NtcUJC8skonXVk7kMv7C2jvq4o0q6sQtN3jR42k0n/LkN5UfbQ5Lfel4OfZrk7dh2/DUR87Ps4vBX1hrYkwcNWVMyYvggPV2rTFvfawopGIC034QzjthmhwwX90=";
-            string ConverterUserkey = "WLUHzXhndQKyrTJVzvZ+dvPXDQDZeJpcSvklX3GJwRX4+urd8eQskYgbeCf0NXLZ/qJkS/k10x+qGad34i4v5rI/ASFIx901c/Nw5C0YJMH7X87dib141tdAmSmQhnKLO5TBi4FiAidboyvnLFLrYGMmS2kLQOXFPwPj5zQUv5A=";
-            string ConverterUserSecret = "mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4iK16EcneqBPRe2eKQLuJXpA79IONX9GVI/Ap3uWzMcNWaitc2UB6gDeexJXFPVaXOFAoV6NtcUJC8skonXVk7k/oKTJGcYKLPGdXenrzHolQ==";
-
-            try
-            {
-                /*LicenseError licenseerror = CPDFConverter.SDKLicenseVerify(ConverterDevKey, ConverterDevSecret, ConverterUserkey, ConverterUserSecret);
-            string resPath = Path.GetDirectoryName(typeof(MainWindow).Assembly.Location) + "\\";
-            if (licenseerror != LicenseError.ERR_SUCCESS)
-            {
-                return false;
-            }
-                CPDFConverter.Init(resPath);*/
-                string resPath = Path.GetDirectoryName(typeof(MainWindow).Assembly.Location) + "\\";
-                LicenseError licenseerror = CPDFConverter.LicenseVerify(ConverterDevKey, ConverterDevSecret, ConverterUserkey, ConverterUserSecret);
-                if (licenseerror != LicenseError.ERR_SUCCESS)
-                {
-                    //MessageBox.Show("ComPDFKit Conversion SDK Load Failed!");
-                    return false;
-                }
-                CPDFConverter.Init(resPath);
-            }
-            catch{ }
-            return result;
-        }
-
-        protected override void OnExit(ExitEventArgs e)
-        {
-            Environment.Exit(1);
-            base.OnExit(e);
-        }
-    }
-}
+
+        }
+
+        protected override void ConfigureRegionAdapterMappings(RegionAdapterMappings regionAdapterMappings)
+        {
+            var region = new SingleActiveRegion() { Name = RegionNames.MainRegion };
+
+            region.Behaviors.Add(DragablzWindowBehavior.BehaviorKey, new DragablzWindowBehavior());
+
+            Container.Resolve<IRegionManager>().Regions.Add(region);
+
+            base.ConfigureRegionAdapterMappings(regionAdapterMappings);
+        }
+
+        private static bool LicenseVerify()
+        {
+            bool result = false;
+            try
+            {
+                result = CPDFSDKVerifier.LoadNativeLibrary();
+                if (!result)
+                    return false;
+            }
+            catch{ }
+            string devKey = "";
+            string devSecret = "";
+#if DEBUG
+            devKey = "sTHSivIW4YnZQavIYDLVw4vaFcN5DQTUtRGrVyv5p9aeaHX3GirG/MBxl6Wy9TJbNOwR4CU6LPjHmGe3Po3OtBCPqIRheam9+LomScw3AvoUTHFlG1134e2J4enF43WJQ6PyOnjwZqsG1kUdlBPNztkoPzDAE2pQKgZWf6V2i34=";
+            devSecret = "mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4gQurxTxGuBlGAhs0P1mD3X3bHT+AHfcLiymaqE4DY7kTFHoPs9I3tl5ErS+BHdzHRhrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBw1367/WkJ00tM7U7tttD6cfaiHpW8pgW2aur3AxuQIBBLuJD5gcmNxTYW3KA32JLG8alfyXjKFVS3gka9bngvwfZ7GuNXybjKlmz1tnN6iVHpnbSj+xOHhWEperY4HHrSg==";
+#endif
+
+            string userKey = "iBPRM/Tz8b6Z1G2GQt52X7hiNCGfVYXztnPjalgrgARvqfKV6lFNH8QeScTzBRYI8GGFpwelfgh790Kd9JmL7V4adI1jCiFHUT2DLT7QucxY5Nkgys2aJItQS482Ck2G2Xf8gNgojxYxRt65o/MEzkj93foj8qIdfHagXsSorSs=";
+            string userSecret = "mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4ivEHOmPIqbfhpDnKKj+7Ymj2rXQvfZRmke06HMV+3tt064G64WjPW8+EbGCNZaAh1hrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBw1FKJi6HYB+DuugQyaqI2prfej861QnJrU4s2T/npZK/";
+
+            try
+            {
+                CPDFSDKVerifier.LicenseErrorCode verifyResult = CPDFSDKVerifier.LicenseVerify(devKey, devSecret, userKey, userSecret);
+                if (verifyResult != CPDFSDKVerifier.LicenseErrorCode.LICENSE_ERR_SUCCESS)
+                    return false;
+            }
+            catch{ }
+
+
+
+            string ConverterDevKey = "mDDCTNY5rV2+FUj2JESUBruJ0643Tv7rNuxACu6g3L/0guIw1r8zZB+o3aw3rs4rrOThmxBXpEDcItvyGx096mF/3Ixg7aD6QZk5HvBEScIPerdM3KnhgwMwCjE0DYOSMCRwAhbA2xjXfXgT5VVo7JZroKOGQB5Qmf2kLl5nQuU=";
+            string ConverterDevSecret = "mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4g3S5AixMY+3TX1FpQaugG9sTsnCq4QxIEDzyAI3s3dWjNe3wDsMrmFq51HtjPa2tSFAoV6NtcUJC8skonXVk7kMv7C2jvq4o0q6sQtN3jR42k0n/LkN5UfbQ5Lfel4OfZrk7dh2/DUR87Ps4vBX1hrYkwcNWVMyYvggPV2rTFvfawopGIC034QzjthmhwwX90=";
+            string ConverterUserkey = "WLUHzXhndQKyrTJVzvZ+dvPXDQDZeJpcSvklX3GJwRX4+urd8eQskYgbeCf0NXLZ/qJkS/k10x+qGad34i4v5rI/ASFIx901c/Nw5C0YJMH7X87dib141tdAmSmQhnKLO5TBi4FiAidboyvnLFLrYGMmS2kLQOXFPwPj5zQUv5A=";
+            string ConverterUserSecret = "mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4iK16EcneqBPRe2eKQLuJXpA79IONX9GVI/Ap3uWzMcNWaitc2UB6gDeexJXFPVaXOFAoV6NtcUJC8skonXVk7k/oKTJGcYKLPGdXenrzHolQ==";
+
+            try
+            {
+                /*LicenseError licenseerror = CPDFConverter.SDKLicenseVerify(ConverterDevKey, ConverterDevSecret, ConverterUserkey, ConverterUserSecret);
+            string resPath = Path.GetDirectoryName(typeof(MainWindow).Assembly.Location) + "\\";
+            if (licenseerror != LicenseError.ERR_SUCCESS)
+            {
+                return false;
+            }
+                CPDFConverter.Init(resPath);*/
+                string resPath = Path.GetDirectoryName(typeof(MainWindow).Assembly.Location) + "\\";
+                LicenseError licenseerror = CPDFConverter.LicenseVerify(ConverterDevKey, ConverterDevSecret, ConverterUserkey, ConverterUserSecret);
+                if (licenseerror != LicenseError.ERR_SUCCESS)
+                {
+                    //MessageBox.Show("ComPDFKit Conversion SDK Load Failed!");
+                    return false;
+                }
+                CPDFConverter.Init(resPath);
+            }
+            catch{ }
+            return result;
+        }
+
+        protected override void OnExit(ExitEventArgs e)
+        {
+            Environment.Exit(1);
+            base.OnExit(e);
+        }
+    }
+}

+ 66 - 66
PDF Office/CustomControl/NumericUpDown.xaml.cs

@@ -1,70 +1,70 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
 using System.Text.RegularExpressions;
-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 PDF_Office.CustomControl
-{
-    /// <summary>
-    /// NumericUpDown.xaml 的交互逻辑
-    /// </summary>
-    public partial class NumericUpDown : UserControl
-    {
-        public int Num
-        {
-            get
-            {
-                int value = 0;
-                this.Dispatcher.Invoke(new Action(() =>
-                    value = Convert.ToInt32(this.TextBox_Num.Text.Trim())
-                ));
-                return value;
-            }
-            set
-            {
-                this.Dispatcher.Invoke(new Action(() =>
-                {
-                    this.TextBox_Num.Text = value.ToString();
-                }));
-            }
-        }
-        public NumericUpDown()
-        {
-            InitializeComponent();
-        }
-
-        private void Button_Add_Click(object sender, RoutedEventArgs e)
-        {
-            int num = int.Parse(this.TextBox_Num.Text.Trim());
-            if (num > 0)
-            {
-                this.TextBox_Num.Text = (num + 1).ToString();
+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 PDF_Office.CustomControl
+{
+    /// <summary>
+    /// NumericUpDown.xaml 的交互逻辑
+    /// </summary>
+    public partial class NumericUpDown : UserControl
+    {
+        public int Num
+        {
+            get
+            {
+                int value = 0;
+                this.Dispatcher.Invoke(new Action(() =>
+                    value = Convert.ToInt32(this.TextBox_Num.Text.Trim())
+                ));
+                return value;
+            }
+            set
+            {
+                this.Dispatcher.Invoke(new Action(() =>
+                {
+                    this.TextBox_Num.Text = value.ToString();
+                }));
+            }
+        }
+        public NumericUpDown()
+        {
+            InitializeComponent();
+        }
+
+        private void Button_Add_Click(object sender, RoutedEventArgs e)
+        {
+            int num = int.Parse(this.TextBox_Num.Text.Trim());
+            if (num > 0)
+            {
+                this.TextBox_Num.Text = (num + 1).ToString();
                 Text = this.TextBox_Num.Text;
-            }
-        }
-
-        private void Button_Sub_Click(object sender, RoutedEventArgs e)
-        {
-            int num = int.Parse(this.TextBox_Num.Text.Trim());
-            if (num > 0)
-            {
-                if ((num - 1) == 0)
-                    return;
-                this.TextBox_Num.Text = (num - 1).ToString();
+            }
+        }
+
+        private void Button_Sub_Click(object sender, RoutedEventArgs e)
+        {
+            int num = int.Parse(this.TextBox_Num.Text.Trim());
+            if (num > 0)
+            {
+                if ((num - 1) == 0)
+                    return;
+                this.TextBox_Num.Text = (num - 1).ToString();
                 Text = this.TextBox_Num.Text;
-            }
-        }
+            }
+        }
         
         
 
@@ -91,5 +91,5 @@ namespace PDF_Office.CustomControl
         {
             e.Handled = new Regex("[^0-9]+").IsMatch(e.Text);
         }
-    }
-}
+    }
+}

+ 85 - 85
PDF Office/Model/DialogNames.cs

@@ -1,89 +1,89 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace PDF_Office.Model
-{
-    /// <summary>
-    /// 记录弹窗的名称
-    /// </summary>
-    public static class DialogNames
-    {
-        /// <summary>
-        /// 文档解密弹窗 需要传参PDFDocument对象
-        /// </summary>
-        public static string VerifyPassWordDialog = "PassWordDialog";
-
-        /// <summary>
-        /// 全屏模式弹窗
-        /// </summary>
-        public static string FullScreenDialog = "FullScreenDialog";
-
-        /// <summary>
-        /// 压缩弹窗
-        /// </summary>
-        public static string CompressDialog = "CompressDialog";
-
-        /// <summary>
-        /// 解压缩弹窗
-        /// </summary>
-        public static string SetPasswordDialog = "SetPasswordDialog";
-
-        /// <summary>
-        /// 解压缩弹窗
-        /// </summary>
-        public static string CheckPasswordDialog = "CheckPasswordDialog";
-
-        /// <summary>
-        /// 删除安全性设置
-        /// </summary>
-        public static string DeleteSafetySettingsDialog = "DeleteSafetySettingsDialog";
-
-        /// <summary>
-        /// 进度条
-        /// </summary>
-        public static string CompressProgressBarDialog = "CompressProgressBarDialog"; 
-        /// <summary>
-        /// 页面编辑- 提取弹窗
-        /// </summary>
-        public static string ExtractDialog = "ExtractDialog";
-
-        /// <summary>
-        /// 页面编辑-拆分弹窗
-        /// </summary>
-        public static string SplitDialog = "SplitDialog";
-
-        /// <summary>
-        /// 页面编辑-插入弹窗
-        /// </summary>
-        public static string InsertDialog = "InsertDialog";
-
-        ///<summary>
-        ///主页工具-提取弹窗
-        /// </summary>
-        public static string HomePageExtractDialog = "HomePageExtractDialog";
-
-        ///<summary>
-        ///主页工具-插入弹窗
-        /// </summary
-        public static string HomePageInsertDialog = "HomePageInsertDialog";
-
-        ///<summary>
-        ///主页工具-拆分弹窗
-        /// </summary>
-        public static string HomePageSplitDialog = "HomePageSplitDialog";
-
-        ///<summary>
-        ///主页工具-打印弹窗
-        /// </summary>
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model
+{
+    /// <summary>
+    /// 记录弹窗的名称
+    /// </summary>
+    public static class DialogNames
+    {
+        /// <summary>
+        /// 文档解密弹窗 需要传参PDFDocument对象
+        /// </summary>
+        public static string VerifyPassWordDialog = "PassWordDialog";
+
+        /// <summary>
+        /// 全屏模式弹窗
+        /// </summary>
+        public static string FullScreenDialog = "FullScreenDialog";
+
+        /// <summary>
+        /// 压缩弹窗
+        /// </summary>
+        public static string CompressDialog = "CompressDialog";
+
+        /// <summary>
+        /// 解压缩弹窗
+        /// </summary>
+        public static string SetPasswordDialog = "SetPasswordDialog";
+
+        /// <summary>
+        /// 解压缩弹窗
+        /// </summary>
+        public static string CheckPasswordDialog = "CheckPasswordDialog";
+
+        /// <summary>
+        /// 删除安全性设置
+        /// </summary>
+        public static string DeleteSafetySettingsDialog = "DeleteSafetySettingsDialog";
+
+        /// <summary>
+        /// 进度条
+        /// </summary>
+        public static string CompressProgressBarDialog = "CompressProgressBarDialog"; 
+        /// <summary>
+        /// 页面编辑- 提取弹窗
+        /// </summary>
+        public static string ExtractDialog = "ExtractDialog";
+
+        /// <summary>
+        /// 页面编辑-拆分弹窗
+        /// </summary>
+        public static string SplitDialog = "SplitDialog";
+
+        /// <summary>
+        /// 页面编辑-插入弹窗
+        /// </summary>
+        public static string InsertDialog = "InsertDialog";
+
+        ///<summary>
+        ///主页工具-提取弹窗
+        /// </summary>
+        public static string HomePageExtractDialog = "HomePageExtractDialog";
+
+        ///<summary>
+        ///主页工具-插入弹窗
+        /// </summary
+        public static string HomePageInsertDialog = "HomePageInsertDialog";
+
+        ///<summary>
+        ///主页工具-拆分弹窗
+        /// </summary>
+        public static string HomePageSplitDialog = "HomePageSplitDialog";
+
+        ///<summary>
+        ///主页工具-打印弹窗
+        /// </summary>
         public static string HomePagePrinterDialog = "HomePagePrinterDialog";
 
-        ///<summary>
-        ///打印弹窗-打印页面设置
-        /// </summary>
+        ///<summary>
+        ///打印弹窗-打印页面设置
+        /// </summary>
         public static string HomePagePrinterPageSetDialog = "HomePagePrinterPageSetDialog";
 
-    }
-}
+    }
+}

+ 28 - 0
PDF Office/Model/MainPageToolsDialogs/MainPageExtractDialogModel.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.MainPageToolsDialogs
+{
+    internal class MainPageExtractDialogModel
+    {
+        /// <summary>
+        /// 页码 存入页码范围;
+        /// </summary>
+        public List<int> PageParm;
+        /// <summary>
+        /// 自定模式下 把文本内容传过去
+        /// </summary>
+        public string PageName = "";
+        /// <summary>
+        /// 是否拆分为单文件
+        /// </summary>
+        public bool ExtractToSingleFile;
+        /// <summary>
+        /// 提取后删除页面
+        /// </summary>
+        public bool DeleteAfterExtract;
+    }
+}

+ 26 - 0
PDF Office/Model/MainPageToolsDialogs/MainPageInsertDialogModel.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.MainPageToolsDialogs
+{
+    internal class MainPageInsertDialogModel
+    {
+        public class InsertEventClass : EventArgs
+        {
+            public InsertType Type;
+            public string filePath;
+            public string pageRange;
+            public int InsertIndex;
+            public string Password;
+        }
+
+        public enum InsertType
+        {
+            BlankPages,
+            FromOtherPdf
+        }
+    }
+}

+ 44 - 0
PDF Office/Model/MainPageToolsDialogs/MainPageSplitDialogModel.cs

@@ -0,0 +1,44 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.MainPageToolsDialogs
+{
+    internal class MainPageSplitDialogModel
+    {
+        public class SplitEventClass : EventArgs
+        {
+            /// <summary>
+            /// 拆分模式
+            /// </summary>
+            public SplitMode Mode;
+            /// <summary>
+            /// 文件名
+            /// </summary>
+            public string FileName;
+            /// <summary>
+            /// 页面信息
+            /// </summary>
+            public string PageRange;
+
+        }
+
+        public enum SplitMode
+        {
+            /// <summary>
+            /// 按页平均拆分
+            /// </summary>
+            AveragePages,
+            /// <summary>
+            /// 按文件平均拆分
+            /// </summary>
+            AverageFiles,
+            /// <summary>
+            /// 自定义页码范围拆分
+            /// </summary>
+            CustomPageRange
+        }
+    }
+}

+ 41 - 33
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageExtractDialogViewModel.cs

@@ -51,10 +51,10 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
 
         private string pageRangeText = "";
         public string PageRangeText
-        {
+    {
             get { return pageRangeText; }
             set
-            {
+        {
                 pageRangeText = value;
             }
         }
@@ -104,7 +104,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
                 Trace.WriteLine("输入不对");
                 MessageBoxEx.Show("输入不对");
                 return;
-            }
+        }
             if (extractModel.ExtractToSingleFile)
             {
                 for (int i = 0; i < extractModel.PageParm.ToArray().Length; i++)
@@ -123,7 +123,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
 
             }
             else
-            {
+        {
                 CPDFDocument extractdoc = CPDFDocument.CreateDocument();
                 extractdoc.ImportPages(currentViewer.Document, extractModel.PageRange);
                 extractdoc.WriteToFilePath(savefilepath + currentViewer.Document.FileName + ".extract.pdf");
@@ -137,54 +137,61 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
             System.Diagnostics.Process.Start("Explorer", "/select," + currentViewer.Document.FilePath);
             RequestClose.Invoke(new DialogResult(ButtonResult.OK));
         }
-
+            
         private void extractToSingleFile()
         {
             if (ExtractToSingleFileIsCheck == "True")
             {
                 extractModel.ExtractToSingleFile = true;
                 Trace.WriteLine("ExtractToSingleFileIsCheck" + extractModel.ExtractToSingleFile);
-            }
+        }
             else
             {
                 extractModel.ExtractToSingleFile = false;
                 Trace.WriteLine("ExtractToSingleFileIsCheck" + extractModel.ExtractToSingleFile);
-            }
-        }
-
+    }
+}
+========
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
         private void deleteAfterExtract()
-        {
+{
 
             if (DeleteAfterExtractIsCheck == "True")
-            {
+    {
                 extractModel.DeleteAfterExtract = true;
                 Trace.WriteLine("DeleteAfterExtractIsCheck" + extractModel.DeleteAfterExtract);
             }
             else
-            {
+        {
                 extractModel.DeleteAfterExtract = false;
                 Trace.WriteLine("DeleteAfterExtractIsCheck" + extractModel.DeleteAfterExtract);
             }
-
-        }
+
+        }
         #endregion
-
+
         #region 框架行为
-        public string Title => "";
-
-        public event Action<IDialogResult> RequestClose;
-
-        public bool CanCloseDialog()
-        {
-            return true;
-        }
-
-        public void OnDialogClosed()
-        {
-        }
-
-        public void OnDialogOpened(IDialogParameters parameters)
-        {
+        public string Title => "";
+
+        public event Action<IDialogResult> RequestClose;
+
+        public bool CanCloseDialog()
+        {
+            return true;
+        }
+
+        public void OnDialogClosed()
+        {
+        }
+
+        public void OnDialogOpened(IDialogParameters parameters)
+        {
             CPDFViewer viewer = null;
             string filepath = "";
             parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out viewer);
@@ -197,7 +204,8 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
 
 
             }
-        }
+        }
         #endregion
-    }
-}
+    }
+}
+>>>>>>>> 6ff4d4b (其他-修正代码命名):PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageExtractDialogViewModel.cs

+ 3 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageInsertDialogViewModel.cs

@@ -1,3 +1,4 @@
+<<<<<<< HEAD
 using ComPDFKit.PDFDocument;
 using ComPDFKitViewer.PdfViewer;
 using PDF_Office.Model;
@@ -246,3 +247,5 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
         #endregion
     }
 }
+
+

+ 31 - 31
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDialogViewModel.cs

@@ -1,10 +1,10 @@
 using PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePagePrinter;
-using Prism.Commands;
-using Prism.Mvvm;
+using Prism.Commands;
+using Prism.Mvvm;
 using Prism.Regions;
-using Prism.Services.Dialogs;
-using System;
-using System.Collections.Generic;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
 using System.Windows.Controls;
 using System.Windows;
 using System.Diagnostics;
@@ -12,9 +12,9 @@ using System.Drawing.Printing;
 using PDFSettings;
 using ComPDFKit.PDFDocument;
 using PDF_Office.Model;
-
-namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
-{
+
+namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
+{
     public class HomePagePrinterDialogViewModel : BindableBase, IDialogAware, INavigationAware
     {
         public IDialogService Dialogs;
@@ -134,7 +134,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
         }
 
         private void EnterSelectedMod(string currentBar)
-        {
+    {
 
             NavigationParameters param = new NavigationParameters();
             PrintModVisible = Visibility.Collapsed;
@@ -144,33 +144,33 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
         }
 
 
-
+
         private void ChangePrintMod(object e)
         {
             var args = e as Button;
             if (args != null)
-            {
+        {
                 currentPrintModName = args.Name;
                 EnterSelectedMod(currentPrintModName);
                 //TODO:
             }
-        }
-
-        public string Title => "";
-
-        public event Action<IDialogResult> RequestClose;
-
-        public bool CanCloseDialog()
-        {
-            return true;
-        }
-
-        public void OnDialogClosed()
-        {
-        }
-
-        public void OnDialogOpened(IDialogParameters parameters)
-        {
+        }
+
+        public string Title => "";
+
+        public event Action<IDialogResult> RequestClose;
+
+        public bool CanCloseDialog()
+        {
+            return true;
+        }
+
+        public void OnDialogClosed()
+        {
+        }
+
+        public void OnDialogOpened(IDialogParameters parameters)
+        {
             CPDFDocument doc = null;
             parameters.TryGetValue<CPDFDocument>(ParameterNames.PDFDocument, out doc);
             if (doc != null)
@@ -191,6 +191,6 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
 
         public void OnNavigatedFrom(NavigationContext navigationContext)
         {
-        }
-    }
-}
+        }
+    }
+}

+ 1 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterPageSetDialogViewModel.cs

@@ -1,3 +1,4 @@
+
 using Prism.Commands;
 using Prism.Mvvm;
 using Prism.Services.Dialogs;

+ 32 - 32
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageSplitDialogViewModel.cs

@@ -1,14 +1,14 @@
 using ComPDFKit.PDFDocument;
 using ComPDFKitViewer.PdfViewer;
 using PDF_Office.Model;
-using Prism.Commands;
-using Prism.Mvvm;
-using Prism.Services.Dialogs;
-using System;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Services.Dialogs;
+using System;
 using PDF_Office.Helper;
-using System.Collections.Generic;
+using System.Collections.Generic;
 using System.Diagnostics;
-using System.Linq;
+using System.Linq;
 using ImTools;
 using PDF_Office.Model.PageEdit;
 using ComPDFKit.PDFPage;
@@ -18,9 +18,9 @@ using System.Windows.Media;
 using PDF_Office.CustomControl;
 using PDF_Office.Model.Dialog.HomePageToolsDialogs;
 using PDF_Office.Model.HomePageToolsDialogs;
-
-namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
-{
+
+namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
+{
     public class HomePageSplitDialogViewModel : BindableBase, IDialogAware
     {
         #region 参数和属性
@@ -206,7 +206,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
 
         private string fileNameDeimiterIsEnabled = "False";
         public string FileNameDeimiterIsEnabled
-        {
+    {
             get { return fileNameDeimiterIsEnabled; }
             set
             {
@@ -237,8 +237,8 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
         public DelegateCommand FileNameLabelChangeCommand { get; set; }
         #endregion
 
-        public HomePageSplitDialogViewModel()
-        {
+        public HomePageSplitDialogViewModel()
+        {
             CancelCommand = new DelegateCommand(cancel);
             SplitCommand = new DelegateCommand(split);
             AveragePagesCommand = new DelegateCommand(averagePages);
@@ -263,8 +263,8 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
             else
             {
                 splitModel.FileNameDeimiter = "";
-            }
-
+        }
+
             if (FileNameDeimiterIsCheck == "True")
             {
                 splitModel.FileNameDeimiter = FileNameDeimiterText;
@@ -507,21 +507,21 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
 
         #region 构架行为
         public string Title => "";
-
-        public event Action<IDialogResult> RequestClose;
-
-        public bool CanCloseDialog()
-        {
-            return true;
-        }
-
-        public void OnDialogClosed()
-        {
-
-        }
-
-        public void OnDialogOpened(IDialogParameters parameters)
-        {
+
+        public event Action<IDialogResult> RequestClose;
+
+        public bool CanCloseDialog()
+        {
+            return true;
+        }
+
+        public void OnDialogClosed()
+        {
+
+        }
+
+        public void OnDialogOpened(IDialogParameters parameters)
+        {
             CPDFViewer viewer = null;
             string filepath = "";
             parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out viewer);
@@ -534,7 +534,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
                 FilePathName = savefilename + "-" + "part" + ".pdf";
                 savefilepath = filepath.Replace(savefilename+".pdf","");
             }
-        }
+        }
         #endregion
-    }
-}
+    }
+}

+ 37 - 37
PDF Office/ViewModels/HomePanel/HomeGuidContentViewModel.cs

@@ -2,33 +2,33 @@
 using ComPDFKitViewer.PdfViewer;
 using PDF_Office.CustomControl;
 using PDF_Office.Model;
-using PDF_Office.Model.PDFTool;
-using PDF_Office.Views.HomePanel.PDFTools;
-using Prism.Commands;
-using Prism.Mvvm;
+using PDF_Office.Model.PDFTool;
+using PDF_Office.Views.HomePanel.PDFTools;
+using Prism.Commands;
+using Prism.Mvvm;
 using Prism.Services.Dialogs;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
 using System.Windows.Forms;
 using System.Xml.Linq;
-
-namespace PDF_Office.ViewModels.HomePanel
-{
-    public class HomeGuidContentViewModel:BindableBase
-    {
-        public IDialogService dialogs;
-        public DelegateCommand<ToolItem> QuickToolsCommand { get; set; }
-        public HomeGuidContentViewModel(IDialogService dialogService)
-        {
+
+namespace PDF_Office.ViewModels.HomePanel
+{
+    public class HomeGuidContentViewModel:BindableBase
+    {
+        public IDialogService dialogs;
+        public DelegateCommand<ToolItem> QuickToolsCommand { get; set; }
+        public HomeGuidContentViewModel(IDialogService dialogService)
+        {
             QuickToolsCommand = new DelegateCommand<ToolItem>(QuickTools_Click);
             dialogs = dialogService;
-        }
-
-        public void QuickTools_Click(ToolItem toolItem)
-        {
+        }
+
+        public void QuickTools_Click(ToolItem toolItem)
+        {
            
             
             /*
@@ -50,45 +50,45 @@ namespace PDF_Office.ViewModels.HomePanel
                         splitvalue.Add(ParameterNames.FilePath, dlg.FileName);
                         dialogs.ShowDialog(DialogNames.HomePageSplitDialog, splitvalue, e => { });
                         break;
-
+
                     case PDFToolType.Extract:
                         DialogParameters extractvalue = new DialogParameters();
                         extractvalue.Add(ParameterNames.PDFViewer, viewer); 
                         extractvalue.Add(ParameterNames.FilePath, dlg.FileName);
                         dialogs.ShowDialog(DialogNames.HomePageExtractDialog, extractvalue, e => { });
                         break;
-
+
                     case PDFToolType.Insert:
                         DialogParameters insertvalue = new DialogParameters();
                         insertvalue.Add(ParameterNames.PDFViewer, viewer); 
                         insertvalue.Add(ParameterNames.FilePath, dlg.FileName);
                         dialogs.ShowDialog(DialogNames.HomePageInsertDialog, insertvalue, e => { });
                         break;
-
+
                     case PDFToolType.Compress:
                         break;
-
+
                     case PDFToolType.Merge:
                         break;
-
+
                     case PDFToolType.Print:
                         DialogParameters printvalue = new DialogParameters();
                         printvalue.Add(ParameterNames.PDFViewer, viewer); ;
                         printvalue.Add(ParameterNames.FilePath, dlg.FileName);
                         dialogs.ShowDialog(DialogNames.HomePagePrinterDialog, printvalue, e => { });
                         break;
-
+
                     case PDFToolType.Security:
                         break;
                 }
 
             }
-        }
-
-        private void Split_Click()
-        {
-
-        }
-
-    }
-}
+        }
+
+        private void Split_Click()
+        {
+
+        }
+
+    }
+}

+ 2 - 2
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageExtractDialog.xaml

@@ -1,5 +1,5 @@
-<UserControl x:Class="PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageExtractDialog"
-             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+<UserControl x:Class="PDF_Office.Views.Dialog.MainPageToolsDialogs.MainPageExtractDialog"
+           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"

+ 28 - 28
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageExtractDialog.xaml.cs

@@ -1,30 +1,30 @@
 using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs;
-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 PDF_Office.Views.Dialog.HomePageToolsDialogs
-{
-    /// <summary>
-    /// MainPageExtractDialog.xaml 的交互逻辑
-    /// </summary>
-    public partial class HomePageExtractDialog : UserControl
-    {
-        public HomePageExtractDialog()
-        {
-            InitializeComponent();
-        }
+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 PDF_Office.Views.Dialog.HomePageToolsDialogs
+{
+    /// <summary>
+    /// MainPageExtractDialog.xaml 的交互逻辑
+    /// </summary>
+    public partial class HomePageExtractDialog : UserControl
+    {
+        public HomePageExtractDialog()
+        {
+            InitializeComponent();
+        }
 
         private void PageTurningPreview_Loaded(object sender, RoutedEventArgs e)
         {
@@ -33,5 +33,5 @@ namespace PDF_Office.Views.Dialog.HomePageToolsDialogs
             ExtractPreview.PageIndex.Text = ExtractPreview.document.PageCount.ToString();
 
         }
-    }
-}
+    }
+}

+ 1 - 1
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageInsertDialog.xaml

@@ -7,7 +7,7 @@
              xmlns:prism="http://prismlibrary.com/"             
              prism:ViewModelLocator.AutoWireViewModel="True"
              d:DesignHeight="441"
-             d:DesignWidth="600"
+             d:DesignWidth="480"
              mc:Ignorable="d">
     <Grid>
         <Grid.RowDefinitions>

+ 1 - 1
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageInsertDialog.xaml.cs

@@ -25,7 +25,7 @@ namespace PDF_Office.Views.Dialog.HomePageToolsDialogs
         public HomePageInsertDialog()
         {
             InitializeComponent();
-        }
+        }
 
         private void PageInsertIndexTextBox_TextChanged(object sender, TextChangedEventArgs e)
         {

+ 65 - 65
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageSplitDialog.xaml

@@ -1,80 +1,80 @@
-<UserControl x:Class="PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageSplitDialog"
-   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:cus="clr-namespace:PDF_Office.CustomControl"
-             xmlns:prism="http://prismlibrary.com/"             
-             prism:ViewModelLocator.AutoWireViewModel="True"
-              d:DesignHeight="521"
-             d:DesignWidth="583"
-             mc:Ignorable="d">
-    <Grid>
-        <Grid.RowDefinitions>
-            <RowDefinition Height="48"></RowDefinition>
-            <RowDefinition Height="*"></RowDefinition>
-            <RowDefinition Height="64"></RowDefinition>
-        </Grid.RowDefinitions>
+<UserControl x:Class="PDF_Office.Views.Dialog.MainPageToolsDialogs.MainPageSplitDialog"
+   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:cus="clr-namespace:PDF_Office.CustomControl"
+             xmlns:prism="http://prismlibrary.com/"             
+             prism:ViewModelLocator.AutoWireViewModel="True"
+              d:DesignHeight="521"
+             d:DesignWidth="583"
+             mc:Ignorable="d">
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="48"></RowDefinition>
+            <RowDefinition Height="*"></RowDefinition>
+            <RowDefinition Height="64"></RowDefinition>
+        </Grid.RowDefinitions>
         <TextBlock Grid.Row="0" Text="拆分" FontSize="20" FontWeight="ExtraBlack" VerticalAlignment="Center" HorizontalAlignment="Left"  Margin="20,0,0,0" Height="28" Width="120"/>
-        <Border Grid.Row="1" BorderBrush="Gray" BorderThickness="0,1,0,1" VerticalAlignment="Center" Height="409">
-            <Grid >
-                <Grid.ColumnDefinitions>
-                    <ColumnDefinition Width="3*"/>
-                    <ColumnDefinition Width="4*"/>
-                </Grid.ColumnDefinitions>
-                <Grid Grid.Column="0" VerticalAlignment="Top">
+        <Border Grid.Row="1" BorderBrush="Gray" BorderThickness="0,1,0,1" VerticalAlignment="Center" Height="409">
+            <Grid >
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="3*"/>
+                    <ColumnDefinition Width="4*"/>
+                </Grid.ColumnDefinitions>
+                <Grid Grid.Column="0" VerticalAlignment="Top">
                     <cus:PageTurningPreview x:Name="SplitPreview" Loaded="PageTurningPreview_Loaded" ></cus:PageTurningPreview>
-                </Grid>
-                <Grid Grid.Column="1" Margin="7,40,10,40">
-                    <Grid.RowDefinitions>
-                        <RowDefinition Height="4*"></RowDefinition>
-                        <RowDefinition Height="4*"></RowDefinition>
-                    </Grid.RowDefinitions>
-                    <Grid Grid.Row="0">
-                        <StackPanel Orientation="Vertical">
-                            <TextBlock Text="拆分方式" Height="22" Width="56" HorizontalAlignment="Left" Margin="0,0,0,17"></TextBlock>
-                            <StackPanel Orientation="Horizontal" Margin="0,0,0,8">
+                </Grid>
+                <Grid Grid.Column="1" Margin="7,40,10,40">
+                    <Grid.RowDefinitions>
+                        <RowDefinition Height="4*"></RowDefinition>
+                        <RowDefinition Height="4*"></RowDefinition>
+                    </Grid.RowDefinitions>
+                    <Grid Grid.Row="0">
+                        <StackPanel Orientation="Vertical">
+                            <TextBlock Text="拆分方式" Height="22" Width="56" HorizontalAlignment="Left" Margin="0,0,0,17"></TextBlock>
+                            <StackPanel Orientation="Horizontal" Margin="0,0,0,8">
                                 <RadioButton VerticalAlignment="Center" IsChecked="{Binding AveragePagesIsCheck}" Command="{Binding AveragePagesCommand}"></RadioButton>
-                                <TextBlock Text="平均每"  VerticalAlignment="Center"></TextBlock>
+                                <TextBlock Text="平均每"  VerticalAlignment="Center"></TextBlock>
                                 <cus:NumericUpDown Height="32" Width="110" Text="{Binding AveragePagesText,Mode=TwoWay}" IsEnabled="{Binding AveragePagesIsEnabled}"></cus:NumericUpDown>
-                                <TextBlock Text="页拆分为一个文件"  VerticalAlignment="Center"></TextBlock>
-                            </StackPanel>
-                            <StackPanel Orientation="Horizontal" Margin="0,0,0,8">
+                                <TextBlock Text="页拆分为一个文件"  VerticalAlignment="Center"></TextBlock>
+                            </StackPanel>
+                            <StackPanel Orientation="Horizontal" Margin="0,0,0,8">
                                 <RadioButton VerticalAlignment="Center" IsChecked="{Binding AverageFilesIsCheck}"  Command="{Binding AverageFilesCommand}"></RadioButton>
-                                <TextBlock Text="平均拆分为"  VerticalAlignment="Center"></TextBlock>
+                                <TextBlock Text="平均拆分为"  VerticalAlignment="Center"></TextBlock>
                                 <cus:NumericUpDown Height="32" Width="110" Text="{Binding AverageFilesText,Mode=TwoWay}" IsEnabled="{Binding AverageFilesIsEnabled}"></cus:NumericUpDown>
-                                <TextBlock Text="个PDF文件"></TextBlock>
-                            </StackPanel>
-                            <StackPanel Orientation="Horizontal">
+                                <TextBlock Text="个PDF文件"></TextBlock>
+                            </StackPanel>
+                            <StackPanel Orientation="Horizontal">
                                 <RadioButton VerticalAlignment="Center" IsChecked="{Binding CustomPageRangeIsCheck}" Command="{Binding CustomPageRangeCommand}"></RadioButton>
-                                <TextBlock Text="按特定页面拆分" VerticalAlignment="Center"></TextBlock>
+                                <TextBlock Text="按特定页面拆分" VerticalAlignment="Center"></TextBlock>
                                 <cus:WritableComboBox  Height="32" Width="183" Text="{Binding PageRangeText, Mode=TwoWay}" IsEnabled="{Binding CustomPageRangeIsEnabled}" SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}"/>
-                            </StackPanel>
-                        </StackPanel>
-                    </Grid>
-                    <Grid Grid.Row="1">
-                        <StackPanel Orientation="Vertical">
-                            <TextBlock Text="文档命名" Height="22" Width="56" HorizontalAlignment="Left"></TextBlock>
+                            </StackPanel>
+                        </StackPanel>
+                    </Grid>
+                    <Grid Grid.Row="1">
+                        <StackPanel Orientation="Vertical">
+                            <TextBlock Text="文档命名" Height="22" Width="56" HorizontalAlignment="Left"></TextBlock>
                             <TextBlock Height="32" Width="303" Margin="0,0,0,6" Text="{Binding FilePathName}"></TextBlock>
-                            <StackPanel Orientation="Horizontal" Margin="0,0,0,13">
+                            <StackPanel Orientation="Horizontal" Margin="0,0,0,13">
                                 <CheckBox Margin="0,0,11,0" Command="{Binding FrontFileNameCommand}" IsChecked="{Binding FrontFileIsCheck}"></CheckBox>
-                                <TextBlock Text="将原始文档名前置"></TextBlock>
-                            </StackPanel>
-                            <StackPanel Orientation="Horizontal" Margin="0,0,0,8">
+                                <TextBlock Text="将原始文档名前置"></TextBlock>
+                            </StackPanel>
+                            <StackPanel Orientation="Horizontal" Margin="0,0,0,8">
                                 <CheckBox VerticalAlignment="Center" Margin="0,0,11,0" Command="{Binding FileNameLabelCommand}" IsChecked="{Binding FileNameLabelIsCheck}"></CheckBox>
-                                <TextBlock Text="标签" VerticalAlignment="Center" Margin="0,0,30,0"></TextBlock>
+                                <TextBlock Text="标签" VerticalAlignment="Center" Margin="0,0,30,0"></TextBlock>
                                 <TextBox x:Name="FileNameLabelTextBox" Height="32" Width="110" Text="{Binding FileNameLabelText}" TextChanged="TextBox_TextChanged" IsEnabled="{Binding FileNameLabelIsEnabled}"></TextBox>
-                            </StackPanel>
-                            <StackPanel Orientation="Horizontal">
+                            </StackPanel>
+                            <StackPanel Orientation="Horizontal">
                                 <CheckBox VerticalAlignment="Center" Margin="0,0,11,0"  Command="{Binding FileNameDeimiterCommand}" IsChecked="{Binding FileNameDeimiterIsCheck}"></CheckBox>
-                                <TextBlock Text="分隔符" VerticalAlignment="Center" Margin="0,0,18,0"></TextBlock>
+                                <TextBlock Text="分隔符" VerticalAlignment="Center" Margin="0,0,18,0"></TextBlock>
                                 <TextBox x:Name="FileNameDeimiterTextBox"  Height="32" Width="110" Text="{Binding FileNameDeimiterText}" TextChanged="TextBox_TextChanged" IsEnabled="{Binding FileNameDeimiterIsEnabled}"></TextBox>
-                            </StackPanel>
-                        </StackPanel>
-                    </Grid>
-                </Grid>
-            </Grid>
-        </Border>
+                            </StackPanel>
+                        </StackPanel>
+                    </Grid>
+                </Grid>
+            </Grid>
+        </Border>
         <Grid Grid.Row="2">
             <Button
                     Width="98"
@@ -91,5 +91,5 @@
                     Command="{Binding SplitCommand}"
                     Content="拆分" />
         </Grid>
-    </Grid>
-</UserControl>
+    </Grid>
+</UserControl>

+ 28 - 28
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageSplitDialog.xaml.cs

@@ -2,33 +2,33 @@
 using PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs;
 using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs;
 using PDF_Office.ViewModels.Dialog.ToolsDialogs.SaftyDialogs;
-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;
+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;
 using System.Xml.Linq;
-
-namespace PDF_Office.Views.Dialog.HomePageToolsDialogs
-{
-    /// <summary>
-    /// MainPageSplitDialog.xaml 的交互逻辑
-    /// </summary>
-    public partial class HomePageSplitDialog : UserControl
-    {
-        public HomePageSplitDialog()
-        {
-            InitializeComponent();
-        }
+
+namespace PDF_Office.Views.Dialog.HomePageToolsDialogs
+{
+    /// <summary>
+    /// MainPageSplitDialog.xaml 的交互逻辑
+    /// </summary>
+    public partial class HomePageSplitDialog : UserControl
+    {
+        public HomePageSplitDialog()
+        {
+            InitializeComponent();
+        }
 
         private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
         {
@@ -58,5 +58,5 @@ namespace PDF_Office.Views.Dialog.HomePageToolsDialogs
             SplitPreview.AwaitRenderBitmap(SplitPreview.document);
             SplitPreview.PageIndex.Text = SplitPreview.document.PageCount.ToString();
         }
-    }
-}
+    }
+}