Parcourir la source

PDF工具 - 重整本地缓存数据逻辑

chenrongqian il y a 2 ans
Parent
commit
15ca99b800

+ 1 - 0
PDF Office/App.xaml

@@ -20,6 +20,7 @@
 
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/PathButtonStyle.xaml" />
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ContextMenuTextEditStyle.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ContextMenuStyle.xaml" />
                 <!--  Enable show customctrol's correctly UI in Xaml Designer  -->
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Themes/Generic.xaml" />
             </ResourceDictionary.MergedDictionaries>

+ 120 - 40
PDF Office/Helper/PDFToolsHelper.cs

@@ -76,7 +76,7 @@ namespace PDF_Office.Helper
         /// </summary>
         public void SetImagePath(string path)
         {
-            toolItem.Image = path;
+            toolItem.FnImg = path;
         }
 
         /// <summary>
@@ -84,8 +84,8 @@ namespace PDF_Office.Helper
         /// </summary>
         public void SetContent(string fnName,string fnInfo)
         {
-            toolItem.Title = fnName;
-            toolItem.TitleInfo = fnInfo;
+            toolItem.FnName = fnName;
+            toolItem.FnInfo = fnInfo;
         }
 
         /// <summary>
@@ -93,8 +93,7 @@ namespace PDF_Office.Helper
         /// </summary>
         public void SetFnType(PDFFnType fnType)
         {
-            toolItem.FnType = (int)fnType;
-            toolItem.strFnType = Enum.GetName(typeof(PDFFnType), fnType);
+            toolItem.FnType = fnType;
         }
 
 
@@ -105,6 +104,8 @@ namespace PDF_Office.Helper
         public List<ToolItem> QuickTools = null;
         public List<ToolItem> MoreTools = null;
         private static PDFToolsHelper pDFToolsHelper;
+
+        public const int QuickToolCount = 8;//快捷工具显示的个数
         public static PDFToolsHelper GetInstance()
         {
             if (pDFToolsHelper == null)
@@ -127,9 +128,10 @@ namespace PDF_Office.Helper
             //Settings.Default.QuickPDFToolsList.Clear();
             //Settings.Default.Save();
             InitAllTools();
-            ContianNewTools();
             InitQuickTools();
             InitMoreTools();
+
+            //  ContianNewTools();
         }
 
         private void InitAllTools()
@@ -258,12 +260,35 @@ namespace PDF_Office.Helper
             AllTools.Add(compareDoc.toolItem);
         }
 
+        /// <summary>
+        /// 检查是否为新增工具
+        /// </summary>
         private void ContianNewTools()
         {
-            Settings.Default.AllPDFToolsList.Clear();
+            var cacheList = Settings.Default.AllPDFToolsList;
             foreach (var item in AllTools)
             {
-                Settings.Default.AllPDFToolsList.Add(item);
+                ToolItem toolItem = null;
+                foreach (var cacheItem in cacheList)
+                {
+                    var strFnTye = Enum.GetName(typeof(PDFFnType), item.FnType);
+                    if (cacheItem.FnTypeStr != strFnTye && cacheItem.IsNewTool == true)
+                    {
+                        toolItem = item;
+                        break;
+                    }
+                }
+
+                if(toolItem != null && toolItem.IsNewTool == true)
+                {
+                    CacheToolItem cacheTool = new CacheToolItem();
+                    cacheTool.IsNewTool = true;
+                    cacheTool.ToolTypeId = toolItem.ToolTypeId;
+                    cacheTool.ToolTypeStr = Enum.GetName(typeof(PDFToolType), toolItem.ToolType);
+                    cacheTool.FnTypeStr = Enum.GetName(typeof(PDFFnType), toolItem.FnType);
+                    Settings.Default.AllPDFToolsList.Add(cacheTool);
+                }
+               
             }
             Settings.Default.Save();
 
@@ -274,66 +299,121 @@ namespace PDF_Office.Helper
         /// </summary>
         private void InitQuickTools()
         {
-            var settingQuickToolslist = Settings.Default.QuickPDFToolsList;
 
-            int quickToolCount = 0;
-            if (settingQuickToolslist != null && settingQuickToolslist.Count > 0)
+            var cacheList = Settings.Default.AllPDFToolsList;
+
+            if (cacheList == null)
+                cacheList = new AllPDFToolsList();
+
+            if(cacheList.Count > 0)
             {
-                foreach (var item in AllTools)
+                int currentCount = 0;
+                foreach (var cacheItem in cacheList)
                 {
-                    if (quickToolCount == 8)
-                        break;
-
-                    var pdfToolItem = settingQuickToolslist.FirstOrDefault(tool => tool.strFnType == item.strFnType);
-                    if (pdfToolItem != null)
+                    if (cacheItem.ToolLayOutType == 1 && currentCount < QuickToolCount)
                     {
-                        quickToolCount++;
-                        pdfToolItem.FnType = item.FnType;
-                        QuickTools.Add(pdfToolItem);
+                        foreach (var allItem in AllTools)
+                        {
+                            if (cacheItem.FnTypeStr == Enum.GetName(typeof(PDFFnType), allItem.FnType))
+                            {
+                                allItem.IsQuickTool = true;
+
+                                var index = QuickTools.FindIndex(t => t.ToolTypeId > allItem.ToolTypeId);
+                                if (index == -1)
+                                {
+                                    allItem.ToolTypeId = cacheItem.ToolTypeId;
+                                    QuickTools.Add(allItem);
+                                }
+                                else
+                                {
+                                    allItem.ToolTypeId = index;
+                                    QuickTools.Insert(index, allItem);
+                                }
+
+                                currentCount++;
+                                break;
+                            }
+                        }
                     }
                 }
 
-                if (quickToolCount < 8 && AllTools.Count > 8)
+            }
+            else
+            {
+                //当所有工具大于等于快捷工具显示的个数时
+                if (AllTools.Count >= QuickToolCount)
                 {
-                    var count = 8 - quickToolCount;
-                    for (int i = count - 1; i < count; i++)
+                    for (int i = 0; i < QuickToolCount; i++)
                     {
+                        AllTools[i].ToolTypeId = i;
+                        AllTools[i].IsQuickTool = true;
                         QuickTools.Add(AllTools[i]);
                     }
                 }
+                else
+                {
+                    for (int i = 0; i < AllTools.Count; i++)
+                    {
+                        AllTools[i].ToolTypeId = i;
+                        AllTools[i].IsQuickTool = true;
+                        QuickTools.Add(AllTools[i]);
+                    }
+                }
+                SaveAllTools();
+
             }
-            else
-            {
-                if (settingQuickToolslist == null)
-                    Settings.Default.QuickPDFToolsList = new QuickPDFToolsList();
 
-                QuickTools = AllTools.Take(8).ToList<ToolItem>();
 
-                foreach(var item in QuickTools)
-                {
-                    Settings.Default.QuickPDFToolsList.Add(item);
-                }
 
-                Settings.Default.Save();
+        }
 
-            }
-                
+        private void SaveAllTools()
+        {
+            var cacheList = Settings.Default.AllPDFToolsList;
 
+            foreach (var item in AllTools)
+            {
+                CacheToolItem cacheItem = new CacheToolItem();
+                cacheItem.ToolLayOutType = (item.IsQuickTool == true ? 1 : 0);
+                cacheItem.IsNewTool = item.IsNewTool;
+                cacheItem.ToolTypeId = item.ToolTypeId;
+                cacheItem.ToolTypeStr = Enum.GetName(typeof(PDFToolType), item.ToolType);
+                cacheItem.FnTypeStr = Enum.GetName(typeof(PDFFnType), item.FnType);
+                cacheList.Add(cacheItem);
+            }
+            Settings.Default.Save();
         }
 
+
         private void InitMoreTools()
         {
-            List<ToolItem> more = new List<ToolItem>();
+            int currentCount = 0;
+            foreach (var allItem in AllTools)
+            {
+                if (allItem.IsQuickTool == false)
+                {
+                    allItem.ToolTypeId = currentCount;
+                    MoreTools.Add(allItem);
+                    currentCount++;
+                }
+            }
+        }
+
+        public void SaveCacheList()
+        {
+            var cacheLists = Settings.Default.AllPDFToolsList;
+            CacheToolItem cacheItem = null;
             foreach (var item in AllTools)
             {
-                var pdfToolItem = QuickTools.FirstOrDefault(tool => tool.strFnType == item.strFnType);
-                if (pdfToolItem == null)
+                cacheItem = cacheLists.Find(t => t.FnTypeStr == Enum.GetName(typeof(PDFFnType), item.FnType));
+                if (cacheItem != null)
                 {
-                    more.Add(item);
+                    cacheItem.ToolTypeId = item.ToolTypeId;
+                    cacheItem.ToolLayOutType = (item.IsQuickTool == true ? 1 : 0);
                 }
             }
 
-            MoreTools = more;
+            Settings.Default.Save();
         }
     }
 

+ 27 - 18
PDF Office/Model/PDFTool/ToolItem.cs

@@ -9,26 +9,35 @@ using System.Threading.Tasks;
 
 namespace PDF_Office.Model.PDFTool
 {
-    public class ToolItem1 : INotifyPropertyChanged
+    public class ToolItem : BindableBase
     {
-        public event PropertyChangedEventHandler PropertyChanged = delegate { };
-
-        private bool _isShowConciseContent = false;
-        public bool IsShowConciseContent
-        {
-            get { return _isShowConciseContent; }
-            set
-            {
-                _isShowConciseContent = value;
-                PropertyChanged(this, new PropertyChangedEventArgs("IsShowConciseContent"));
-            }
-        }
+        /// <summary>
+        /// 是否为新增的工具
+        /// </summary>
         public bool IsNewTool { get; set; }
-        public int Id { get; set; }
-        public PDFToolType Tag { get; set; }
-        public string Image { get; set; }
-        public string TitleInfo { get; set; }
-        public string Title { get; set; }
+        /// <summary>
+        /// 是否为快捷工具
+        /// </summary>
+        public bool IsQuickTool { get; set; }
+        /// <summary>
+        /// 类型:如普通工具、常用工具、付费工具
+        /// </summary>
+        public int ToolTypeId { get; set; }
+        /// <summary>
+        /// 类型:如普通工具、常用工具、付费工具
+        /// </summary>
+        public PDFToolType ToolType { get; set; }
+        /// <summary>
+        /// 功能名称:拆分功能、合并功能、转档功能等
+        /// </summary>
+        public PDFFnType FnType { get; set; }
+
+        #region 显示内容
+
+        public string FnImg { get; set; }
+        public string FnInfo { get; set; }
+        public string FnName { get; set; }
 
+        #endregion
     }
 }

+ 14 - 0
PDF Office/ViewModels/HomePanel/PDFTools/PDFToolsContentViewModel.cs

@@ -22,11 +22,19 @@ namespace PDF_Office.ViewModels.HomePanel.PDFTools
             set { SetProperty(ref _isExpendTools, value); }
         }
 
+        private bool _isDropTools = false;
+        public bool IsDropTools
+        {
+            get { return _isDropTools; }
+            set { SetProperty(ref _isDropTools, value); }
+        }
+
         #endregion
 
         #region Command and Event
         public DelegateCommand<object> OpenMenuCommand { get; set; }
         public DelegateCommand ExpendCommand { get; set; }
+        public DelegateCommand<object> CustomCommand { get; set; }
 
         public event EventHandler<bool> ExpendToolsHanlder;
 
@@ -41,6 +49,12 @@ namespace PDF_Office.ViewModels.HomePanel.PDFTools
         {
             OpenMenuCommand = new DelegateCommand<object>(OpenMenu);
             ExpendCommand = new DelegateCommand(Expend);
+            CustomCommand = new DelegateCommand<object>(Custom);
+        }
+
+        private void Custom(object obj)
+        {
+            IsDropTools = true;
         }
 
         private void Expend()

+ 3 - 2
PDF Office/ViewModels/HomePanel/PDFTools/QuickToolsContentViewModel.cs

@@ -2,6 +2,7 @@
 using PDF_Office.Helper;
 using PDF_Office.Model;
 using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
+using PDF_Office.Model.PDFTool;
 using PDFSettings;
 using Prism.Commands;
 using Prism.Mvvm;
@@ -96,11 +97,11 @@ namespace PDF_Office.ViewModels.HomePanel.PDFTools
             System.Windows.Forms.OpenFileDialog dlg = new System.Windows.Forms.OpenFileDialog();
             dlg.Multiselect = false;
             dlg.Filter = "PDF|*.pdf;*.PDF;";
-            if (toolItem.FnType == (int)PDFFnType.Compress || toolItem.FnType == (int)PDFFnType.Security)
+            if (toolItem.FnType == PDFFnType.Compress || toolItem.FnType == PDFFnType.Security)
             {
                 dlg.Multiselect = true;
             }
-            if (toolItem.FnType == (int)PDFFnType.Merge)
+            if (toolItem.FnType == PDFFnType.Merge)
             {
                 dlg.Multiselect = true;
                 dlg.Filter = "Picture|*.png;*.PNG;*.jpg;*.JPG;*bmp;*jpeg;*gif;*tiff;";

+ 3 - 3
PDF Office/Views/HomePanel/PDFTools/PDFToolExpendItem.xaml

@@ -22,16 +22,16 @@
                         <RowDefinition Height="auto"></RowDefinition>
                         <RowDefinition Height="*"></RowDefinition>
                     </Grid.RowDefinitions>
-                    <Image VerticalAlignment="Top" Source="{Binding Image}" HorizontalAlignment="Center" Width="28" Height="28" Margin="5,10,5,5" />
+                    <Image VerticalAlignment="Top" Source="{Binding FnImg}" HorizontalAlignment="Center" Width="28" Height="28" Margin="5,10,5,5" />
 
-                    <TextBlock  Name="TxbTitle" Grid.Column="1" Text="{Binding Title}" 
+                    <TextBlock  Name="TxbTitle" Grid.Column="1" Text="{Binding FnName}" 
                                     FontSize="14" FontWeight="SemiBold" Foreground="Black"
                                     VerticalAlignment="Top" Margin="0,15,0,0"></TextBlock>
 
 
                     <StackPanel Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1"  Margin="6,0,6,0">
                         <Grid>
-                            <TextBlock Name="ToolInfoBlock" Text="{Binding TitleInfo}"
+                            <TextBlock Name="ToolInfoBlock" Text="{Binding FnInfo}"
                                        Foreground="#666666" LineHeight="16"  FontSize="12"  TextWrapping="Wrap" VerticalAlignment="Center" Margin="0,8,0,0"></TextBlock>
                         </Grid>
 

+ 2 - 2
PDF Office/Views/HomePanel/PDFTools/PDFToolItem.xaml

@@ -18,8 +18,8 @@
                     <ColumnDefinition Width="*"/>
                 </Grid.ColumnDefinitions>
                 <Grid x:Name="GridToolMaskConcise" Grid.ColumnSpan="2" Background="#477EDE" Visibility="Collapsed"/>
-                <Image VerticalAlignment="Top" Source="{Binding Image}" HorizontalAlignment="Center" Width="28" Height="28" Margin="5,10,5,5" />
-                <TextBlock  Name="TxbTitleConcise" Grid.Column="1" Text="{Binding Title}" FontSize="14" FontWeight="SemiBold" VerticalAlignment="Top" Margin="0,15,0,0"></TextBlock>
+                <Image VerticalAlignment="Top" Source="{Binding FnImg}" HorizontalAlignment="Center" Width="28" Height="28" Margin="5,10,5,5" />
+                <TextBlock  Name="TxbTitleConcise" Grid.Column="1" Text="{Binding FnName}" FontSize="14" FontWeight="SemiBold" VerticalAlignment="Top" Margin="0,15,0,0"></TextBlock>
             </Grid>
         </Border>
         

+ 42 - 2
PDF Office/Views/HomePanel/PDFTools/PDFToolsContent.xaml

@@ -66,15 +66,17 @@
             HorizontalAlignment="Right"
             VerticalAlignment="Top"
             Orientation="Horizontal"
-            Visibility="Visible">
+            Visibility="{Binding IsDropTools,Converter={StaticResource InvertBoolToVisibleConvert}}">
 
                     <Button
-                x:Name="BtnCustom"
+                x:Name="BtnCustom" Tag="Custom"
                 Width="68"
                 Height="28"
                 Margin="0,0,0,0"
                 Background="#FFFFFF"
                 Content="Custom"
+                Command="{Binding CustomCommand}"
+                CommandParameter="{Binding ElementName=BtnCustom,Path=Tag}"        
                 Click="BtnTools_Click"
                >
 
@@ -91,6 +93,44 @@
                     </Button>
 
                 </StackPanel>
+
+
+                <StackPanel
+            x:Name="PnlDropToolsUIBtns" Grid.ColumnSpan="2"
+            Grid.Column="0" 
+            Margin="0,0,12,0"
+            HorizontalAlignment="Right"
+            VerticalAlignment="Top"
+            Orientation="Horizontal"
+            Visibility="{Binding IsDropTools,Converter={StaticResource BoolToVisibilityConverter}}">
+
+                    <Button
+                x:Name="BtnCancel" Tag="Cancel"
+                Width="68"
+                Height="28"
+                Margin="0,0,0,0"
+                Background="#FFFFFF"
+                Content="Cancel"
+                CommandParameter="{Binding ElementName=BtnCustom,Path=Tag}"           
+                Click="BtnTools_Click"
+               >
+
+                    </Button>
+
+                    <Button  Tag="Apply"
+                x:Name="BtnApply"
+                Width="28"
+                Height="28"
+                Margin="12,0,0,0"
+                 Background="#FFFFFF" BorderThickness="0" Content="Apply"
+                Command="{Binding OpenMenuCommand}" CommandParameter="{Binding ElementName=BtnMore}"
+               >
+                    </Button>
+
+                </StackPanel>
+
+
+
             </Grid>
            
             <TextBlock Text="首页快捷工具" Margin="0,16,0,0" FontSize="14" FontFamily="PingFang SC"/> 

+ 27 - 10
PDF Office/Views/HomePanel/PDFTools/PDFToolsContent.xaml.cs

@@ -205,7 +205,7 @@ namespace PDF_Office.Views.HomePanel.PDFTools
         {
             var source = sourceListItem.Content as ToolItem;
             if (moreTools == null && moreTools.Count != 0) return;
-            List<ToolItem> toolModule = moreTools.FindAll(item => item.Title == source.Title);
+            List<ToolItem> toolModule = moreTools.FindAll(item => item.FnName == source.FnName);
             if (toolModule.Count > 0)
             {
                 // 判断文件夹是否存在,不存在则创建
@@ -214,7 +214,7 @@ namespace PDF_Office.Views.HomePanel.PDFTools
                 {
                     folder.Create();
                 }
-                fileName = System.IO.Path.Combine(folder.FullName, $"{source.Title}.png");
+                fileName = System.IO.Path.Combine(folder.FullName, $"{source.FnName}.png");
 
                 SaveToPng(sourceListItem, fileName);
             }
@@ -242,7 +242,7 @@ namespace PDF_Office.Views.HomePanel.PDFTools
                 return;
             }
             var targetAToolModule = targetListItem.Content as ToolItem;
-            ToolItem target = quickTools.Find(c => c.Title == targetAToolModule.Title);
+            ToolItem target = quickTools.Find(c => c.FnName == targetAToolModule.FnName);
 
             //查找元数据
             var sourceAToolModule = e.Data.GetData(typeof(ToolItem)) as ToolItem;
@@ -272,7 +272,7 @@ namespace PDF_Office.Views.HomePanel.PDFTools
         private void ModuleExchange(ToolItem sourceAToolModule, ToolItem targetAToolModule)
         {
             if (moreTools == null) return;
-            ToolItem source = moreTools.Find(c => c.Title == sourceAToolModule.Title);
+            ToolItem source = moreTools.Find(c => c.FnName == sourceAToolModule.FnName);
             ListBoxEx MoreEx = GetListMoreControl();
             if (MoreEx == null) return;
 
@@ -280,19 +280,25 @@ namespace PDF_Office.Views.HomePanel.PDFTools
             if (ShortEx == null) return;
 
 
-            int targetIndex = quickTools.FindIndex(item => item.Title == targetAToolModule.Title);
+            int targetIndex = quickTools.FindIndex(item => item.FnName == targetAToolModule.FnName);
             if (targetIndex < 0) return;
             if (!isMoreCuts)
             {
                 MoreEx.AllowDrop = false;
                 sourceImage.Visibility = Visibility.Hidden;
-                source = quickTools.Find(c => c.Title == sourceAToolModule.Title);
+                source = quickTools.Find(c => c.FnName == sourceAToolModule.FnName);
                 if (source == null) return;
-                int sourceIndex = quickTools.FindIndex(item => item.Title == sourceAToolModule.Title);
+                int sourceIndex = quickTools.FindIndex(item => item.FnName == sourceAToolModule.FnName);
                 if (sourceIndex < 0) return;
                 var temp = quickTools[sourceIndex];
                 quickTools[sourceIndex] = quickTools[targetIndex];
                 quickTools[targetIndex] = temp;
+
+                var sourceId = source.ToolTypeId;
+                var targetId = target.ToolTypeId;
+                source.ToolTypeId = targetId;
+                target.ToolTypeId = sourceId;
+
                 ShortEx.Items.Refresh();
                 ListBoxCutsWidthChanged(ShortEx);
             }
@@ -306,6 +312,13 @@ namespace PDF_Office.Views.HomePanel.PDFTools
                 quickTools.Remove(target);
                 quickTools.Insert(targetIndex, source);
 
+                source.IsQuickTool = true;
+                target.IsQuickTool = false;
+
+                var targetId = target.ToolTypeId;
+                source.ToolTypeId = targetId;
+                target.ToolTypeId = 0;//移到第一个位置
+
                 MoreEx.Items.Refresh();
                 ShortEx.Items.Refresh(); 
 
@@ -314,8 +327,12 @@ namespace PDF_Office.Views.HomePanel.PDFTools
                 ListBoxCutsWidthChanged(ShortEx);
                 ListBoxCutsWidthChanged(MoreEx);
             }
+
+            if (PDFtools != null)
+                PDFtools.SaveCacheList();
         }
 
+
         private void WorkingWithAnimation(Point pos)
         {
             sourceImage.Visibility = Visibility.Hidden;
@@ -453,7 +470,7 @@ namespace PDF_Office.Views.HomePanel.PDFTools
             {
                 var sourceAToolModule = e.Data.GetData(typeof(ToolItem)) as ToolItem;
                 if (sourceAToolModule == null) return;
-                int sourceIndex = quickTools.FindIndex(item => item.Title == sourceAToolModule.Title);
+                int sourceIndex = quickTools.FindIndex(item => item.FnName == sourceAToolModule.FnName);
                 //根据index找listbox对应的item
                 sourceListItem = (ListItemQuickTool)(ShortEx.ItemContainerGenerator.ContainerFromIndex(sourceIndex) as FrameworkElement);
                 if (sourceListItem == null)
@@ -467,7 +484,7 @@ namespace PDF_Office.Views.HomePanel.PDFTools
             {
                 var sourceAToolModule = e.Data.GetData(typeof(ToolItem)) as ToolItem;
                 if (sourceAToolModule == null) return;
-                int sourceIndex = moreTools.FindIndex(item => item.Title == sourceAToolModule.Title);
+                int sourceIndex = moreTools.FindIndex(item => item.FnName == sourceAToolModule.FnName);
                 //根据index找listbox对应的item
                 sourceListItem = (ListItemQuickTool)(MoreEx.ItemContainerGenerator.ContainerFromIndex(sourceIndex) as FrameworkElement);
                 if (sourceListItem == null)
@@ -494,7 +511,7 @@ namespace PDF_Office.Views.HomePanel.PDFTools
             }
             var targetAToolModule = targetListItem.Content as ToolItem;
             if (targetAToolModule == null) return;
-            target = quickTools.Find(c => c.Title == targetAToolModule.Title);
+            target = quickTools.Find(c => c.FnName == targetAToolModule.FnName);
         }
 
         /// <summary>

+ 16 - 51
PDFSettings/PDFToolsList.cs

@@ -10,7 +10,7 @@ namespace PDFSettings
     /// <summary>
     /// 所有工具列表
     /// </summary>
-    public class AllPDFToolsList : List<ToolItem>
+    public class AllPDFToolsList : List<CacheToolItem>
     {
 
     }
@@ -18,74 +18,39 @@ namespace PDFSettings
     /// <summary>
     /// 快捷工具列表
     /// </summary>
-    public class QuickPDFToolsList : List<ToolItem>
+    public class QuickPDFToolsList : List<CacheToolItem>
     {
 
     }
 
-    public class ToolItem : INotifyPropertyChanged
+    public class CacheToolItem 
     {
-        public event PropertyChangedEventHandler PropertyChanged = delegate { };
-        private bool _isShowConciseContent = false;
-        /// <summary>
-        /// PDF工具集合UI是否显示为只有标题和图标的内容
-        /// </summary>
-        public bool IsShowConciseContent
-        {
-            get { return _isShowConciseContent; }
-            set
-            {
-                _isShowConciseContent = value;
-                PropertyChanged(this, new PropertyChangedEventArgs("IsShowConciseContent"));
-            }
-        }
-
         #region 重要属性
-
-
         /// <summary>
-        /// 是否为新增工具
+        /// 是否为新增工具功能
         /// </summary>
-        public bool IsNew { get; set; }
-
-        #region 工具类型
-
+        public bool IsNewTool { get; set; }
         /// <summary>
-        /// 排序的PDF工具类型:优势工具、常用工具、付费工具等
+        /// 是否为快捷工具;值0为更多工具、值1为快捷工具
+        /// Todo:使用int类型,是因为考虑将来是否会有新需求,除了快捷工具、更多工具外,可能存在以其他布局分类的PDF工具;预留更多的int值以便于缓存数据
         /// </summary>
-        public int ToolType { get; set; }
-        /// <summary>
-        /// 某类型PDF工具的排序Id号
-        /// </summary>
-        public string strToolType { get; set; }
-        #endregion
+        public int ToolLayOutType { get; set; }
 
-
-        #region 功能
         /// <summary>
-        /// PDF工具某功能的枚举值:用来标识功能
+        /// 显示排序号:根据id号递增的方式进行排列顺序
         /// </summary>
-        public int FnType { get; set; }
-        /// <summary>
-        /// 功能名称:拆分功能、合并功能、转档功能等
-        /// </summary>
-        public string strFnType { get; set; }
-        #endregion
+        public int ToolTypeId { get; set; }
 
-        #region 显示内容
         /// <summary>
-        /// 图标路径
+        /// 类型:如普通工具、常用工具、付费工具
         /// </summary>
-        public string Image { get; set; }
-        /// <summary>
-        /// 功能说明内容
-        /// </summary>
-        public string TitleInfo { get; set; }
+        public string ToolTypeStr { get; set; }
+
         /// <summary>
-        /// 功能标题
+        /// 功能名称:拆分功能、合并功能、转档功能等
+        /// Todo:考虑到后续便于迭代PDF工具功能,不能使用int类型进行识别所需的功能,因为int类型会灵活变化,以至于不方便修改增加删除功能;
         /// </summary>
-        public string Title { get; set; }
-        #endregion
+        public string FnTypeStr { get; set; }
 
         #endregion