HomePageBatchProcessingDialog.xaml.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
  2. using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs;
  3. using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
  4. using Prism.Ioc;
  5. using Prism.Regions;
  6. using System.Windows.Controls;
  7. namespace PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
  8. {
  9. /// <summary>
  10. /// Interaction logic for HomePageBatchProcessingDialog
  11. /// </summary>
  12. public partial class HomePageBatchProcessingDialog : UserControl
  13. {
  14. private IContainerProvider containerProvider;
  15. public HomePageBatchProcessingDialog(IContainerProvider containerProvider)
  16. {
  17. InitializeComponent();
  18. this.containerProvider = containerProvider;
  19. var regionManager = containerProvider.Resolve<IRegionManager>();
  20. RegionManager.SetRegionManager(this, regionManager);
  21. RegionManager.UpdateRegions();
  22. SetPathVisibility(HomePageBatchProcessingDialogModel.BatchProcessingIndex);
  23. }
  24. public void SetPathVisibility(int index) {
  25. this.BatesPath.Visibility = System.Windows.Visibility.Hidden;
  26. this.SecurityPath.Visibility = System.Windows.Visibility.Hidden;
  27. this.ShiftingPath.Visibility = System.Windows.Visibility.Hidden;
  28. this.WatermarkPath.Visibility = System.Windows.Visibility.Hidden;
  29. this.HeaderFooterPath.Visibility = System.Windows.Visibility.Hidden;
  30. this.BackgroundPath.Visibility = System.Windows.Visibility.Hidden;
  31. this.CompressPath.Visibility = System.Windows.Visibility.Hidden;
  32. this.RemoveSecurityPath.Visibility = System.Windows.Visibility.Hidden;
  33. switch (index) {
  34. case 0:
  35. this.ShiftingPath.Visibility = System.Windows.Visibility.Visible;
  36. break;
  37. case 1:
  38. this.CompressPath.Visibility = System.Windows.Visibility.Visible;
  39. break;
  40. case 2:
  41. this.SecurityPath.Visibility = System.Windows.Visibility.Visible;
  42. break;
  43. case 3:
  44. this.WatermarkPath.Visibility = System.Windows.Visibility.Visible;
  45. break;
  46. case 4:
  47. this.BackgroundPath.Visibility = System.Windows.Visibility.Visible;
  48. break;
  49. case 5:
  50. this.HeaderFooterPath.Visibility = System.Windows.Visibility.Visible;
  51. break;
  52. case 6:
  53. this.BatesPath.Visibility = System.Windows.Visibility.Visible;
  54. break;
  55. case 7:
  56. this.RemoveSecurityPath.Visibility = System.Windows.Visibility.Visible;
  57. break;
  58. }
  59. }
  60. private void Btn_Click(object sender, System.Windows.RoutedEventArgs e)
  61. {
  62. var btn = sender as Button;
  63. if (btn != null) {
  64. switch (btn.Name.ToString())
  65. {
  66. case "BatesBtn":
  67. this.BatesBtn.IsEnabled = false;
  68. this.SecurityBtn.IsEnabled = true;
  69. this.ShiftingBtn.IsEnabled = true;
  70. this.WatermarkBtn.IsEnabled = true;
  71. this.HeaderFooterBtn.IsEnabled = true;
  72. this.BackgroundBtn.IsEnabled = true;
  73. this.CompressBtn.IsEnabled = true;
  74. this.RemoveSecurityBtn.IsEnabled = true;
  75. this.BatesPath.Visibility = System.Windows.Visibility.Visible;
  76. this.SecurityPath.Visibility = System.Windows.Visibility.Hidden;
  77. this.ShiftingPath.Visibility = System.Windows.Visibility.Hidden;
  78. this.WatermarkPath.Visibility = System.Windows.Visibility.Hidden;
  79. this.HeaderFooterPath.Visibility = System.Windows.Visibility.Hidden;
  80. this.BackgroundPath.Visibility = System.Windows.Visibility.Hidden;
  81. this.CompressPath.Visibility = System.Windows.Visibility.Hidden;
  82. this.RemoveSecurityPath.Visibility = System.Windows.Visibility.Hidden;
  83. break;
  84. case "SecurityBtn":
  85. this.BatesBtn.IsEnabled =true;
  86. this.SecurityBtn.IsEnabled = false;
  87. this.ShiftingBtn.IsEnabled = true;
  88. this.WatermarkBtn.IsEnabled = true;
  89. this.HeaderFooterBtn.IsEnabled = true;
  90. this.BackgroundBtn.IsEnabled = true;
  91. this.CompressBtn.IsEnabled = true;
  92. this.RemoveSecurityBtn.IsEnabled = true;
  93. this.BatesPath.Visibility = System.Windows.Visibility.Hidden;
  94. this.SecurityPath.Visibility = System.Windows.Visibility.Visible;
  95. this.ShiftingPath.Visibility = System.Windows.Visibility.Hidden;
  96. this.WatermarkPath.Visibility = System.Windows.Visibility.Hidden;
  97. this.HeaderFooterPath.Visibility = System.Windows.Visibility.Hidden;
  98. this.BackgroundPath.Visibility = System.Windows.Visibility.Hidden;
  99. this.CompressPath.Visibility = System.Windows.Visibility.Hidden;
  100. this.RemoveSecurityPath.Visibility = System.Windows.Visibility.Hidden;
  101. break;
  102. case "ShiftingBtn":
  103. this.BatesBtn.IsEnabled = true;
  104. this.SecurityBtn.IsEnabled = true;
  105. this.ShiftingBtn.IsEnabled = false;
  106. this.WatermarkBtn.IsEnabled = true;
  107. this.HeaderFooterBtn.IsEnabled = true;
  108. this.BackgroundBtn.IsEnabled = true;
  109. this.CompressBtn.IsEnabled = true;
  110. this.RemoveSecurityBtn.IsEnabled = true;
  111. this.BatesPath.Visibility = System.Windows.Visibility.Hidden;
  112. this.SecurityPath.Visibility = System.Windows.Visibility.Hidden;
  113. this.ShiftingPath.Visibility = System.Windows.Visibility.Visible;
  114. this.WatermarkPath.Visibility = System.Windows.Visibility.Hidden;
  115. this.HeaderFooterPath.Visibility = System.Windows.Visibility.Hidden;
  116. this.BackgroundPath.Visibility = System.Windows.Visibility.Hidden;
  117. this.CompressPath.Visibility = System.Windows.Visibility.Hidden;
  118. this.RemoveSecurityPath.Visibility = System.Windows.Visibility.Hidden;
  119. break;
  120. case "WatermarkBtn":
  121. this.BatesBtn.IsEnabled = true;
  122. this.SecurityBtn.IsEnabled = true;
  123. this.ShiftingBtn.IsEnabled = true;
  124. this.WatermarkBtn.IsEnabled = false;
  125. this.HeaderFooterBtn.IsEnabled = true;
  126. this.BackgroundBtn.IsEnabled = true;
  127. this.CompressBtn.IsEnabled = true;
  128. this.RemoveSecurityBtn.IsEnabled = true;
  129. this.BatesPath.Visibility = System.Windows.Visibility.Hidden;
  130. this.SecurityPath.Visibility = System.Windows.Visibility.Hidden;
  131. this.ShiftingPath.Visibility = System.Windows.Visibility.Hidden;
  132. this.WatermarkPath.Visibility = System.Windows.Visibility.Visible;
  133. this.HeaderFooterPath.Visibility = System.Windows.Visibility.Hidden;
  134. this.BackgroundPath.Visibility = System.Windows.Visibility.Hidden;
  135. this.CompressPath.Visibility = System.Windows.Visibility.Hidden;
  136. this.RemoveSecurityPath.Visibility = System.Windows.Visibility.Hidden;
  137. break;
  138. case "HeaderFooterBtn":
  139. this.BatesBtn.IsEnabled = true;
  140. this.SecurityBtn.IsEnabled = true;
  141. this.ShiftingBtn.IsEnabled = true;
  142. this.WatermarkBtn.IsEnabled = true;
  143. this.HeaderFooterBtn.IsEnabled = false;
  144. this.BackgroundBtn.IsEnabled = true;
  145. this.CompressBtn.IsEnabled = true;
  146. this.RemoveSecurityBtn.IsEnabled = true;
  147. this.BatesPath.Visibility = System.Windows.Visibility.Hidden;
  148. this.SecurityPath.Visibility = System.Windows.Visibility.Hidden;
  149. this.ShiftingPath.Visibility = System.Windows.Visibility.Hidden;
  150. this.WatermarkPath.Visibility = System.Windows.Visibility.Hidden;
  151. this.HeaderFooterPath.Visibility = System.Windows.Visibility.Visible;
  152. this.BackgroundPath.Visibility = System.Windows.Visibility.Hidden;
  153. this.CompressPath.Visibility = System.Windows.Visibility.Hidden;
  154. this.RemoveSecurityPath.Visibility = System.Windows.Visibility.Hidden;
  155. break;
  156. case "BackgroundBtn":
  157. this.BatesBtn.IsEnabled = true;
  158. this.SecurityBtn.IsEnabled = true;
  159. this.ShiftingBtn.IsEnabled = true;
  160. this.WatermarkBtn.IsEnabled = true;
  161. this.HeaderFooterBtn.IsEnabled = true;
  162. this.BackgroundBtn.IsEnabled = false;
  163. this.CompressBtn.IsEnabled = true;
  164. this.RemoveSecurityBtn.IsEnabled = true;
  165. this.BatesPath.Visibility = System.Windows.Visibility.Hidden;
  166. this.SecurityPath.Visibility = System.Windows.Visibility.Hidden;
  167. this.ShiftingPath.Visibility = System.Windows.Visibility.Hidden;
  168. this.WatermarkPath.Visibility = System.Windows.Visibility.Hidden;
  169. this.HeaderFooterPath.Visibility = System.Windows.Visibility.Hidden;
  170. this.BackgroundPath.Visibility = System.Windows.Visibility.Visible;
  171. this.CompressPath.Visibility = System.Windows.Visibility.Hidden;
  172. this.RemoveSecurityPath.Visibility = System.Windows.Visibility.Hidden;
  173. break;
  174. case "CompressBtn":
  175. this.BatesBtn.IsEnabled = true;
  176. this.SecurityBtn.IsEnabled = true;
  177. this.ShiftingBtn.IsEnabled = true;
  178. this.WatermarkBtn.IsEnabled = true;
  179. this.HeaderFooterBtn.IsEnabled = true;
  180. this.BackgroundBtn.IsEnabled = true;
  181. this.CompressBtn.IsEnabled = false;
  182. this.RemoveSecurityBtn.IsEnabled = true;
  183. this.BatesPath.Visibility = System.Windows.Visibility.Hidden;
  184. this.SecurityPath.Visibility = System.Windows.Visibility.Hidden;
  185. this.ShiftingPath.Visibility = System.Windows.Visibility.Hidden;
  186. this.WatermarkPath.Visibility = System.Windows.Visibility.Hidden;
  187. this.HeaderFooterPath.Visibility = System.Windows.Visibility.Hidden;
  188. this.BackgroundPath.Visibility = System.Windows.Visibility.Hidden;
  189. this.CompressPath.Visibility = System.Windows.Visibility.Visible;
  190. this.RemoveSecurityPath.Visibility = System.Windows.Visibility.Hidden;
  191. break;
  192. case "RemoveSecurityBtn":
  193. this.BatesBtn.IsEnabled = true;
  194. this.SecurityBtn.IsEnabled = true;
  195. this.ShiftingBtn.IsEnabled = true;
  196. this.WatermarkBtn.IsEnabled = true;
  197. this.HeaderFooterBtn.IsEnabled = true;
  198. this.BackgroundBtn.IsEnabled = true;
  199. this.CompressBtn.IsEnabled = true;
  200. this.RemoveSecurityBtn.IsEnabled = false;
  201. this.BatesPath.Visibility = System.Windows.Visibility.Hidden;
  202. this.SecurityPath.Visibility = System.Windows.Visibility.Hidden;
  203. this.ShiftingPath.Visibility = System.Windows.Visibility.Hidden;
  204. this.WatermarkPath.Visibility = System.Windows.Visibility.Hidden;
  205. this.HeaderFooterPath.Visibility = System.Windows.Visibility.Hidden;
  206. this.BackgroundPath.Visibility = System.Windows.Visibility.Hidden;
  207. this.CompressPath.Visibility = System.Windows.Visibility.Hidden;
  208. this.RemoveSecurityPath.Visibility = System.Windows.Visibility.Visible;
  209. break;
  210. }
  211. }
  212. }
  213. }
  214. }