コード例 #1
0
 /// <summary>
 /// Constructor to initialise history viewing window.
 /// </summary>
 /// <param name="historyIn">List containing all items in the user's history</param>
 /// <param name="browser">The top level browser this control is related to</param>
 /// <param name="newWindow">The window this control is open in</param>
 public HistoryBrowser(List <KeyValuePair <string, string> > historyIn, SPWebBrowser browser, Form newWindow)
 {
     InitializeComponent();
     pageNum     = -1; //Initialise to -1 as will start by moving onto page one (zero indexed)
     userHistory = historyIn;
     webBrowser  = browser;
     thisWindow  = newWindow;
     UpdateDisplay(AddOne);
 }
コード例 #2
0
        private delegate int ChangePage(int num); //TODO: Implement this

        /// <summary>
        /// Constructor that opens tab to home page
        /// </summary>
        /// <param name="newTabPage">The tab page object this control will be on</param>
        /// <param name="browserLogBox">The browser's text box for logging information to user</param>
        /// <param name="browser">The browser containing this tab</param>
        public TabUserControl(TabPage newTabPage, TextBox browserLogBox, SPWebBrowser browser)
        {
            InitializeComponent();

            this.thisTabPage = newTabPage;
            this.browser     = browser;

            localHistory = new List <String>();

            if (Favourites == null)
            {
                Favourites = new Dictionary <string, string>();
                LoadFavourites();
            }
            else
            {
                RefreshFavouritesBox(); //If the favourites are already in menu just refresh the display box to show them
            }

            homeUrl    = getHomeURL();
            currentUrl = homeUrl; //This is set here incase first request fails. Avoids currentUrl being null
            goHome();

            //If this is the first tab assign the log box
            if (logBox == null)
            {
                logBox = browserLogBox;
            }

            //If this is the first tab to be created it will need to load history, others wont
            if (GlobalHistory == null)
            {
                LoadHistory();
            }

            if (AllTabs == null)
            {
                AllTabs = new List <TabUserControl>();
            }
            AllTabs.Add(this);
        }