Explorar o código

提取-修改错误

liyijie %!s(int64=2) %!d(string=hai) anos
pai
achega
7d2fe88273

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

@@ -102,6 +102,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
             if (!CommonHelper.GetPagesInRange(ref extractModel.PageParm, extractModel.PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
             { //TODO
                 Trace.WriteLine("输入不对");
+                MessageBoxEx.Show("输入不对");
                 return;
             }
             if (extractModel.ExtractToSingleFile)

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

@@ -152,11 +152,13 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
             {
                 Trace.WriteLine("Document==null");
                 //TODO
+                MessageBoxEx.Show("文档为空");
                 return;
             }
             if (insertdocument.IsEncrypted)
             {
                 Trace.WriteLine("youmima");
+                MessageBoxEx.Show("文档加密");
                 //TODO
                 return;
             }

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

@@ -299,6 +299,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
             if (!CommonHelper.GetPagesInRange(ref splitModel.PageParm, splitModel.PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
             { //TODO
                 Trace.WriteLine("输入不对");
+                MessageBoxEx.Show("输入不对");
                 return;
             }
             Trace.WriteLine("splitModel.PageRange: " + splitModel.PageRange + "-----");

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

@@ -1,37 +1,37 @@
 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)
         {
-            ExtractPreview.document = ((HomePageInsertDialogViewModel)this.DataContext).document;
+            ExtractPreview.document = ((HomePageExtractDialogViewModel)this.DataContext).document;
             ExtractPreview.AwaitRenderBitmap(ExtractPreview.document);
             ExtractPreview.PageIndex.Text = ExtractPreview.document.PageCount.ToString();
 
         }
-    }
-}
+    }
+}

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

@@ -1,95 +1,95 @@
-<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>
-        <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">
-                    <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">
-                                <RadioButton VerticalAlignment="Center" IsChecked="{Binding AveragePagesIsCheck}" Command="{Binding AveragePagesCommand}"></RadioButton>
-                                <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">
-                                <RadioButton VerticalAlignment="Center" IsChecked="{Binding AverageFilesIsCheck}"  Command="{Binding AverageFilesCommand}"></RadioButton>
-                                <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">
-                                <RadioButton VerticalAlignment="Center" IsChecked="{Binding CustomPageRangeIsCheck}" Command="{Binding CustomPageRangeCommand}"></RadioButton>
+<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>
+        <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">
+                    <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">
+                                <RadioButton VerticalAlignment="Center" IsChecked="{Binding AveragePagesIsCheck}" Command="{Binding AveragePagesCommand}"></RadioButton>
+                                <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">
+                                <RadioButton VerticalAlignment="Center" IsChecked="{Binding AverageFilesIsCheck}"  Command="{Binding AverageFilesCommand}"></RadioButton>
+                                <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">
+                                <RadioButton VerticalAlignment="Center" IsChecked="{Binding CustomPageRangeIsCheck}" Command="{Binding CustomPageRangeCommand}"></RadioButton>
                                 <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>
-                            <TextBlock Height="32" Width="303" Margin="0,0,0,6" Text="{Binding FilePathName}"></TextBlock>
-                            <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">
-                                <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>
-                                <TextBox x:Name="FileNameLabelTextBox" Height="32" Width="110" Text="{Binding FileNameLabelText}" TextChanged="TextBox_TextChanged" IsEnabled="{Binding FileNameLabelIsEnabled}"></TextBox>
-                            </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>
-                                <TextBox x:Name="FileNameDeimiterTextBox"  Height="32" Width="110" Text="{Binding FileNameDeimiterText}" TextChanged="TextBox_TextChanged" IsEnabled="{Binding FileNameDeimiterIsEnabled}"></TextBox>
-                            </StackPanel>
-                        </StackPanel>
-                    </Grid>
-                </Grid>
-            </Grid>
-        </Border>
-        <Grid Grid.Row="2">
-            <Button
-                    Width="98"
-                    Height="32"
-                    Margin="16,0"
-                    HorizontalAlignment="Right"
-                    Command="{Binding CancelCommand}"
-                    Content="取消" />
-            <Button
-                    Width="98"
-                    Height="32"
-                    Margin="124,0"
-                    HorizontalAlignment="Right"
-                    Command="{Binding SplitCommand}"
-                    Content="拆分" />
-        </Grid>
-    </Grid>
-</UserControl>
+                                <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>
+                            <TextBlock Height="32" Width="303" Margin="0,0,0,6" Text="{Binding FilePathName}"></TextBlock>
+                            <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">
+                                <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>
+                                <TextBox x:Name="FileNameLabelTextBox" Height="32" Width="110" Text="{Binding FileNameLabelText}" TextChanged="TextBox_TextChanged" IsEnabled="{Binding FileNameLabelIsEnabled}"></TextBox>
+                            </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>
+                                <TextBox x:Name="FileNameDeimiterTextBox"  Height="32" Width="110" Text="{Binding FileNameDeimiterText}" TextChanged="TextBox_TextChanged" IsEnabled="{Binding FileNameDeimiterIsEnabled}"></TextBox>
+                            </StackPanel>
+                        </StackPanel>
+                    </Grid>
+                </Grid>
+            </Grid>
+        </Border>
+        <Grid Grid.Row="2">
+            <Button
+                    Width="98"
+                    Height="32"
+                    Margin="16,0"
+                    HorizontalAlignment="Right"
+                    Command="{Binding CancelCommand}"
+                    Content="取消" />
+            <Button
+                    Width="98"
+                    Height="32"
+                    Margin="124,0"
+                    HorizontalAlignment="Right"
+                    Command="{Binding SplitCommand}"
+                    Content="拆分" />
+        </Grid>
+    </Grid>
+</UserControl>