123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231 |
- using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
- using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs;
- using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
- using Prism.Ioc;
- using Prism.Regions;
- using System.Windows.Controls;
- namespace PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
- {
- /// <summary>
- /// Interaction logic for HomePageBatchProcessingDialog
- /// </summary>
- public partial class HomePageBatchProcessingDialog : UserControl
- {
- private IContainerProvider containerProvider;
- public HomePageBatchProcessingDialog(IContainerProvider containerProvider)
- {
-
- InitializeComponent();
- this.containerProvider = containerProvider;
- var regionManager = containerProvider.Resolve<IRegionManager>();
- RegionManager.SetRegionManager(this, regionManager);
- RegionManager.UpdateRegions();
- SetPathVisibility(HomePageBatchProcessingDialogModel.BatchProcessingIndex);
- }
- public void SetPathVisibility(int index) {
- this.BatesPath.Visibility = System.Windows.Visibility.Hidden;
- this.SecurityPath.Visibility = System.Windows.Visibility.Hidden;
- this.ShiftingPath.Visibility = System.Windows.Visibility.Hidden;
- this.WatermarkPath.Visibility = System.Windows.Visibility.Hidden;
- this.HeaderFooterPath.Visibility = System.Windows.Visibility.Hidden;
- this.BackgroundPath.Visibility = System.Windows.Visibility.Hidden;
- this.CompressPath.Visibility = System.Windows.Visibility.Hidden;
- this.RemoveSecurityPath.Visibility = System.Windows.Visibility.Hidden;
- switch (index) {
- case 0:
- this.ShiftingPath.Visibility = System.Windows.Visibility.Visible;
- break;
- case 1:
- this.CompressPath.Visibility = System.Windows.Visibility.Visible;
- break;
- case 2:
- this.SecurityPath.Visibility = System.Windows.Visibility.Visible;
- break;
- case 3:
- this.WatermarkPath.Visibility = System.Windows.Visibility.Visible;
- break;
- case 4:
- this.BackgroundPath.Visibility = System.Windows.Visibility.Visible;
- break;
- case 5:
- this.HeaderFooterPath.Visibility = System.Windows.Visibility.Visible;
- break;
- case 6:
- this.BatesPath.Visibility = System.Windows.Visibility.Visible;
- break;
- case 7:
- this.RemoveSecurityPath.Visibility = System.Windows.Visibility.Visible;
- break;
- }
- }
- private void Btn_Click(object sender, System.Windows.RoutedEventArgs e)
- {
- var btn = sender as Button;
- if (btn != null) {
- switch (btn.Name.ToString())
- {
- case "BatesBtn":
- this.BatesBtn.IsEnabled = false;
- this.SecurityBtn.IsEnabled = true;
- this.ShiftingBtn.IsEnabled = true;
- this.WatermarkBtn.IsEnabled = true;
- this.HeaderFooterBtn.IsEnabled = true;
- this.BackgroundBtn.IsEnabled = true;
- this.CompressBtn.IsEnabled = true;
- this.RemoveSecurityBtn.IsEnabled = true;
- this.BatesPath.Visibility = System.Windows.Visibility.Visible;
- this.SecurityPath.Visibility = System.Windows.Visibility.Hidden;
- this.ShiftingPath.Visibility = System.Windows.Visibility.Hidden;
- this.WatermarkPath.Visibility = System.Windows.Visibility.Hidden;
- this.HeaderFooterPath.Visibility = System.Windows.Visibility.Hidden;
- this.BackgroundPath.Visibility = System.Windows.Visibility.Hidden;
- this.CompressPath.Visibility = System.Windows.Visibility.Hidden;
- this.RemoveSecurityPath.Visibility = System.Windows.Visibility.Hidden;
- break;
- case "SecurityBtn":
- this.BatesBtn.IsEnabled =true;
- this.SecurityBtn.IsEnabled = false;
- this.ShiftingBtn.IsEnabled = true;
- this.WatermarkBtn.IsEnabled = true;
- this.HeaderFooterBtn.IsEnabled = true;
- this.BackgroundBtn.IsEnabled = true;
- this.CompressBtn.IsEnabled = true;
- this.RemoveSecurityBtn.IsEnabled = true;
- this.BatesPath.Visibility = System.Windows.Visibility.Hidden;
- this.SecurityPath.Visibility = System.Windows.Visibility.Visible;
- this.ShiftingPath.Visibility = System.Windows.Visibility.Hidden;
- this.WatermarkPath.Visibility = System.Windows.Visibility.Hidden;
- this.HeaderFooterPath.Visibility = System.Windows.Visibility.Hidden;
- this.BackgroundPath.Visibility = System.Windows.Visibility.Hidden;
- this.CompressPath.Visibility = System.Windows.Visibility.Hidden;
- this.RemoveSecurityPath.Visibility = System.Windows.Visibility.Hidden;
- break;
-
- case "ShiftingBtn":
- this.BatesBtn.IsEnabled = true;
- this.SecurityBtn.IsEnabled = true;
- this.ShiftingBtn.IsEnabled = false;
- this.WatermarkBtn.IsEnabled = true;
- this.HeaderFooterBtn.IsEnabled = true;
- this.BackgroundBtn.IsEnabled = true;
- this.CompressBtn.IsEnabled = true;
- this.RemoveSecurityBtn.IsEnabled = true;
- this.BatesPath.Visibility = System.Windows.Visibility.Hidden;
- this.SecurityPath.Visibility = System.Windows.Visibility.Hidden;
- this.ShiftingPath.Visibility = System.Windows.Visibility.Visible;
- this.WatermarkPath.Visibility = System.Windows.Visibility.Hidden;
- this.HeaderFooterPath.Visibility = System.Windows.Visibility.Hidden;
- this.BackgroundPath.Visibility = System.Windows.Visibility.Hidden;
- this.CompressPath.Visibility = System.Windows.Visibility.Hidden;
- this.RemoveSecurityPath.Visibility = System.Windows.Visibility.Hidden;
- break;
- case "WatermarkBtn":
- this.BatesBtn.IsEnabled = true;
- this.SecurityBtn.IsEnabled = true;
- this.ShiftingBtn.IsEnabled = true;
- this.WatermarkBtn.IsEnabled = false;
- this.HeaderFooterBtn.IsEnabled = true;
- this.BackgroundBtn.IsEnabled = true;
- this.CompressBtn.IsEnabled = true;
- this.RemoveSecurityBtn.IsEnabled = true;
- this.BatesPath.Visibility = System.Windows.Visibility.Hidden;
- this.SecurityPath.Visibility = System.Windows.Visibility.Hidden;
- this.ShiftingPath.Visibility = System.Windows.Visibility.Hidden;
- this.WatermarkPath.Visibility = System.Windows.Visibility.Visible;
- this.HeaderFooterPath.Visibility = System.Windows.Visibility.Hidden;
- this.BackgroundPath.Visibility = System.Windows.Visibility.Hidden;
- this.CompressPath.Visibility = System.Windows.Visibility.Hidden;
- this.RemoveSecurityPath.Visibility = System.Windows.Visibility.Hidden;
- break;
- case "HeaderFooterBtn":
- this.BatesBtn.IsEnabled = true;
- this.SecurityBtn.IsEnabled = true;
- this.ShiftingBtn.IsEnabled = true;
- this.WatermarkBtn.IsEnabled = true;
- this.HeaderFooterBtn.IsEnabled = false;
- this.BackgroundBtn.IsEnabled = true;
- this.CompressBtn.IsEnabled = true;
- this.RemoveSecurityBtn.IsEnabled = true;
- this.BatesPath.Visibility = System.Windows.Visibility.Hidden;
- this.SecurityPath.Visibility = System.Windows.Visibility.Hidden;
- this.ShiftingPath.Visibility = System.Windows.Visibility.Hidden;
- this.WatermarkPath.Visibility = System.Windows.Visibility.Hidden;
- this.HeaderFooterPath.Visibility = System.Windows.Visibility.Visible;
- this.BackgroundPath.Visibility = System.Windows.Visibility.Hidden;
- this.CompressPath.Visibility = System.Windows.Visibility.Hidden;
- this.RemoveSecurityPath.Visibility = System.Windows.Visibility.Hidden;
- break;
- case "BackgroundBtn":
- this.BatesBtn.IsEnabled = true;
- this.SecurityBtn.IsEnabled = true;
- this.ShiftingBtn.IsEnabled = true;
- this.WatermarkBtn.IsEnabled = true;
- this.HeaderFooterBtn.IsEnabled = true;
- this.BackgroundBtn.IsEnabled = false;
- this.CompressBtn.IsEnabled = true;
- this.RemoveSecurityBtn.IsEnabled = true;
- this.BatesPath.Visibility = System.Windows.Visibility.Hidden;
- this.SecurityPath.Visibility = System.Windows.Visibility.Hidden;
- this.ShiftingPath.Visibility = System.Windows.Visibility.Hidden;
- this.WatermarkPath.Visibility = System.Windows.Visibility.Hidden;
- this.HeaderFooterPath.Visibility = System.Windows.Visibility.Hidden;
- this.BackgroundPath.Visibility = System.Windows.Visibility.Visible;
- this.CompressPath.Visibility = System.Windows.Visibility.Hidden;
- this.RemoveSecurityPath.Visibility = System.Windows.Visibility.Hidden;
- break;
- case "CompressBtn":
- this.BatesBtn.IsEnabled = true;
- this.SecurityBtn.IsEnabled = true;
- this.ShiftingBtn.IsEnabled = true;
- this.WatermarkBtn.IsEnabled = true;
- this.HeaderFooterBtn.IsEnabled = true;
- this.BackgroundBtn.IsEnabled = true;
- this.CompressBtn.IsEnabled = false;
- this.RemoveSecurityBtn.IsEnabled = true;
- this.BatesPath.Visibility = System.Windows.Visibility.Hidden;
- this.SecurityPath.Visibility = System.Windows.Visibility.Hidden;
- this.ShiftingPath.Visibility = System.Windows.Visibility.Hidden;
- this.WatermarkPath.Visibility = System.Windows.Visibility.Hidden;
- this.HeaderFooterPath.Visibility = System.Windows.Visibility.Hidden;
- this.BackgroundPath.Visibility = System.Windows.Visibility.Hidden;
- this.CompressPath.Visibility = System.Windows.Visibility.Visible;
- this.RemoveSecurityPath.Visibility = System.Windows.Visibility.Hidden;
- break;
- case "RemoveSecurityBtn":
- this.BatesBtn.IsEnabled = true;
- this.SecurityBtn.IsEnabled = true;
- this.ShiftingBtn.IsEnabled = true;
- this.WatermarkBtn.IsEnabled = true;
- this.HeaderFooterBtn.IsEnabled = true;
- this.BackgroundBtn.IsEnabled = true;
- this.CompressBtn.IsEnabled = true;
- this.RemoveSecurityBtn.IsEnabled = false;
- this.BatesPath.Visibility = System.Windows.Visibility.Hidden;
- this.SecurityPath.Visibility = System.Windows.Visibility.Hidden;
- this.ShiftingPath.Visibility = System.Windows.Visibility.Hidden;
- this.WatermarkPath.Visibility = System.Windows.Visibility.Hidden;
- this.HeaderFooterPath.Visibility = System.Windows.Visibility.Hidden;
- this.BackgroundPath.Visibility = System.Windows.Visibility.Hidden;
- this.CompressPath.Visibility = System.Windows.Visibility.Hidden;
- this.RemoveSecurityPath.Visibility = System.Windows.Visibility.Visible;
- break;
- }
-
-
- }
- }
- }
- }
|