Beispiel #1
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");
            }
        }
Beispiel #2
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");
            }
        }
Beispiel #3
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");
            }
        }
Beispiel #4
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");
            }
        }
Beispiel #5
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");
            }
        }