public void SetupSeleniumDriver(bool useDebug, NavigatorType navigatorType)
        {
            if (m_driver == null)
            {
                if (navigatorType == NavigatorType.Firefox)
                {
                    m_driver = new FirefoxDriver();
                }
                else
                if (navigatorType == NavigatorType.InternetExplorer)
                {
                    m_driver = new InternetExplorerDriver();
                }
                else
                {
                    m_driver = new ChromeDriver();
                }

                Thread.Sleep(2000);
                if (ChatHackerConfiguration.Instance.IsUserRequestToHideInterface())
                {
                    m_driver.Manage().Window.Size = new System.Drawing.Size(0, 0);
                    m_driver.Manage().Window.Position = new System.Drawing.Point(-2000, 0);
                }
                else
                {
                    m_driver.Manage().Window.Size = new System.Drawing.Size(300, 200);
                }
            }
        }
Beispiel #2
0
        internal static INavigator CreateNavigator(Notebook owner, NavigatorType type)
        {
            switch (type)
            {
            case NavigatorType.FlatTabs:
                return(new FlatTabs.FlatTabNavigator(owner));

            case NavigatorType.ListBook:
                return(new ListBookNavigator.ListBookNavigator(owner));

            case NavigatorType.None:
                return(new NoNavigator.NoNavigator(owner));
            }

            throw new ArgumentException();
        }
Beispiel #3
0
        private void CreateNavigator(NavigatorType type)
        {
            INavigator navigator      = NavigatorFactory.CreateNavigator(this, type);
            int        currentNavSize = 0;
            int        selectedIndex  = -1;

            if (navigator is Control == false)
            {
                throw new ArgumentException("Notebook navigators must inherit from Control.");
            }

            if (mNavigator != null)
            {
                selectedIndex = SelectedIndex;

                switch (Navigator.Location)
                {
                case NavigatorLocation.Left:
                case NavigatorLocation.Top:
                    currentNavSize = mSplitterLocation;
                    break;

                case NavigatorLocation.Bottom:
                    currentNavSize = ClientSize.Height - mSplitterLocation;
                    break;

                case NavigatorLocation.Right:
                    currentNavSize = ClientSize.Width - mSplitterLocation;
                    break;
                }
            }

            mNavType       = type;
            mNavProperties = navigator.CreateProperties();
            mNavigator     = (Control)navigator;

            // remove any existing navigator before adding the new one
            NoteControls.RemoveNavigator();
            NoteControls.Add(mNavigator);

            NavigatorInterface.RefreshAllPages();
            SelectedIndex = selectedIndex;

            RedoLayout();
            DisplayCorrectPage();
        }