using System; using System.Collections.Generic; using System.Linq; using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; namespace PDF_Master.Model { /// /// 存放公用模块的RegionName /// 引用名称前 先查一下所有引用 看是否有其他地方引用了同样的名称,同一个页签内的控件不要使用同一个名称 /// public static class RegionNames { /// /// 最外层的Region名称 /// public static string MainRegion = "MainRegion"; /// /// 首页右侧快捷工具Content RegionName /// public static string ToolRegionName { get { return GetRegionName("ToolRegionName"); } } /// /// 阅读页PDFViewer 对应的Content RegionName /// public static string ViwerRegionName { get { return GetRegionName("ViwerRegionName"); } } /// /// 阅读页 显示拆分视图整个区域 Content /// public static string Viewer_SplitRegionName { get { return GetRegionName("Viewer_SplitRegionName"); } } /// /// 阅读页顶部Tip 对应的Content RegionName /// public static string TipContentRegionName { get { return GetRegionName("TipContentRegionName"); } } public static string LeftTipContentRegionName { get { return GetRegionName("LeftTipContentRegionName"); } } public static string NotePopupRegionName { get { return GetRegionName("NotePopupRegionName"); } } public static string ReadRegionName { get { return GetRegionName("ReadRegionName"); } } /// /// 阅读页PDFViewer 对应的Content RegionName /// 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"); } } /// /// BOTA内容项 对应的Content RegionName /// public static string BOTARegionName { get { return GetRegionName("BOTARegionName"); } } /// /// 属性面板 对应的Content RegionName /// public static string PropertyRegionName { get { return GetRegionName("PropertyRegionName"); } } /// /// 工具功能(页面编辑、水印、密文等)对应的Content RegionName /// public static string ToolContentRegionName { get { return GetRegionName("ToolContentRegionName"); } } /// /// 工具菜单栏对应的Content RegionName /// public static string ToolsBarContentRegionName { get { return GetRegionName("ToolsBarContentRegionName"); } } /// /// 底部工具栏对应的Content RegionName /// public static string BottomToolRegionName { get { return GetRegionName("BottomToolRegionName"); } } /// /// 视图模块-分屏视图 /// public static string SplitScreenViewRegionName { get { return GetRegionName("SplitScreenViewRegionName"); } } /// /// 视图模块-分屏视图-PDF /// public static string SplitViewRegionName { get { return GetRegionName("SplitViewRegionName"); } } /// /// 视图模块-分屏视图-页面控件 /// public static string SplitScreenPageRegionName { get { return GetRegionName("SplitScreenPageRegionName"); } } /// /// 视图模块-主题颜色 /// public static string ThemesContentName { get { return GetRegionName("ThemesContentName"); } } /// /// 视图模块-阅读模式 /// public static string ReadModeRegionName { get { return GetRegionName("ReadModeRegionName"); } } public static string ReadModePageRegionName { get { return GetRegionName("ReadModePageRegionName"); } } public static string OCRViewerRegionName { get { return GetRegionName("OCRViewerRegionName"); } } /// /// 获取MainWindowsViewModel RegionNames字典里的RegionName, /// 如果字典里没有键值就新建一个GUID,并插入到 /// /// 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; } } /// /// 如果不存在key,则插入key,并设置Value /// 如果存在key,则更改Value /// 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; } } } }