using ComPDFKit_Conversion.Converter;
using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter;
using System.Diagnostics;
using System.Windows.Controls;

namespace PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
{
    /// <summary>
    /// Interaction logic for HomePageConverterImg
    /// </summary>
    public partial class HomePageConverterImg : UserControl
    {
        public HomePageConverterImg()
        {
            InitializeComponent();
        }

        private void ImageTypeComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (((HomePageConverterImgViewModel)this.DataContext).homePageConverterDialogViewModel==null)
                return;
            switch (ImageTypeComboBox.SelectedIndex)
            {
                case 0:
                    ((HomePageConverterImgViewModel)this.DataContext).homePageConverterDialogViewModel.ConverterImgModel.Type = ImgType.JPEG;
                    break;
                case 1:
                    ((HomePageConverterImgViewModel)this.DataContext).homePageConverterDialogViewModel.ConverterImgModel.Type = ImgType.JPEG;
                    break;
                case 2:
                    ((HomePageConverterImgViewModel)this.DataContext).homePageConverterDialogViewModel.ConverterImgModel.Type = ImgType.PNG;
                    break;
                case 3:
                    ((HomePageConverterImgViewModel)this.DataContext).homePageConverterDialogViewModel.ConverterImgModel.Type = ImgType.JPEG;
                    break;
                case 4:
                    ((HomePageConverterImgViewModel)this.DataContext).homePageConverterDialogViewModel.ConverterImgModel.Type = ImgType.JPEG;
                    break;
                case 5:
                    ((HomePageConverterImgViewModel)this.DataContext).homePageConverterDialogViewModel.ConverterImgModel.Type = ImgType.JPEG;
                    break;
                case 6:
                    ((HomePageConverterImgViewModel)this.DataContext).homePageConverterDialogViewModel.ConverterImgModel.Type = ImgType.JPEG;
                    break;
                case 7:
                    ((HomePageConverterImgViewModel)this.DataContext).homePageConverterDialogViewModel.ConverterImgModel.Type = ImgType.JPEG;
                    break;
                default:
                    break;
            }
        }
        private void ImageDPIComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            switch (ImageDPIComboBox.SelectedIndex)
            {
                case 0:
                    Trace.WriteLine("50");
                    break;
                case 1:
                    Trace.WriteLine("72");
                    break;
                case 2:
                    Trace.WriteLine("96");
                    break;
                case 3:
                    Trace.WriteLine("150");
                    break;
                case 4:
                    Trace.WriteLine("300");
                    break;
                case 5:
                    Trace.WriteLine("600");
                    break;
                default:
                    break;
            }
        }
    }
}
