123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Runtime.CompilerServices;
- using System.Text;
- using System.Threading.Tasks;
- namespace PDF_Office.Model
- {
- /// <summary>
- /// 存放公用模块的RegionName
- /// </summary>
- public static class RegionNames
- {
- /// <summary>
- /// 最外层的Region名称
- /// </summary>
- public static string MainRegion = "MainRegion";
- /// <summary>
- /// 首页右侧快捷工具Content RegionName
- /// </summary>
- public static string ToolRegionName
- {
- get
- {
- return GetRegionName("ToolRegionName");
- }
- }
- /// <summary>
- /// 阅读页PDFViewer 对应的Content RegionName
- /// </summary>
- public static string ViwerRegionName
- {
- get
- {
- return GetRegionName("ViwerRegionName");
- }
- }
- public static string ReadRegionName
- {
- get
- {
- return GetRegionName("ReadRegionName");
- }
- }
- /// <summary>
- /// 阅读页PDFViewer 对应的Content RegionName
- /// </summary>
- public static string WatermarkViwerRegionName
- {
- get
- {
- return GetRegionName("WatermarkViwerRegionName");
- }
- }
- public static string BackgroundViewerRegionName
- {
- get
- {
- return GetRegionName("BackgroundViewerRegionName");
- }
- }
- public static string BatesViewerRegionName
- {
- get
- {
- return GetRegionName("BatesViewerRegionName");
- }
- }
- public static string HeaderFooterViewerRegionName
- {
- get
- {
- return GetRegionName("HeaderFooterViewerRegionName");
- }
- }
- public static string RedactionViewerRegionName
- {
- get
- {
- return GetRegionName("RedactionViewerRegionName");
- }
- }
- /// <summary>
- /// BOTA内容项 对应的Content RegionName
- /// </summary>
- public static string BOTARegionName
- {
- get
- {
- return GetRegionName("BOTARegionName");
- }
- }
- /// <summary>
- /// 属性面板 对应的Content RegionName
- /// </summary>
- public static string PropertyRegionName
- {
- get
- {
- return GetRegionName("PropertyRegionName");
- }
- }
- /// <summary>
- /// 工具功能(页面编辑、水印、密文等)对应的Content RegionName
- /// </summary>
- public static string ToolContentRegionName
- {
- get
- {
- return GetRegionName("ToolContentRegionName");
- }
- }
- /// <summary>
- /// 工具菜单栏对应的Content RegionName
- /// </summary>
- public static string ToolsBarContentRegionName
- {
- get
- {
- return GetRegionName("ToolsBarContentRegionName");
- }
- }
- /// <summary>
- /// 底部工具栏对应的Content RegionName
- /// </summary>
- public static string BottomToolRegionName
- {
- get
- {
- return GetRegionName("BottomToolRegionName");
- }
- }
- /// <summary>
- /// 视图模块-分屏视图
- /// </summary>
- public static string SplitScreenViewRegionName
- {
- get
- {
- return GetRegionName("SplitScreenViewRegionName");
- }
- }
- /// <summary>
- /// 视图模块-主题颜色
- /// </summary>
- public static string ThemesContentName
- {
- get
- {
- return GetRegionName("ThemesContentName");
- }
- }
- /// <summary>
- /// 视图模块-阅读模式
- /// </summary>
- public static string ReadModeRegionName
- {
- get
- {
- return GetRegionName("ReadModeRegionName");
- }
- }
- public static string ReadModePageRegionName
- {
- get
- {
- return GetRegionName("ReadModePageRegionName");
- }
- }
- /// <summary>
- /// 获取MainWindowsViewModel RegionNames字典里的RegionName,
- /// 如果字典里没有键值就新建一个GUID,并插入到
- /// </summary>
- /// <returns></returns>
- public static string GetRegionName(string key)
- {
- if (App.mainWindowViewModel.SelectedItem.RegionContentNames.ContainsKey(key))
- {
- return App.mainWindowViewModel.SelectedItem.RegionContentNames[key];
- }
- else
- {
- string name = Guid.NewGuid().ToString();
- App.mainWindowViewModel.SelectedItem.RegionContentNames[key] = name;
- return name;
- }
- }
- /// <summary>
- /// 如果不存在key,则插入key,并设置Value
- /// 如果存在key,则更改Value
- /// </summary>
- public static void SetRegionName(string key, string Value)
- {
- if (App.mainWindowViewModel.SelectedItem.RegionContentNames.ContainsKey(key))
- {
- App.mainWindowViewModel.SelectedItem.RegionContentNames[key] = Value;
- }
- else
- {
- App.mainWindowViewModel.SelectedItem.RegionContentNames[key] = Value;
- }
- }
- }
- }
|