RegionNames.cs 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Runtime.CompilerServices;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace PDF_Office.Model
  8. {
  9. /// <summary>
  10. /// 存放公用模块的RegionName
  11. /// 引用名称前 先查一下所有引用 看是否有其他地方引用了同样的名称,同一个页签内的控件不要使用同一个名称
  12. /// </summary>
  13. public static class RegionNames
  14. {
  15. /// <summary>
  16. /// 最外层的Region名称
  17. /// </summary>
  18. public static string MainRegion = "MainRegion";
  19. /// <summary>
  20. /// 首页右侧快捷工具Content RegionName
  21. /// </summary>
  22. public static string ToolRegionName
  23. {
  24. get
  25. {
  26. return GetRegionName("ToolRegionName");
  27. }
  28. }
  29. /// <summary>
  30. /// 阅读页PDFViewer 对应的Content RegionName
  31. /// </summary>
  32. public static string ViwerRegionName
  33. {
  34. get
  35. {
  36. return GetRegionName("ViwerRegionName");
  37. }
  38. }
  39. /// <summary>
  40. /// 阅读页 显示拆分视图整个区域 Content
  41. /// </summary>
  42. public static string Viewer_SplitRegionName
  43. {
  44. get
  45. {
  46. return GetRegionName("Viewer_SplitRegionName");
  47. }
  48. }
  49. /// <summary>
  50. /// 阅读页顶部Tip 对应的Content RegionName
  51. /// </summary>
  52. public static string TipContentRegionName
  53. {
  54. get
  55. {
  56. return GetRegionName("TipContentRegionName");
  57. }
  58. }
  59. public static string LeftTipContentRegionName
  60. {
  61. get
  62. {
  63. return GetRegionName("LeftTipContentRegionName");
  64. }
  65. }
  66. public static string ReadRegionName
  67. {
  68. get
  69. {
  70. return GetRegionName("ReadRegionName");
  71. }
  72. }
  73. /// <summary>
  74. /// 阅读页PDFViewer 对应的Content RegionName
  75. /// </summary>
  76. public static string WatermarkViwerRegionName
  77. {
  78. get
  79. {
  80. return GetRegionName("WatermarkViwerRegionName");
  81. }
  82. }
  83. public static string BackgroundViewerRegionName
  84. {
  85. get
  86. {
  87. return GetRegionName("BackgroundViewerRegionName");
  88. }
  89. }
  90. public static string BatesViewerRegionName
  91. {
  92. get
  93. {
  94. return GetRegionName("BatesViewerRegionName");
  95. }
  96. }
  97. public static string HeaderFooterViewerRegionName
  98. {
  99. get
  100. {
  101. return GetRegionName("HeaderFooterViewerRegionName");
  102. }
  103. }
  104. public static string RedactionViewerRegionName
  105. {
  106. get
  107. {
  108. return GetRegionName("RedactionViewerRegionName");
  109. }
  110. }
  111. /// <summary>
  112. /// BOTA内容项 对应的Content RegionName
  113. /// </summary>
  114. public static string BOTARegionName
  115. {
  116. get
  117. {
  118. return GetRegionName("BOTARegionName");
  119. }
  120. }
  121. /// <summary>
  122. /// 属性面板 对应的Content RegionName
  123. /// </summary>
  124. public static string PropertyRegionName
  125. {
  126. get
  127. {
  128. return GetRegionName("PropertyRegionName");
  129. }
  130. }
  131. /// <summary>
  132. /// 工具功能(页面编辑、水印、密文等)对应的Content RegionName
  133. /// </summary>
  134. public static string ToolContentRegionName
  135. {
  136. get
  137. {
  138. return GetRegionName("ToolContentRegionName");
  139. }
  140. }
  141. /// <summary>
  142. /// 工具菜单栏对应的Content RegionName
  143. /// </summary>
  144. public static string ToolsBarContentRegionName
  145. {
  146. get
  147. {
  148. return GetRegionName("ToolsBarContentRegionName");
  149. }
  150. }
  151. /// <summary>
  152. /// 底部工具栏对应的Content RegionName
  153. /// </summary>
  154. public static string BottomToolRegionName
  155. {
  156. get
  157. {
  158. return GetRegionName("BottomToolRegionName");
  159. }
  160. }
  161. /// <summary>
  162. /// 视图模块-分屏视图
  163. /// </summary>
  164. public static string SplitScreenViewRegionName
  165. {
  166. get
  167. {
  168. return GetRegionName("SplitScreenViewRegionName");
  169. }
  170. }
  171. /// <summary>
  172. /// 视图模块-分屏视图-PDF
  173. /// </summary>
  174. public static string SplitViewRegionName
  175. {
  176. get
  177. {
  178. return GetRegionName("SplitViewRegionName");
  179. }
  180. }
  181. /// <summary>
  182. /// 视图模块-分屏视图-页面控件
  183. /// </summary>
  184. public static string SplitScreenPageRegionName
  185. {
  186. get
  187. {
  188. return GetRegionName("SplitScreenPageRegionName");
  189. }
  190. }
  191. /// <summary>
  192. /// 视图模块-主题颜色
  193. /// </summary>
  194. public static string ThemesContentName
  195. {
  196. get
  197. {
  198. return GetRegionName("ThemesContentName");
  199. }
  200. }
  201. /// <summary>
  202. /// 视图模块-阅读模式
  203. /// </summary>
  204. public static string ReadModeRegionName
  205. {
  206. get
  207. {
  208. return GetRegionName("ReadModeRegionName");
  209. }
  210. }
  211. public static string ReadModePageRegionName
  212. {
  213. get
  214. {
  215. return GetRegionName("ReadModePageRegionName");
  216. }
  217. }
  218. public static string OCRViewerRegionName
  219. {
  220. get
  221. {
  222. return GetRegionName("OCRViewerRegionName");
  223. }
  224. }
  225. /// <summary>
  226. /// 获取MainWindowsViewModel RegionNames字典里的RegionName,
  227. /// 如果字典里没有键值就新建一个GUID,并插入到
  228. /// </summary>
  229. /// <returns></returns>
  230. public static string GetRegionName(string key)
  231. {
  232. if (App.mainWindowViewModel.SelectedItem.RegionContentNames.ContainsKey(key))
  233. {
  234. return App.mainWindowViewModel.SelectedItem.RegionContentNames[key];
  235. }
  236. else
  237. {
  238. string name = Guid.NewGuid().ToString();
  239. App.mainWindowViewModel.SelectedItem.RegionContentNames[key] = name;
  240. return name;
  241. }
  242. }
  243. /// <summary>
  244. /// 如果不存在key,则插入key,并设置Value
  245. /// 如果存在key,则更改Value
  246. /// </summary>
  247. public static void SetRegionName(string key, string Value)
  248. {
  249. if (App.mainWindowViewModel.SelectedItem.RegionContentNames.ContainsKey(key))
  250. {
  251. App.mainWindowViewModel.SelectedItem.RegionContentNames[key] = Value;
  252. }
  253. else
  254. {
  255. App.mainWindowViewModel.SelectedItem.RegionContentNames[key] = Value;
  256. }
  257. }
  258. }
  259. }