/// <summary>
 /// Constructs and updates the Printing Preference Controls
 /// </summary>
 /// <param name="printerPreferenceData"></param>
 public PrinterPreferencesForm(PrinterPreferenceData printerPreferenceData)
 {
     InitializeComponent();
     PrinterPreferenceData = printerPreferenceData;
     LoadPrinterPreferencesComboBoxValues();
     UpdatePrinterPreferences(PrinterPreferenceData);
     fieldValidator.RequireValue(customPaperSizeName_TextBox, customPaperSizeName_Label, ValidationCondition.IfEnabled);
     fieldValidator.RequireValue(customWaterMark_TextBox, customWaterMark_Label, ValidationCondition.IfEnabled);
 }
Esempio n. 2
0
 private void printingPreferences_Button_Click(object sender, EventArgs e)
 {
     using (_printingPreferences = new PrinterPreferencesForm(_printerPreferenceData))
     {
         if (_printingPreferences.ShowDialog() == DialogResult.OK)
         {
             _printerPreferenceData = _printingPreferences.PrinterPreferenceData;
         }
     }
 }
Esempio n. 3
0
        private void EffectsTab(PrinterPreferenceData printerPreferenceData, PrintPreferences printPreferences)
        {
            //Effects Tab
            if (printPreferences.EffectsTabItemETabItem.IsVisible())
            {
                UpdateStatus("The Effect Tab operations begins");
                printPreferences.EffectsTabItemETabItem.PerformHumanAction(x => x.ClickWithMouse(shortTimeout));
                if (printerPreferenceData.ActualSize)
                {
                    printPreferences.ActualsizeRadioRadioButton.PerformHumanAction(x => x.ClickWithMouse(shortTimeout));
                    UpdateStatus("The Actual Size option is selected");
                }
                else if (printerPreferenceData.PrintDocumentOn)
                {
                    printPreferences.PrintdocumentonRadioButton.PerformHumanAction(x => x.ClickWithMouse(shortTimeout));
                    UpdateStatus("The Print Documents On option is selected");
                    TopCatUiHelper.ComboBoxSetValue(printPreferences.ComboBoxcboPrinComboBox, printerPreferenceData.PrintDocumentOnValue, shortTimeout);
                    if (printerPreferenceData.ScaleToFit)
                    {
                        printPreferences.ScaletofitCheckCheckBox.PerformHumanAction(x => x.Check(shortTimeout));
                        UpdateStatus("The Scale to Fit option is enabled");
                    }
                    else
                    {
                        printPreferences.ScaletofitCheckCheckBox.PerformHumanAction(x => x.Uncheck(shortTimeout));
                    }
                }
                else
                {
                    printPreferences.ofactualsizeRadRadioButton.PerformHumanAction(x => x.ClickWithMouse(shortTimeout));
                    UpdateStatus("The Percentage of Actual Size option is selected");
                    printPreferences.TextBoxedZoomEdit.PerformHumanAction(x => x.EnterText(printerPreferenceData.PerActualSizeNo, shortTimeout));
                    UpdateStatus($"The Actual Size value {printerPreferenceData.PerActualSizeNo} is set");
                }

                TopCatUiHelper.ComboBoxSetValue(printPreferences.ComboBoxcboWateComboBox, printerPreferenceData.Watermark, shortTimeout);
                UpdateStatus($"The Watermark option {printerPreferenceData.Watermark} is set");
                if (printerPreferenceData.Watermark != WaterMark.none.GetDescription())
                {
                    if (printerPreferenceData.FirstPageOnly)
                    {
                        printPreferences.FirstpageonlyChCheckBox.PerformHumanAction(x => x.Check(shortTimeout));
                        UpdateStatus("The First Page Only option is enabled");
                    }
                    else
                    {
                        printPreferences.FirstpageonlyChCheckBox.PerformHumanAction(x => x.Uncheck(shortTimeout));
                    }
                }
                UpdateStatus("The Effect Tab operations ends");
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Sets the driver settings using Topcat.
        /// </summary>
        /// <param name="printerPreferenceData"></param>
        /// <param name="queueName"></param>
        public void ConfigureDriverSettings(PrinterPreferenceData printerPreferenceData, string queueName)
        {
            TopCatUIAutomation.Initialize();

            //Launching the Printer preferences Window
            UpdateStatus("Launching the Printer preferences Window");
            Process launch  = new Process();
            string  command = $"/c rundll32 printui.dll,PrintUIEntry /e /n \"{queueName}\"";

            launch.StartInfo.Arguments       = command;
            launch.StartInfo.Verb            = "runas";
            launch.StartInfo.FileName        = "cmd.exe";
            launch.StartInfo.CreateNoWindow  = true;
            launch.StartInfo.UseShellExecute = false;
            launch.Start();
            PrintPreferences printPreferences = new PrintPreferences(queueName);

            if (printPreferences.DriverWindow.IsAvailable(screenWaitTimeout))
            {
                UpdateStatus("The Printer preferences window has been Launched");
                PaperQualityTab(printerPreferenceData, printPreferences);
                EffectsTab(printerPreferenceData, printPreferences);
                FinishingTab(printerPreferenceData, printPreferences);
                OutputTab(printerPreferenceData, printPreferences);
                JobStorageTab(printerPreferenceData, printPreferences);
                ColorTab(printerPreferenceData, printPreferences);
                AdvanceTab(printerPreferenceData, printPreferences);
                printPreferences.OKButtonOkButton.WaitForAvailable(windowsTimeout);
                printPreferences.OKButtonOkButton.PerformHumanAction(x => x.Click(windowsTimeout));
                //handling selections conflicts popup window
                if (printPreferences.SelectionsconflWindow.IsEnabled(windowsTimeout))
                {
                    printPreferences.YesButton6Button.PerformHumanAction(x => x.ClickWithMouse(MouseButton.Left, windowsTimeout));
                }
            }
            else
            {
                throw new ArgumentException("The Queue name is not valid");
            }
        }
Esempio n. 5
0
 private void ConfigureControls(DriverConfigurationPrintActivityData data)
 {
     shuffle_CheckBox.Checked      = data.ShuffleDocuments;
     jobseparator_checkBox.Checked = data.PrintJobSeparator;
     _printerPreferenceData        = data.PrinterPreference;
 }
Esempio n. 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DriverConfigurationPrintActivityData"/> class
 /// </summary>
 public DriverConfigurationPrintActivityData()
 {
     PrinterPreference = new PrinterPreferenceData();
 }
 /// <summary>
 /// Updates the values on Printing Preference UI. This method is responsible for setting
 /// the Printing Preference UI values from the saved configurations.
 /// </summary>
 /// <param name="_printerPreferenceData"></param>
 public void UpdatePrinterPreferences(PrinterPreferenceData printerPreferenceData)
 {
     if (printerPreferenceData != null)
     {
         // Paper Quality Tab
         if (PrinterPreferenceData.EnableCustomPaperSize)
         {
             enableCustomName_CheckBox.Checked = PrinterPreferenceData.EnableCustomPaperSize;
             customPaperSizeName_TextBox.Text  = printerPreferenceData.PaperSize = printerPreferenceData.CustomPaperSizeName;
         }
         else
         {
             enableCustomName_CheckBox.Checked = PrinterPreferenceData.EnableCustomPaperSize;
             paperSize_ComboBox.SelectedIndex  = paperSize_ComboBox.FindStringExact(printerPreferenceData.PaperSize);
         }
         paperQuality_ComboBox.SelectedIndex = paperQuality_ComboBox.FindStringExact(printerPreferenceData.PrintQuality.GetDescription());
         paperType_ComboBox.SelectedIndex    = paperType_ComboBox.FindStringExact(printerPreferenceData.PaperType);
         paperSource_ComboBox.SelectedIndex  = paperSource_ComboBox.FindString(printerPreferenceData.PaperSource);
         specialPages_ComboBox.SelectedIndex = specialPages_ComboBox.FindStringExact(PrinterPreferenceData.SpecialPages.GetDescription());
         //Effects Tab
         actualSize_RadioButton.Checked       = printerPreferenceData.ActualSize ? true : false;
         printDocumentOn_RadioButton.Checked  = printerPreferenceData.PrintDocumentOn ? true : false;
         printDocument_ComboBox.SelectedIndex = printDocument_ComboBox.FindStringExact(printerPreferenceData.PrintDocumentOnValue);
         scaleToFit_CheckBox.Checked          = printerPreferenceData.ScaleToFit ? true : false;
         perOnActualSize_RadioButton.Checked  = printerPreferenceData.PerActualSize ? true : false;
         percentage_TextBox.Text = string.IsNullOrEmpty(printerPreferenceData.PerActualSizeNo) ? "100" : printerPreferenceData.PerActualSizeNo;
         if (printerPreferenceData.EnableCustomWaterMark)
         {
             enableCustomWatermark_CheckBox.Checked = PrinterPreferenceData.EnableCustomWaterMark;
             customWaterMark_TextBox.Text           = printerPreferenceData.Watermark = printerPreferenceData.CustomWaterMarkName;
         }
         else
         {
             enableCustomWatermark_CheckBox.Checked = PrinterPreferenceData.EnableCustomWaterMark;
             watermarks_ComboBox.SelectedIndex      = watermarks_ComboBox.FindStringExact(printerPreferenceData.Watermark);
         }
         firstPageOnly_CheckBox.Checked = printerPreferenceData.FirstPageOnly ? true : false;
         // Finishing Tab
         printOnBothSides_CheckBox.Checked = printerPreferenceData.PrintOnBothSides ? true : false;
         if (!printerPreferenceData.PrintOnBothSides)
         {
             CheckPrintOnBothSidesDisable();
         }
         flipPagesUp_CheckBox.Checked         = printerPreferenceData.FlipPagesUp ? true : false;
         bookletLayout_ComboBox.SelectedIndex = bookletLayout_ComboBox.FindStringExact(printerPreferenceData.BookletLayout);
         pagesPerSheet_ComboBox.SelectedIndex = pagesPerSheet_ComboBox.FindStringExact(printerPreferenceData.PagesPerSheet.GetDescription());
         printPageBorders_CheckBox.Checked    = printerPreferenceData.PrintPageBorders ? true : false;
         pageOrder_ComboBox.SelectedIndex     = pageOrder_ComboBox.FindStringExact(printerPreferenceData.PageOrder.GetDescription());
         portrait_RadioButton.Checked         = printerPreferenceData.OrientationPortrait ? true : false;
         landscape_RadioButton.Checked        = printerPreferenceData.OrientationLanscape ? true : false;
         rotateBy180Degrees_CheckBox.Checked  = printerPreferenceData.RotateBy180Degree ? true : false;
         // Output tab
         staple_ComboBox.SelectedIndex    = staple_ComboBox.FindStringExact(printerPreferenceData.Staple.GetDescription());
         punch_ComboBox.SelectedIndex     = punch_ComboBox.FindStringExact(printerPreferenceData.Punch.GetDescription());
         fold_ComboBox.SelectedIndex      = fold_ComboBox.FindStringExact(printerPreferenceData.Fold.GetDescription());
         maxSheetPerSet_TextBox.Text      = string.IsNullOrEmpty(PrinterPreferenceData.MaxSheetPerSet) ? "1" : printerPreferenceData.MaxSheetPerSet;
         outputBin_ComboBox.SelectedIndex = outputBin_ComboBox.FindStringExact(printerPreferenceData.OutputBin);
         // Job Storage
         off_RadioButton.Checked          = printerPreferenceData.JobStorageOff ? true : false;
         proofAndHold_RadioButton.Checked = printerPreferenceData.ProofandHold ? true : false;
         personalJob_RadioButton.Checked  = printerPreferenceData.PersonalJob ? true : false;
         storedJob_RadioButton.Checked    = printerPreferenceData.StoredJob ? true : false;
         quickCopy_RadioButton.Checked    = printerPreferenceData.QuickJob ? true : false;
         makeJob_ComboBox.SelectedIndex   = makeJob_ComboBox.FindStringExact(printerPreferenceData.MakeJobPrivateSecure);
         makeJob_ComboBox.SelectedIndex   = makeJob_ComboBox.FindStringExact(printerPreferenceData.MakeJobPrivateSecure);
         if (makeJob_ComboBox.SelectedIndex == 1)
         {
             pin_TextBox.Text = printerPreferenceData.PinNumber.ToString();
         }
         if (makeJob_ComboBox.SelectedIndex == 2)
         {
             password_TextBox.Text            = printerPreferenceData.Password;
             confirm_TextBox.Text             = printerPreferenceData.ConfirmPassword;
             saveDefaultPass_CheckBox.Checked = printerPreferenceData.SaveAsDefaultPass;
         }
         userName_RadioButton.Checked         = printerPreferenceData.UserName ? true : false;
         custom_RadioButton.Checked           = printerPreferenceData.Custom ? true : false;
         custom_TextBox.Text                  = string.IsNullOrEmpty(printerPreferenceData.CustomText) ? string.Empty : printerPreferenceData.CustomText;
         automatic_RadioButton.Checked        = printerPreferenceData.JobNameAutomatic ? true : false;
         jobNameCustom_RadioButton.Checked    = printerPreferenceData.JobNameCustom ? true : false;
         jobNameCustom_TextBox.Text           = string.IsNullOrEmpty(printerPreferenceData.JobNameCustomText) ? string.Empty : printerPreferenceData.JobNameCustomText;
         jobNameExists_ComboBox.SelectedIndex = jobNameExists_ComboBox.FindStringExact(printerPreferenceData.JobNameExists);
         //Color Tab
         printInGrayScale_ComboBox.SelectedIndex = printInGrayScale_ComboBox.FindStringExact(printerPreferenceData.PrintInGrayScaleText.GetDescription());
         rgbColor_ComboBox.SelectedIndex         = rgbColor_ComboBox.FindStringExact(printerPreferenceData.RGBColor.GetDescription());
         // Advance Tab
         noOfCopies_NumericUpDown.Value           = Convert.ToDecimal(printerPreferenceData.Copies);
         collate_CheckBox.Checked                 = printerPreferenceData.Collate ? true : false;
         reversePageOrder_CheckBox.Checked        = printerPreferenceData.ReversePageOrder ? true : false;
         printAllText_CheckBox.Checked            = printerPreferenceData.PrintTextAsBlack ? true : false;
         hpEasyColor_CheckBox.Checked             = printerPreferenceData.HPEasyColor ? true : false;
         edgeToEdge_CheckBox.Checked              = printerPreferenceData.EdgeToEdge ? true : false;
         rasterCompression_ComboBox.SelectedIndex = rasterCompression_ComboBox.FindStringExact(printerPreferenceData.RasterCompression.GetDescription());
     }
 }
 /// <summary>
 /// Updates the values on Printing Preference UI. This method is responsible for setting
 /// the Printing Preference UI values.
 /// </summary>
 public void UpdatePrinterPeferenceOptions()
 {
     PrinterPreferenceData = new PrinterPreferenceData();
     // Page Quality Tab Values are set below
     if (enableCustomName_CheckBox.Checked)
     {
         PrinterPreferenceData.EnableCustomPaperSize = enableCustomName_CheckBox.Checked;
         PrinterPreferenceData.CustomPaperSizeName   = PrinterPreferenceData.PaperSize = customPaperSizeName_TextBox.Text;
     }
     else
     {
         PrinterPreferenceData.EnableCustomPaperSize = enableCustomName_CheckBox.Checked;
         PrinterPreferenceData.PaperSize             = paperSize_ComboBox.SelectedValue.ToString();
     }
     PrinterPreferenceData.PrintQuality = EnumUtil.GetByDescription <PrintQuality>(paperQuality_ComboBox.SelectedValue.ToString());
     PrinterPreferenceData.PaperType    = paperType_ComboBox.SelectedValue.ToString();
     PrinterPreferenceData.PaperSource  = paperSource_ComboBox.SelectedValue.ToString();
     PrinterPreferenceData.SpecialPages = EnumUtil.GetByDescription <SpecialPages>(specialPages_ComboBox.SelectedValue.ToString());
     // Effects Tab Values are set below
     PrinterPreferenceData.ActualSize           = actualSize_RadioButton.Checked;
     PrinterPreferenceData.PrintDocumentOn      = printDocumentOn_RadioButton.Checked;
     PrinterPreferenceData.PrintDocumentOnValue = printDocument_ComboBox.SelectedValue.ToString();
     PrinterPreferenceData.ScaleToFit           = scaleToFit_CheckBox.Checked;
     PrinterPreferenceData.PerActualSize        = perOnActualSize_RadioButton.Checked;
     PrinterPreferenceData.PerActualSizeNo      = percentage_TextBox.Text.ToString();
     if (enableCustomWatermark_CheckBox.Checked)
     {
         PrinterPreferenceData.EnableCustomWaterMark = enableCustomWatermark_CheckBox.Checked;
         PrinterPreferenceData.CustomWaterMarkName   = PrinterPreferenceData.Watermark = customWaterMark_TextBox.Text;
     }
     else
     {
         PrinterPreferenceData.EnableCustomWaterMark = enableCustomWatermark_CheckBox.Checked;
         PrinterPreferenceData.Watermark             = watermarks_ComboBox.SelectedValue.ToString();
     }
     PrinterPreferenceData.FirstPageOnly = firstPageOnly_CheckBox.Checked;
     // Finishing Tab Values are set below
     PrinterPreferenceData.PrintOnBothSides    = printOnBothSides_CheckBox.Checked;
     PrinterPreferenceData.FlipPagesUp         = flipPagesUp_CheckBox.Checked;
     PrinterPreferenceData.BookletLayout       = bookletLayout_ComboBox.SelectedValue.ToString();
     PrinterPreferenceData.PagesPerSheet       = EnumUtil.GetByDescription <PagesPerSheet>(pagesPerSheet_ComboBox.SelectedValue.ToString());
     PrinterPreferenceData.PrintPageBorders    = printPageBorders_CheckBox.Checked;
     PrinterPreferenceData.PageOrder           = EnumUtil.GetByDescription <PageOrder>(pageOrder_ComboBox.SelectedValue.ToString());
     PrinterPreferenceData.OrientationPortrait = portrait_RadioButton.Checked;
     PrinterPreferenceData.OrientationLanscape = landscape_RadioButton.Checked;
     PrinterPreferenceData.RotateBy180Degree   = rotateBy180Degrees_CheckBox.Checked;
     // Output Tab Values are set below
     PrinterPreferenceData.Staple         = EnumUtil.GetByDescription <Staple>(staple_ComboBox.SelectedValue.ToString());
     PrinterPreferenceData.Punch          = EnumUtil.GetByDescription <Punch>(punch_ComboBox.SelectedValue.ToString());
     PrinterPreferenceData.Fold           = EnumUtil.GetByDescription <Fold>(fold_ComboBox.SelectedValue.ToString());
     PrinterPreferenceData.MaxSheetPerSet = string.IsNullOrEmpty(maxSheetPerSet_TextBox.Text) ? string.Empty : maxSheetPerSet_TextBox.Text;
     PrinterPreferenceData.OutputBin      = outputBin_ComboBox.SelectedValue.ToString();
     // Job Storage Tab Values are set below
     PrinterPreferenceData.JobStorageOff        = off_RadioButton.Checked;
     PrinterPreferenceData.ProofandHold         = proofAndHold_RadioButton.Checked;
     PrinterPreferenceData.PersonalJob          = personalJob_RadioButton.Checked;
     PrinterPreferenceData.QuickJob             = quickCopy_RadioButton.Checked;
     PrinterPreferenceData.StoredJob            = storedJob_RadioButton.Checked;
     PrinterPreferenceData.MakeJobPrivateSecure = makeJob_ComboBox.SelectedValue.ToString();
     PrinterPreferenceData.UserName             = userName_RadioButton.Checked;
     PrinterPreferenceData.Custom            = custom_RadioButton.Checked;
     PrinterPreferenceData.CustomText        = string.IsNullOrEmpty(custom_TextBox.Text) ? string.Empty : custom_TextBox.Text;
     PrinterPreferenceData.JobNameAutomatic  = automatic_RadioButton.Checked;
     PrinterPreferenceData.JobNameCustom     = jobNameCustom_RadioButton.Checked;
     PrinterPreferenceData.JobNameCustomText = string.IsNullOrEmpty(jobNameCustom_TextBox.Text) ? string.Empty : jobNameCustom_TextBox.Text;
     PrinterPreferenceData.JobNameExists     = jobNameExists_ComboBox.SelectedValue.ToString();
     PrinterPreferenceData.PinNumber         = pin_TextBox.Text;
     PrinterPreferenceData.Password          = password_TextBox.Text;
     PrinterPreferenceData.ConfirmPassword   = confirm_TextBox.Text;
     PrinterPreferenceData.SaveAsDefaultPass = saveDefaultPass_CheckBox.Checked;
     //Color Tab Values are set below
     PrinterPreferenceData.PrintInGrayScaleText = EnumUtil.GetByDescription <GrayScale>(printInGrayScale_ComboBox.SelectedValue.ToString());
     PrinterPreferenceData.RGBColor             = EnumUtil.GetByDescription <RGBColor>(rgbColor_ComboBox.SelectedValue.ToString());
     // Advance Tab Values are set below
     PrinterPreferenceData.Copies            = Convert.ToInt32(noOfCopies_NumericUpDown.Value);
     PrinterPreferenceData.Collate           = collate_CheckBox.Checked;
     PrinterPreferenceData.ReversePageOrder  = reversePageOrder_CheckBox.Checked;
     PrinterPreferenceData.PrintTextAsBlack  = printAllText_CheckBox.Checked;
     PrinterPreferenceData.HPEasyColor       = hpEasyColor_CheckBox.Checked;
     PrinterPreferenceData.EdgeToEdge        = edgeToEdge_CheckBox.Checked;
     PrinterPreferenceData.RasterCompression = EnumUtil.GetByDescription <RasterCompression>(rasterCompression_ComboBox.SelectedValue.ToString());
 }
 /// <summary>
 /// Constructs the Printing Preference Controls
 /// </summary>
 public PrinterPreferencesForm()
 {
     InitializeComponent();
     PrinterPreferenceData = new PrinterPreferenceData();
     noOfCopies_NumericUpDown.ValueChanged += ConfigurationChanged;
 }
Esempio n. 10
0
        private void PaperQualityTab(PrinterPreferenceData printerPreferenceData, PrintPreferences printPreferences)
        {
            if (printPreferences.PaperQualityTabTabItem.IsVisible())
            {
                UpdateStatus("The Paper/Quality Tab operations begins");
                //Print Tab Quality
                printPreferences.PaperQualityTabTabItem.PerformHumanAction(x => x.ClickWithMouse(shortTimeout));
                //Paper Size
                TopCatUiHelper.ComboBoxSetValue(printPreferences.ComboBoxcboPageDup0ComboBox, printerPreferenceData.PaperSize, shortTimeout);
                UpdateStatus($"The Print size option activity with type {printerPreferenceData.PaperSize} is set");
                //Paper Source
                TopCatUiHelper.ComboBoxSetValue(printPreferences.ComboBoxcboDocuComboBox, printerPreferenceData.PaperSource, shortTimeout);
                UpdateStatus($"The Paper Sorce option activity with type {printerPreferenceData.PaperSource} is set");
                //Paper Type
                TopCatUiHelper.ComboBoxSetValue(printPreferences.ComboBoxcboPageDup1ComboBox, printerPreferenceData.PaperType, shortTimeout);
                UpdateStatus($"The Paper Type option activity with type {printerPreferenceData.PaperType} is set");

                //Special Pages
                printPreferences.ListBoxlistSpecList.ClickWithMouse(windowsTimeout);
                try
                {
                    switch (printerPreferenceData.SpecialPages)
                    {
                    case SpecialPages.FrontCoverNoCovers:
                        printPreferences.FrontCoverNoCovListItem.Select(shortTimeout);
                        break;

                    case SpecialPages.BackCoverNoCovers:
                        printPreferences.BackCoverNoCoveListItem.Select(shortTimeout);
                        break;

                    case SpecialPages.PrintPagesondifferentPaper:
                        printPreferences.PrintpagesondifListItem.Select(shortTimeout);
                        break;

                    case SpecialPages.Insertblankorpreprintedsheets:
                        printPreferences.InsertblankorprListItem.Select(shortTimeout);
                        break;
                    }
                }
                catch
                {
                    throw new ArgumentException(printerPreferenceData.SpecialPages + " not found on the device ");
                }
                Thread.Sleep(humanTimeSpan);
                UpdateStatus($"The Special pages option activity with type {printerPreferenceData.SpecialPages} is set");
                //Print Quality
                try
                {
                    printPreferences.ComboBoxcboResoComboBox.ClickWithMouse(windowsTimeout);
                    switch (printerPreferenceData.PrintQuality)
                    {
                    case PrintQuality.Normal:
                        printPreferences.NormalTextBlockDup1Text.ClickWithMouse(shortTimeout);
                        break;

                    case PrintQuality.FineLines:
                        printPreferences.FineLinesTextBlDup1Text.ClickWithMouse(shortTimeout);
                        break;

                    case PrintQuality.QuickView:
                        printPreferences.QuickViewTextBlDup1Text.ClickWithMouse(shortTimeout);
                        break;

                    case PrintQuality.FastRes:
                        printPreferences.FastRes1200TextDup1Text.ClickWithMouse(shortTimeout);
                        break;

                    case PrintQuality.A12001X200:
                        printPreferences.A1200x1200TextBDup1Text.ClickWithMouse(shortTimeout);
                        break;

                    case PrintQuality.GeneralOffice:
                        printPreferences.GeneralOfficeTeText.ClickWithMouse(shortTimeout);
                        break;

                    case PrintQuality.Professional:
                        printPreferences.ProfessionalTexText.ClickWithMouse(shortTimeout);
                        break;

                    case PrintQuality.Presentation:
                        printPreferences.PresentationTexText.ClickWithMouse(shortTimeout);
                        break;
                    }

                    Thread.Sleep(humanTimeSpan);
                    UpdateStatus($"The Print Quality option activity with type {printerPreferenceData.PrintQuality.GetDescription()} is set");
                }
                catch
                {
                    throw new ArgumentException(printerPreferenceData.PrintQuality + " not found on the device ");
                }
                UpdateStatus("The Paper/Quality Tab operations ends");
            }
        }
Esempio n. 11
0
        private void PrintPreferenceOptions(PrinterPreferenceData printerPreferenceData)
        {
            try
            {
                if (printerPreferenceData != null)
                {
                    _strContentToPrint.AppendLine("Printer Preferences");
                    _strContentToPrint.AppendLine();
                    _strContentToPrint.AppendLine($"Paper Size: {printerPreferenceData.PaperSize}");
                    _strContentToPrint.AppendLine($"Paper Quality: {EnumUtil.GetDescription(printerPreferenceData.PrintQuality)}");
                    _strContentToPrint.AppendLine($"Paper Type : {printerPreferenceData.PaperType}");
                    _strContentToPrint.AppendLine($"Paper Source: {printerPreferenceData.PaperSource}");
                    _strContentToPrint.AppendLine($"Special Pages: {printerPreferenceData.SpecialPages}");
                    _strContentToPrint.AppendLine($"Actual Size : {printerPreferenceData.ActualSize}");
                    _strContentToPrint.AppendLine($"Print Document On : {printerPreferenceData.PrintDocumentOn}");
                    _strContentToPrint.AppendLine($"Print Document On Value : {printerPreferenceData.PrintDocumentOnValue}");
                    _strContentToPrint.AppendLine($"Scale To Fit : {printerPreferenceData.ScaleToFit}");
                    _strContentToPrint.AppendLine($"Percentage Actual Size :{printerPreferenceData.PerActualSize}");
                    _strContentToPrint.AppendLine($"Percentage Actual Size in Number :{printerPreferenceData.PerActualSizeNo}");
                    _strContentToPrint.AppendLine($"Watermark :{printerPreferenceData.Watermark}");
                    _strContentToPrint.AppendLine($"First Page Only :{printerPreferenceData.FirstPageOnly}");

                    _strContentToPrint.AppendLine($"Print On Both Sides : {printerPreferenceData.PrintOnBothSides}");
                    _strContentToPrint.AppendLine($"Flip Pages Up : {printerPreferenceData.FlipPagesUp}");
                    _strContentToPrint.AppendLine($"Booklet Layout : {printerPreferenceData.BookletLayout}");
                    _strContentToPrint.AppendLine($"Pages Per Sheet : {EnumUtil.GetDescription(printerPreferenceData.PagesPerSheet)}");
                    _strContentToPrint.AppendLine($"Print Page Borders : {printerPreferenceData.PrintPageBorders}");
                    _strContentToPrint.AppendLine($"Page Order : {printerPreferenceData.PageOrder}");
                    _strContentToPrint.AppendLine($"Orientation Portrait : {printerPreferenceData.OrientationPortrait}");
                    _strContentToPrint.AppendLine($"Orientation Lanscape : {printerPreferenceData.OrientationLanscape}");
                    _strContentToPrint.AppendLine($"Rotate By 180 Degree : {printerPreferenceData.RotateBy180Degree}");
                    if (!printerPreferenceData.Staple.Equals(Staple.None))
                    {
                        _strContentToPrint.AppendLine($"Staple  :{EnumUtil.GetDescription(printerPreferenceData.Staple)}");
                    }
                    if (!printerPreferenceData.Punch.Equals(Punch.None))
                    {
                        _strContentToPrint.AppendLine($"Punch   : {EnumUtil.GetDescription(printerPreferenceData.Punch)}");
                    }
                    if (!printerPreferenceData.Fold.Equals(Fold.None))
                    {
                        _strContentToPrint.AppendLine($"Fold    : {EnumUtil.GetDescription(printerPreferenceData.Fold)}");
                    }
                    _strContentToPrint.AppendLine($"Max sheets per set    : {printerPreferenceData.MaxSheetPerSet}");
                    _strContentToPrint.AppendLine($"Output Bin : {printerPreferenceData.OutputBin}");

                    _strContentToPrint.AppendLine($"Job Storage Off : {printerPreferenceData.JobStorageOff}");
                    _strContentToPrint.AppendLine($"Proofand Hold  : {printerPreferenceData.ProofandHold}");
                    _strContentToPrint.AppendLine($"Personal Job  : {printerPreferenceData.PersonalJob}");
                    _strContentToPrint.AppendLine($"Quick Copy : {printerPreferenceData.QuickJob}");
                    _strContentToPrint.AppendLine($"Stored Job : {printerPreferenceData.StoredJob}");
                    _strContentToPrint.AppendLine($"Make Job Private Secure : {printerPreferenceData.MakeJobPrivateSecure}");
                    _strContentToPrint.AppendLine($"User Name : {printerPreferenceData.UserName}");
                    _strContentToPrint.AppendLine($"Custom  : {printerPreferenceData.Custom}");
                    if (!string.IsNullOrEmpty(printerPreferenceData.CustomText))
                    {
                        _strContentToPrint.AppendLine($"Custom Text : {printerPreferenceData.CustomText}");
                    }
                    _strContentToPrint.AppendLine($"JobName Automatic : {printerPreferenceData.JobNameAutomatic}");
                    _strContentToPrint.AppendLine($"JobName Custom : {printerPreferenceData.JobNameCustom}");
                    if (!string.IsNullOrEmpty(printerPreferenceData.JobNameCustomText))
                    {
                        _strContentToPrint.AppendLine($"JobName CustomText : {printerPreferenceData.JobNameCustomText}");
                    }
                    _strContentToPrint.AppendLine($"JobName Exists : {printerPreferenceData.JobNameExists}");
                    if (!string.IsNullOrEmpty(printerPreferenceData.PinNumber.ToString()))
                    {
                        _strContentToPrint.AppendLine($"Pin Number : {printerPreferenceData.PinNumber}");
                    }
                    if (!string.IsNullOrEmpty(printerPreferenceData.Password))
                    {
                        _strContentToPrint.AppendLine($"Password : {printerPreferenceData.Password}");
                    }
                    if (!string.IsNullOrEmpty(printerPreferenceData.ConfirmPassword))
                    {
                        _strContentToPrint.AppendLine($"Confirm Password : {printerPreferenceData.ConfirmPassword}");
                    }
                    _strContentToPrint.AppendLine($"Save As Default Password : {printerPreferenceData.SaveAsDefaultPass}");

                    _strContentToPrint.AppendLine($"Print in GrayScale : {EnumUtil.GetDescription(printerPreferenceData.PrintInGrayScaleText)}");
                    _strContentToPrint.AppendLine($"RGB Color : {EnumUtil.GetDescription(printerPreferenceData.RGBColor)}");

                    _strContentToPrint.AppendLine($"Copies : {printerPreferenceData.Copies}");
                    _strContentToPrint.AppendLine($"Collate : {printerPreferenceData.Collate}");
                    _strContentToPrint.AppendLine($"Reverse PageOrder : {printerPreferenceData.ReversePageOrder}");
                    _strContentToPrint.AppendLine($"Print Text as Black : {printerPreferenceData.PrintTextAsBlack}");
                    _strContentToPrint.AppendLine($"HP Easy Color : {printerPreferenceData.HPEasyColor}");
                    _strContentToPrint.AppendLine($"Edge To Edge : {printerPreferenceData.EdgeToEdge}");
                    _strContentToPrint.AppendLine($"Raster Compression : {EnumUtil.GetDescription(printerPreferenceData.RasterCompression)}");

                    _strContentToPrint.AppendLine();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 12
0
        private void AdvanceTab(PrinterPreferenceData printerPreferenceData, PrintPreferences printPreferences)
        {
            //Advanced Tab
            UpdateStatus("The Advanced Tab operations begins");
            printPreferences.AdvancedTabItemTabItem.PerformHumanAction(x => x.ClickWithMouse(shortTimeout));
            printPreferences.TextBoxedCopiesEdit.WaitForAvailable(shortTimeout);
            printPreferences.TextBoxedCopiesEdit.PerformHumanAction(x => x.EnterText(printerPreferenceData.Copies.ToString(), shortTimeout));
            UpdateStatus($"The Copy option value {printerPreferenceData.Copies} is set");
            if (printerPreferenceData.Copies > 1)
            {
                if (printerPreferenceData.Collate)
                {
                    printPreferences.CollateCheckBoxCheckBox.PerformHumanAction(x => x.Check(shortTimeout));
                    UpdateStatus("The collate option is enabled");
                }
                else
                {
                    printPreferences.CollateCheckBoxCheckBox.PerformHumanAction(x => x.Uncheck(shortTimeout));
                }
            }
            if (printerPreferenceData.ReversePageOrder)
            {
                printPreferences.ReversepageordeCheckBox.PerformHumanAction(x => x.Check(shortTimeout));
                UpdateStatus("The Reverse Page order option is enabled");
            }
            else
            {
                printPreferences.ReversepageordeCheckBox.PerformHumanAction(x => x.Uncheck(shortTimeout));
            }
            if (printerPreferenceData.PrintTextAsBlack)
            {
                printPreferences.PrintAllTextasBCheckBox.PerformHumanAction(x => x.Check(shortTimeout));
                UpdateStatus("The print text as black option is enabled");
            }
            else
            {
                printPreferences.PrintAllTextasBCheckBox.PerformHumanAction(x => x.Uncheck(shortTimeout));
            }
            if (printerPreferenceData.HPEasyColor)
            {
                printPreferences.HPEasyColorChecCheckBox.PerformHumanAction(x => x.Check(shortTimeout));
                UpdateStatus("The HP Easy Color option is enabled");
            }
            else
            {
                printPreferences.HPEasyColorChecCheckBox.PerformHumanAction(x => x.Uncheck(shortTimeout));
            }

            if (printPreferences.EdgetoEdgeCheckCheckBox.IsAvailable())
            {
                if (printerPreferenceData.EdgeToEdge)
                {
                    printPreferences.EdgetoEdgeCheckCheckBox.PerformHumanAction(x => x.Check(shortTimeout));
                    UpdateStatus("The Edge To Edge option is enabled");
                }
                else
                {
                    printPreferences.EdgetoEdgeCheckCheckBox.PerformHumanAction(x => x.Uncheck(shortTimeout));
                }
            }

            if (printPreferences.ComboBoxcboRastComboBox.IsVisible() && printPreferences.ComboBoxcboRastComboBox.IsEnabled())
            {
                printPreferences.ComboBoxcboRastComboBox.WaitForAvailable(shortTimeout);
                printPreferences.ComboBoxcboRastComboBox.Expand(shortTimeout);
                switch (printerPreferenceData.RasterCompression)
                {
                case RasterCompression.Automatic:
                    printPreferences.MonotypePrinterDup3I0XListItemRast.Select(shortTimeout);
                    break;

                case RasterCompression.BestQuality:
                    printPreferences.MonotypePrinterDup4I1XListItemRast.Select(shortTimeout);
                    break;

                case RasterCompression.MaximumCompression:
                    printPreferences.MonotypePrinterDup5I2XListItemRast.Select(shortTimeout);
                    break;
                }
                UpdateStatus($"The Raster Compression option {printerPreferenceData.RasterCompression.ToString()} is set");
            }
            UpdateStatus("The Advanced Tab operations ends");
        }
Esempio n. 13
0
        private void ColorTab(PrinterPreferenceData printerPreferenceData, PrintPreferences printPreferences)
        {
            //Color Tab
            if (printPreferences.ColorTabItemColTabItem.IsVisible())
            {
                UpdateStatus($"The Color Tab operations begins");
                printPreferences.ColorTabItemColTabItem.PerformHumanAction(x => x.ClickWithMouse(shortTimeout));
                printPreferences.ComboBoxcboPrinComboBoxColor.WaitForVisible(shortTimeout);
                printPreferences.ComboBoxcboPrinComboBoxColor.ClickWithMouse(shortTimeout);
                switch (printerPreferenceData.PrintInGrayScaleText)
                {
                case GrayScale.off:
                    printPreferences.OffListBoxItemListItem.Select(shortTimeout);
                    break;

                case GrayScale.Blackonly:
                    printPreferences.BlackOnlyListBoListItem.Select(shortTimeout);
                    break;

                case GrayScale.HighQualityCMYK:
                    printPreferences.HighQualityCMYKListItem.Select(shortTimeout);
                    break;

                case GrayScale.On:
                    printPreferences.OnListBoxItemListItem.Select(shortTimeout);
                    break;
                }
                UpdateStatus($"The Print In GrayScale option { printerPreferenceData.PrintInGrayScaleText.ToString() } is set");
                printPreferences.ComboBoxcboRGBCComboBox.WaitForAvailable(shortTimeout);
                printPreferences.ComboBoxcboRGBCComboBox.Expand(shortTimeout);
                switch (printerPreferenceData.RGBColor)
                {
                case RGBColor.DefaultsRGB:
                    printPreferences.MonotypePrinterDup6I0XListItemRGB.Select(shortTimeout);
                    break;

                case RGBColor.PhotosRGB:
                    printPreferences.MonotypePrinterDup7I1XListItemRGB.Select(shortTimeout);
                    break;

                case RGBColor.PhotoAdobeRGB1998:
                    printPreferences.MonotypePrinterDup8I2XListItemRGB.Select(shortTimeout);
                    break;

                case RGBColor.VividsRGB:
                    printPreferences.MonotypePrinterDup9I3XListItemRGB.Select(shortTimeout);
                    break;

                case RGBColor.None:
                    printPreferences.MonotypePrinterDup10I4XListItemRGB.Select(shortTimeout);
                    break;

                case RGBColor.CustomProfile:
                    printPreferences.MonotypePrinterDup11I5XListItemRGB.Select(shortTimeout);
                    break;
                }
                printPreferences.ComboBoxcboRGBCComboBox.Collapse(shortTimeout);
                UpdateStatus($"The RGB color option {printerPreferenceData.RGBColor.ToString()} is set");
                Thread.Sleep(humanTimeSpan);
                UpdateStatus($"The Color Tab operations ends");
            }
        }
Esempio n. 14
0
        private void JobStorageTab(PrinterPreferenceData printerPreferenceData, PrintPreferences printPreferences)
        {
            //Job Storage Tab
            if (printPreferences.JobStorageTabItTabItem.IsVisible())
            {
                UpdateStatus("The JobStorage Tab operations begins");
                printPreferences.JobStorageTabItTabItem.PerformHumanAction(x => x.ClickWithMouse(shortTimeout));
                if (printerPreferenceData.JobStorageOff)
                {
                    printPreferences.OffRadioButtonrRadioButton.PerformHumanAction(x => x.ClickWithMouse(shortTimeout));
                    UpdateStatus("The Job Storage Mode option Off is selected");
                }
                if (printerPreferenceData.ProofandHold)
                {
                    printPreferences.ProofandHoldRadRadioButton.PerformHumanAction(x => x.ClickWithMouse(shortTimeout));
                    UpdateStatus("The Job Storage Mode option Proof AND Hold is selected");
                }
                if (printerPreferenceData.PersonalJob)
                {
                    printPreferences.PersonalJobRadiRadioButton.PerformHumanAction(x => x.ClickWithMouse(shortTimeout));
                    UpdateStatus("The Job Storage Mode option Personal Job is selected");
                }
                if (printerPreferenceData.QuickJob)
                {
                    printPreferences.QuickCopyRadioBRadioButton.PerformHumanAction(x => x.ClickWithMouse(shortTimeout));
                    UpdateStatus("The Job Storage Mode option Quick Copy is selected");
                }
                if (printerPreferenceData.StoredJob)
                {
                    printPreferences.StoredJobRadioBRadioButton.PerformHumanAction(x => x.ClickWithMouse(shortTimeout));
                    UpdateStatus("The Job Storage Mode option Stored Job is selected");
                }

                if (printerPreferenceData.PersonalJob || printerPreferenceData.StoredJob)
                {
                    TopCatUiHelper.ComboBoxSetValue(printPreferences.ComboBoxcboJobPComboBox_JobStorage, printerPreferenceData.MakeJobPrivateSecure, shortTimeout);
                    UpdateStatus($"The Make Job Private Secure option activity with type {printerPreferenceData.MakeJobPrivateSecure} is set");
                    if (printerPreferenceData.MakeJobPrivateSecure == MakeJobPrivateSecure.PINtoprint.GetDescription())
                    {
                        printPreferences.PasswordBoxedPIDup0Edit.PerformHumanAction(x => x.EnterText(printerPreferenceData.PinNumber.ToString(), shortTimeout));
                        UpdateStatus("The Password is set");
                    }
                    else if (printerPreferenceData.MakeJobPrivateSecure == MakeJobPrivateSecure.EncryptJobwithpassword.GetDescription())
                    {
                        printPreferences.PasswordBoxedPaDup0Edit.PerformHumanAction(x => x.EnterText(printerPreferenceData.Password, shortTimeout));
                        UpdateStatus("The Password is set");
                        printPreferences.PasswordBoxedCoDup0Edit.PerformHumanAction(x => x.EnterText(printerPreferenceData.ConfirmPassword, shortTimeout));
                        UpdateStatus("The Confirm Password is set");
                        if (printerPreferenceData.SaveAsDefaultPass)
                        {
                            printPreferences.SaveasdefaultpaDup0CheckBox.PerformHumanAction(x => x.Check(shortTimeout));
                            UpdateStatus("The Save as default is enabled");
                        }
                        else
                        {
                            printPreferences.SaveasdefaultpaDup0CheckBox.PerformHumanAction(x => x.Uncheck(shortTimeout));
                        }
                    }
                }

                if (!printerPreferenceData.JobStorageOff)
                {
                    if (printerPreferenceData.UserName)
                    {
                        printPreferences.UserNameRadioBuRadioButton.PerformHumanAction(x => x.ClickWithMouse(shortTimeout));
                        UpdateStatus("The user name is enabled");
                    }
                    else
                    {
                        printPreferences.CustomRadioButtDup0RadioButton.PerformHumanAction(x => x.ClickWithMouse(shortTimeout));
                        UpdateStatus($"The Custom name is selected");
                        printPreferences.TextBoxedUserNaEdit.PerformHumanAction(x => x.EnterText(printerPreferenceData.CustomText, shortTimeout));
                        UpdateStatus($"The Custom name {printerPreferenceData.CustomText} is set");
                    }
                    if (printerPreferenceData.JobNameAutomatic)
                    {
                        printPreferences.AutomaticRadioBRadioButton.PerformHumanAction(x => x.ClickWithMouse(shortTimeout));
                        UpdateStatus("The Automatic Job name is enabled");
                    }
                    else
                    {
                        printPreferences.CustomRadioButtDup1RadioButton.PerformHumanAction(x => x.ClickWithMouse(shortTimeout));
                        UpdateStatus($"The Custom job name is selected");
                        printPreferences.TextBoxedJobNamEdit.PerformHumanAction(x => x.EnterText(printerPreferenceData.JobNameCustomText, shortTimeout));
                        UpdateStatus($"The Custom job name {printerPreferenceData.JobNameCustomText} is set");
                    }
                    if (printerPreferenceData.JobNameExists == IfJobNameExists.UseJobName199.GetDescription())
                    {
                        printPreferences.ComboBoxcboJobNComboBox.Expand(windowsTimeout);
                        printPreferences.MonotypePrinterDup0I0XListItem.Select(shortTimeout);
                        printPreferences.ComboBoxcboJobNComboBox.Collapse(windowsTimeout);
                    }
                    else
                    {
                        printPreferences.ComboBoxcboJobNComboBox.Expand(windowsTimeout);
                        printPreferences.MonotypePrinterDup3I1XListItem1.Select(shortTimeout);
                        printPreferences.ComboBoxcboJobNComboBox.Collapse(windowsTimeout);
                    }
                    Thread.Sleep(humanTimeSpan);
                    UpdateStatus($"The option {printerPreferenceData.JobNameExists} is set");
                }
                UpdateStatus("The JobStorage Tab operations ends");
            }
        }
Esempio n. 15
0
        private void OutputTab(PrinterPreferenceData printerPreferenceData, PrintPreferences printPreferences)
        {
            //Output Tab
            if (printPreferences.OutputTabItemOuTabItem.IsVisible())
            {
                UpdateStatus("The Output Tab operations begins");

                printPreferences.OutputTabItemOuTabItem.PerformHumanAction(x => x.ClickWithMouse(shortTimeout));
                try
                {
                    if (printPreferences.ComboBoxcboStapComboBox.IsEnabled() && printPreferences.ComboBoxcboStapComboBox.IsVisible())
                    {
                        TopCatUiHelper.ComboBoxSetValue(printPreferences.ComboBoxcboStapComboBox, printerPreferenceData.Staple.GetDescription(), shortTimeout);
                        UpdateStatus($"The Output Staple option activity with type {printerPreferenceData.Staple.GetDescription()} is set");
                    }
                }
                catch
                {
                    throw new ArgumentException(printerPreferenceData.Staple + " not found on the device ");
                }
                try
                {
                    if (printPreferences.ComboBoxcboHoleComboBox.IsEnabled() && printPreferences.ComboBoxcboHoleComboBox.IsVisible())
                    {
                        TopCatUiHelper.ComboBoxSetValue(printPreferences.ComboBoxcboHoleComboBox, printerPreferenceData.Punch.GetDescription(), shortTimeout);
                        UpdateStatus($"The Output Hole punch option activity with type {printerPreferenceData.Punch.GetDescription()} is set");
                    }
                }
                catch
                {
                    throw new ArgumentException(printerPreferenceData.Punch + " not found on the device ");
                }
                try
                {
                    if (printPreferences.ComboBoxcboFoldComboBox.IsEnabled() && printPreferences.ComboBoxcboFoldComboBox.IsVisible())
                    {
                        printPreferences.ComboBoxcboFoldComboBox.Expand(shortTimeout);
                        switch (printerPreferenceData.Fold)
                        {
                        case Fold.InwardCfoldOpensToLeftorUp:
                            printPreferences.InwardCfoldopenDup1I1XListItem.Select(shortTimeout);
                            break;

                        case Fold.InwardCfoldOpensToRightorDown:
                            printPreferences.InwardCfoldopenDup3I1XListItem.Select(shortTimeout);
                            break;

                        case Fold.OutwardCfoldOpensToLeftorUp:
                            printPreferences.OutwardCfoldopeDup1I1XListItem.Select(shortTimeout);
                            break;

                        case Fold.OutwardCfoldOpensToRightorDown:
                            printPreferences.OutwardCfoldopeDup3I1XListItem.Select(shortTimeout);
                            break;

                        case Fold.InwardVfold:
                            printPreferences.InwardVfoldListDup1I1XListItem.Select(shortTimeout);
                            break;

                        case Fold.OutwardVfold:
                            printPreferences.OutwardVfoldLisDup1I1XListItem.Select(shortTimeout);
                            break;

                        case Fold.None:
                            printPreferences.NoneListBoxItemDup2ListItem.Select(shortTimeout);
                            break;
                        }
                        printPreferences.ComboBoxcboFoldComboBox.Collapse(shortTimeout);
                        UpdateStatus($"The Output Fold  option activity with type {printerPreferenceData.Fold.GetDescription()} is set");
                    }
                }
                catch
                {
                    throw new ArgumentException(printerPreferenceData.Fold + " not found on the device ");
                }
                if (printPreferences.ComboBoxcboFoldComboBox.IsEnabled() && printPreferences.ComboBoxcboFoldComboBox.IsVisible())
                {
                    printPreferences.TextBoxedMaxSheEdit.PerformHumanAction(x => x.EnterText(printerPreferenceData.MaxSheetPerSet, shortTimeout));
                    UpdateStatus($"The Max sheets per set value {printerPreferenceData.MaxSheetPerSet} is set");
                }
                if (printPreferences.ComboBoxcboOutpComboBox.IsEnabled())
                {
                    TopCatUiHelper.ComboBoxSetValue(printPreferences.ComboBoxcboOutpComboBox, printerPreferenceData.OutputBin, shortTimeout);
                    UpdateStatus($"The output bin option activity with type {printerPreferenceData.OutputBin} is set");
                }
                UpdateStatus("The Output Tab operations ends");
            }
        }
Esempio n. 16
0
        private void FinishingTab(PrinterPreferenceData printerPreferenceData, PrintPreferences printPreferences)
        {
            //Finishing Tab Item
            if (printPreferences.FinishingTabIteTabItem.IsVisible())
            {
                UpdateStatus("The Finishing Tab operations begins");
                printPreferences.FinishingTabIteTabItem.PerformHumanAction(x => x.ClickWithMouse(shortTimeout));
                if (printerPreferenceData.PrintOnBothSides)
                {
                    printPreferences.PrintonbothsideCheckBox.PerformHumanAction(x => x.Check(shortTimeout));
                    UpdateStatus("The Print On both side option is enabled");
                    TopCatUiHelper.ComboBoxSetValue(printPreferences.ComboBoxcboBookComboBox, printerPreferenceData.BookletLayout, shortTimeout);
                    UpdateStatus($"The BookletLayout option activity with type {printerPreferenceData.BookletLayout} is set");
                    if (printPreferences.FlipPagesUpChecCheckBox.IsEnabled())
                    {
                        if (printerPreferenceData.FlipPagesUp)
                        {
                            printPreferences.FlipPagesUpChecCheckBox.PerformHumanAction(x => x.Check(shortTimeout));
                            UpdateStatus("The flip page up option is enabled");
                        }
                        else
                        {
                            printPreferences.FlipPagesUpChecCheckBox.PerformHumanAction(x => x.Uncheck(shortTimeout));
                        }
                    }
                }
                else
                {
                    printPreferences.PrintonbothsideCheckBox.PerformHumanAction(x => x.Uncheck(shortTimeout));
                }

                if (printerPreferenceData.BookletLayout == BookletLayout.Off.GetDescription())
                {
                    printPreferences.ComboBoxcboDocuDup0ComboBox.Expand(windowsTimeout);
                    switch (printerPreferenceData.PagesPerSheet)
                    {
                    case PagesPerSheet.A1pagepersheet:
                        printPreferences.MonotypePrinterDup6I0XListItem.Select(windowsTimeout);
                        break;

                    case PagesPerSheet.A2pagespersheet:
                        printPreferences.MonotypePrinterDup7I1XListItem.Select(windowsTimeout);
                        break;

                    case PagesPerSheet.A4pagespersheet:
                        printPreferences.MonotypePrinterDup8I2XListItem.Select(windowsTimeout);
                        break;

                    case PagesPerSheet.A6pagespersheet:
                        printPreferences.MonotypePrinterDup9I3XListItem.Select(windowsTimeout);
                        break;

                    case PagesPerSheet.A9pagespersheet:
                        printPreferences.MonotypePrinterDup10I4XListItem.Select(windowsTimeout);
                        break;

                    case PagesPerSheet.A16pagespersheet:
                        printPreferences.MonotypePrinterDup11I5XListItem.Select(windowsTimeout);
                        break;
                    }
                    printPreferences.ComboBoxcboDocuDup0ComboBox.Collapse(windowsTimeout);
                    Thread.Sleep(humanTimeSpan);
                    UpdateStatus($"The PagesPerSheet option activity with type {printerPreferenceData.PagesPerSheet.GetDescription()} is set");

                    if (printerPreferenceData.PagesPerSheet != PagesPerSheet.A1pagepersheet)
                    {
                        if (printerPreferenceData.PrintPageBorders)
                        {
                            printPreferences.PrintpageborderCheckBox.PerformHumanAction(x => x.Check(shortTimeout));
                            UpdateStatus("The Print page border option is enabled");
                        }
                        else
                        {
                            printPreferences.PrintpageborderCheckBox.PerformHumanAction(x => x.Uncheck(shortTimeout));
                        }

                        printPreferences.ComboBoxcboJobPComboBox_Finishing.Expand(windowsTimeout);
                        switch (printerPreferenceData.PageOrder)
                        {
                        case PageOrder.RightthenDown:
                            printPreferences.MonotypePrinterDup10I0XListItem.Select(windowsTimeout);
                            break;

                        case PageOrder.Confidential:
                            printPreferences.MonotypePrinterDup11I1XListItem.Select(windowsTimeout);
                            break;

                        case PageOrder.LeftthenDown:
                            printPreferences.MonotypePrinterDup12I2XListItem.Select(windowsTimeout);
                            break;

                        case PageOrder.DownthenLeft:
                            printPreferences.MonotypePrinterDup13I3XListItem.Select(windowsTimeout);
                            break;
                        }
                        printPreferences.ComboBoxcboJobPComboBox_Finishing.Collapse(windowsTimeout);
                        Thread.Sleep(humanTimeSpan);
                        UpdateStatus($"The Page Order option activity with type {printerPreferenceData.PageOrder.GetDescription()} is set");
                    }
                }

                if (printerPreferenceData.OrientationPortrait)
                {
                    printPreferences.PortraitRadioBuRadioButton.PerformHumanAction(x => x.ClickWithMouse(shortTimeout));
                    UpdateStatus("The Portrait option is selected");
                }
                else
                {
                    printPreferences.LandscapeRadioBRadioButton.PerformHumanAction(x => x.ClickWithMouse(shortTimeout));
                    UpdateStatus("The Landscape option is selected");
                }

                if (printerPreferenceData.RotateBy180Degree)
                {
                    printPreferences.Rotateby180degrCheckBox.PerformHumanAction(x => x.Check(shortTimeout));
                    UpdateStatus("The Rotation option is enabled");
                }
                else
                {
                    printPreferences.Rotateby180degrCheckBox.PerformHumanAction(x => x.Uncheck(shortTimeout));
                }
                UpdateStatus("The Finishing Tab operations ends");
            }
        }