static void Main(String[] args) { //Create handler DataHandler handler = new DataHandler(); //Create thread and launch the browser on it var thread = new Thread(() => { Thread.CurrentThread.Name = "Main"; Application.Run(new PodgeBrowser(handler)); }); thread.SetApartmentState(ApartmentState.STA); thread.Start(); }
ArrayList webpages = new ArrayList(); //list of webbrowsers #endregion Fields #region Constructors //Constructor public PodgeBrowser(DataHandler handler) { try { InitializeComponent(); //on loading the browser, load the homepage, history and bookmarks this.handler = handler; //create the grid builder grid = new GridBuilder(handler); //get the homepage requested = handler.getHome(); //if first use sets as hw.ac.uk //request and display the homepage MakeInitialRequest(requested); } catch (NullReferenceException) { //do nothing, we don't expect to come here } }
DataGridView hgrid; //grid for the history #endregion Fields #region Constructors public GridBuilder(DataHandler handler) { this.handler = handler; }