public FavouritesPanel(int panelWidth, int panelHeight, Favourites favourite, BrowserTab Tab) { timer.Interval = 1; AutoScroll = true; VerticalScroll.Visible = true; VerticalScroll.Enabled = true; fave = favourite; curTab = Tab; Width = 0; maxWidth = panelWidth; Height = panelHeight; btnClose.Click += new EventHandler((sender, e) => TogglePanel(sender, e)); btnConfirm.Click += new EventHandler((sender, e) => ConfirmFavourite(sender, e)); timer.Tick += new EventHandler(TimerTick); SetLinks(); DrawLabels(); BackColor = Color.LightGray; btnClose.Text = "Close"; Controls.Add(btnClose); }
private void Form1_Load(object sender, EventArgs e) { BrowserTab homePage = new BrowserTab(tabController); tabController.TabPages.Clear(); tabController.TabPages.Add(homePage); }
private void AddTabSafe(BrowserTab b) { if (InvokeRequired) { SetBrowserTabCallBack d = new SetBrowserTabCallBack(AddTabSafe); this.Invoke(d, new object[] { b }); } else { tc.TabPages.Add(b); } }
private void Form1_Load(object sender, EventArgs e) { KeyPreview = true; string binDir = @"bin"; string faveDir = binDir + @"\favourites"; string histDir = binDir + @"\historys"; string userDir = binDir + @"\users"; string settingDir = binDir + @"\settings"; if (!Directory.Exists(binDir)) { Directory.CreateDirectory(binDir); } if (!Directory.Exists(faveDir)) { Directory.CreateDirectory(faveDir); } if (!Directory.Exists(histDir)) { Directory.CreateDirectory(histDir); } if (!Directory.Exists(userDir)) { Directory.CreateDirectory(userDir); } if (!Directory.Exists(settingDir)) { Directory.CreateDirectory(settingDir); } User user = new User(); Favourites fave = new Favourites("bin/favourites/favourites.xml"); History hist = new History("bin/historys/history.xml"); BrowserTab homePage = new BrowserTab(tabController, this, tabController.TabPages[0].Width, tabController.TabPages[0].Height, user, fave, hist); KeyPress += new KeyPressEventHandler(homePage.KeyPressFunc); tabController.TabPages.Clear(); tabController.TabPages.Add(homePage); splitContainer1.Panel1.Hide(); }
public LoginPanel(int inputWidth, int inputHeight, User inputUser, BrowserTab curTab) { Width = inputWidth; Height = inputHeight; tp = curTab; user = inputUser; txtPassword.UseSystemPasswordChar = true; SetAttributes(); SetLocations(); SetFunctions(); Controls.Add(txtUsername); Controls.Add(txtPassword); Controls.Add(lblUsername); Controls.Add(lblPassword); Controls.Add(btnLogin); Controls.Add(btnSignUp); Controls.Add(btnGuest); }
/// <summary> /// checks users file for username /// checks username against password /// if match return true /// else returns false /// </summary> /// <returns>state of login sucess</returns> public bool Login(BrowserTab b) { XmlDocument doc = new XmlDocument(); doc.Load(usersXmlPath); foreach (XmlNode node in doc.DocumentElement) { if ((node["username"].InnerText == username) & (node["password"].InnerText == password)) { loggedIn = true; settingsXmlPath = @"bin/settings/" + username + "settings.xml"; b.UpdateDirs(); Console.WriteLine(settingsXmlPath); ReadSettings(); return(true); } } return(false); }
public HistoryPanel(int panelWidth, int panelHeight, History inputHistory, BrowserTab Tab) { timer.Interval = 1; AutoScroll = true; VerticalScroll.Visible = true; VerticalScroll.Enabled = true; history = inputHistory; curTab = Tab; Width = 0; maxWidth = panelWidth; Height = panelHeight; btnClose.Click += new EventHandler(TogglePanel); btnClear.Click += new EventHandler(ClearHistory); timer.Tick += new EventHandler(TimerTick); SetLinks(); DrawLabels(); BackColor = Color.LightGray; btnClear.Location = new Point(btnClose.Width, 0); btnClear.Text = "Clear History"; btnClose.Text = "Close"; Controls.Add(btnClose); Controls.Add(btnClear); }
private void AddTab(object sender, EventArgs e) { BrowserTab newPage = new BrowserTab(tc); tc.TabPages.Add(newPage); }
private void AddTabWork() { BrowserTab newPage = new BrowserTab(tc, form, Width, Height, user, favourites, history); AddTabSafe(newPage); }