Exemplo n.º 1
0
        private void CheckCommandState()
        {
            BrowserCommands commands = BrowserCommands.None;

            if (ActiveBrowser != null)
            {
                if (ActiveBrowser.CanGoBack)
                {
                    commands |= BrowserCommands.Back;
                }
                if (ActiveBrowser.CanGoForward)
                {
                    commands |= BrowserCommands.Forward;
                }
                if (ActiveBrowser.IsBusy)
                {
                    commands |= BrowserCommands.Stop;
                }
                // Add the default commands
                // You could do some aditional checking here.
                // For example, Home could be disabled if the user is allready on the home page
                commands |= BrowserCommands.Home;
                commands |= BrowserCommands.Search;
                commands |= BrowserCommands.Print;
                commands |= BrowserCommands.PrintPreview;
                commands |= BrowserCommands.Reload;
            }

            //// If it's not the active browser, return aswel..
            //if (extendedWebBrowser != ActiveBrowser)
            //  return;

            OnCommandStateChanged(new CommandStateEventArgs(commands));
        }
Exemplo n.º 2
0
 public static BrowserCommand GetNextCommand() // Returns null if no new commands received
 {
     lock (lockObject)
     {
         return(BrowserCommands.GetNextCommand(GetDriver()));
     }
 }
Exemplo n.º 3
0
        private void CheckCommandState()
        {
            BrowserCommands none = BrowserCommands.None;

            if (this.ActiveBrowser != null)
            {
                if (this.ActiveBrowser.CanGoBack)
                {
                    none |= BrowserCommands.Back;
                }
                if (this.ActiveBrowser.CanGoForward)
                {
                    none |= BrowserCommands.Forward;
                }
                if (this.ActiveBrowser.IsBusy)
                {
                    none |= BrowserCommands.Stop;
                }
                none |= BrowserCommands.Home;
                none |= BrowserCommands.Search;
                none |= BrowserCommands.Print;
                none |= BrowserCommands.PrintPreview;
                none |= BrowserCommands.Reload;
            }
            this.OnCommandStateChanged(new CommandStateEventArgs(none));
        }
Exemplo n.º 4
0
 public DocumentLibraryHelper(IWebDriver driver)
 {
     this.driver         = driver;
     documentLibraryPage = new DocumentLibraryPage(driver);
     loginPage           = new LoginPage(driver);
     wait    = new Waits(driver);
     em      = new ElementMethods(driver);
     browser = new BrowserCommands(driver);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Creates a new instance of the <see cref="CommandStateEventArgs"/> class
 /// </summary>
 /// <param name="commands">A list of commands that are available</param>
 public CommandStateEventArgs(BrowserCommands commands)
 {
   _commands = commands;
 }
Exemplo n.º 6
0
 /// <summary>
 /// Creates a new instance of the <see cref="CommandStateEventArgs"/> class
 /// </summary>
 /// <param name="commands">A list of commands that are available</param>
 public CommandStateEventArgs(BrowserCommands commands)
 {
     _commands = commands;
 }