예제 #1
0
        /// <summary>
        /// Creates a speed dial contact
        /// </summary>
        public int CreateSpeedDial(string DisplayName, string SpeedDial, string FaxNumber)
        {
            int speedDialNumber;

            _controlPanel.PressWait(".hp-address-book-selection-button", ".hp-contact-record-list");
            _controlPanel.PressWait(".hp-listitem:contains(" + "Fax Speed Dials)", ".hp-contact-record-list");
            _controlPanel.PressWait("#hpid-contacts-add-record-button", "#hpid-fax-speed-dial-edit-view");

            Pacekeeper.Sync();
            Pacekeeper.Pause();
            if (_controlPanel.WaitForState("#hpid-fax-speed-dial-edit-display-name-textbox", OmniElementState.Useable, TimeSpan.FromSeconds(5)))
            {
                _controlPanel.Press("#hpid-fax-speed-dial-edit-display-name-textbox");
            }
            _controlPanel.TypeOnVirtualKeyboard(DisplayName);
            if (_controlPanel.WaitForState("#hpid-fax-speed-dial-edit-speed-dial-code-textbox", OmniElementState.Useable, TimeSpan.FromSeconds(5)))
            {
                _controlPanel.PressWait("#hpid-fax-speed-dial-edit-speed-dial-code-textbox", "#hpid-keypad");
            }
            _controlPanel.TypeOnNumericKeypad(SpeedDial);

            if (_controlPanel.WaitForState("#hpid-fax-speed-dial-edit-fax-numbers-textbox", OmniElementState.Useable, TimeSpan.FromSeconds(5)))
            {
                _controlPanel.PressWait("#hpid-fax-speed-dial-edit-fax-numbers-textbox", "#hpid-keypad");
            }
            _controlPanel.TypeOnNumericKeypad(FaxNumber);
            if (_controlPanel.WaitForState("#hpid-keypad-key-close", OmniElementState.Useable, TimeSpan.FromSeconds(5)))
            {
                _controlPanel.Press("#hpid-keypad-key-close");
            }

            string autoSpeedDial;

            autoSpeedDial   = _controlPanel.GetValue("#hpid-fax-speed-dial-edit-speed-dial-code-textbox", "value", OmniPropertyType.Property);
            speedDialNumber = int.Parse(autoSpeedDial);
            _controlPanel.Press("#hpid-fax-speed-dial-edit-save-button");
            Pacekeeper.Sync();
            Pacekeeper.Pause();
            if (_controlPanel.WaitForState(".hp-button-done", OmniElementState.Useable, TimeSpan.FromSeconds(10)))
            {
                _controlPanel.Press(".hp-button-done");
                _pacekeeper.Pause();
            }
            _preparationManager.NavigateHome();

            return(speedDialNumber);
        }
 /// <summary>
 /// Sets the Tray setting for Managed Trays
 /// <param name="traySettings">Container to hold values of the Tray setting</param>
 /// </summary>
 public void ManageTraySettings(TraySettings traySettings)
 {
     _controlPanel.PressWait("#hpid-tree-node-listitem-copyprint", "#hpid-tree-node-listitem-managetrays", _activeWaitTimeOut);
     Pacekeeper.Sync();
     Pacekeeper.Pause();
     _controlPanel.PressWait("#hpid-tree-node-listitem-managetrays", "#hpid-tree-node-listitem-userequestedtray", _activeWaitTimeOut);
     Pacekeeper.Sync();
     Pacekeeper.Pause();
     if (traySettings.IsUseRequesetedTraySet)
     {
         _controlPanel.PressWait("#hpid-tree-node-listitem-userequestedtray", "#hpid-setting-userequestedtray-selection-true", _activeWaitTimeOut);
         _controlPanel.Press(traySettings.UseRequesetedTray ? "#hpid-setting-userequestedtray-selection-true" : "#hpid-setting-userequestedtray-selection-false");
     }
     if (traySettings.IsManualFeedPromptSet)
     {
         _controlPanel.PressWait("#hpid-tree-node-listitem-manuallyfeedprompt", "#hpid-setting-manuallyfeedprompt-selection-true", _activeWaitTimeOut);
         _controlPanel.Press(traySettings.ManualFeedPrompt ? "#hpid-setting-manuallyfeedprompt-selection-true" : "#hpid-setting-manuallyfeedprompt-selection-false");
     }
     if (traySettings.IsSizeTypePromptSet)
     {
         _controlPanel.PressWait("#hpid-tree-node-listitem-sizetypeprompt", "#hpid-setting-sizetypeprompt-selection-display", _activeWaitTimeOut);
         _controlPanel.Press(traySettings.SizeTypePrompt ? "#hpid-setting-sizetypeprompt-selection-display" : "#hpid-setting-sizetypeprompt-selection-donotdisplay");
     }
     if (traySettings.IsUseAnotherTraySet)
     {
         _controlPanel.PressWait("#hpid-tree-node-listitem-useanothertray", "#hpid-setting-useanothertray-selection-false", _activeWaitTimeOut);
         _controlPanel.Press(traySettings.UseAnotherTray ? "#hpid-setting-useanothertray-selection-false" : "#hpid-setting-useanothertray-selection-true");
     }
     if (traySettings.IsAlternativeLetterheadModeSet)
     {
         _controlPanel.PressWait("#hpid-tree-node-listitem-alternativeletterheadmode", "#hpid-setting-alternativeletterheadmode-selection-true", _activeWaitTimeOut);
         _controlPanel.Press(traySettings.AlternativeLetterheadMode ? "#hpid-setting-alternativeletterheadmode-selection-false" : "#hpid-setting-alternativeletterheadmode-selection-true");
     }
     if (traySettings.IsDuplexBlankPagesSet)
     {
         _controlPanel.PressWait("#hpid-tree-node-listitem-duplexblankpages", "#hpid-setting-duplexblankpages-selection-auto", _activeWaitTimeOut);
         _controlPanel.Press(traySettings.DuplexBlankPages ? "#hpid-setting-duplexblankpages-selection-auto" : "#hpid-setting-duplexblankpages-selection-yes");
     }
     if (traySettings.IsImageRotationSet)
     {
         if (_controlPanel.CheckState("#hpid-tree-node-listitem-imagerotation", OmniElementState.Exists))
         {
             if (traySettings.ImageRotation == ImageRoationType.LeftToRight)
             {
                 _controlPanel.PressWait("#hpid-tree-node-listitem-imagerotation", "#hpid-setting-imagerotation-selection", _activeWaitTimeOut);
                 _controlPanel.Press("#hpid-setting-imagerotation-selection-standard");
             }
             else if (traySettings.ImageRotation == ImageRoationType.RightToLeft)
             {
                 _controlPanel.PressWait("#hpid-tree-node-listitem-imagerotation", "#hpid-setting-imagerotation-selection", _activeWaitTimeOut);
                 _controlPanel.Press("#hpid-setting-imagerotation-selection-righttoleft");
             }
             else
             {
                 _controlPanel.PressWait("#hpid-tree-node-listitem-imagerotation", "#hpid-setting-imagerotation-selection", _activeWaitTimeOut);
                 _controlPanel.Press("#hpid-setting-imagerotation-selection-alternate");
             }
         }
     }
     if (traySettings.IsOverrideA4LetterSet)
     {
         _controlPanel.PressWait("#hpid-tree-node-listitem-overridea4letter", "#hpid-setting-overridea4letter-selection-no", _activeWaitTimeOut);
         _controlPanel.Press(traySettings.OverrideA4Letter ? "#hpid-setting-overridea4letter-selection-no" : "#hpid-setting-overridea4letter-selection-yes");
     }
     _preparationManager.NavigateHome();
 }