Ejemplo n.º 1
0
 /// <summary>
 /// Initializes the browser by loading the objects from the file as
 /// well as adding some elemtns to the different lists so no problem occurs
 /// when displaying the UI.
 /// </summary>
 public void InitializeBrowser()
 {
     mb = new MiniBowser.MiniBowser();
     // if the urlList is empty, fills it with empty strings (for display purposes)
     if (mb.History.UrlList.Count <= 8)
     {
         List <string> emptyUrlList = new List <string> {
             "", "", "", "", "", "", "", ""
         };
         mb.History.UrlList.AddRange(emptyUrlList);
     }
     // if the bookmark list is empty, fills it with empty bookmarks (for display purposes)
     if (mb.BookmarkList.Count <= 8)
     {
         List <MiniBowser.Bookmark> emptyBookmarkList = new List <MiniBowser.Bookmark> {
             new MiniBowser.Bookmark("", ""), new MiniBowser.Bookmark("", ""),
             new MiniBowser.Bookmark("", ""), new MiniBowser.Bookmark("", ""),
             new MiniBowser.Bookmark("", ""), new MiniBowser.Bookmark("", ""),
             new MiniBowser.Bookmark("", ""), new MiniBowser.Bookmark("", "")
         };
         mb.BookmarkList.AddRange(emptyBookmarkList);
     }
     // store the initial state
     mb.Store();
     // loads the homepage
     urlEntry.Text  = mb.Homepage;
     mb.CurrentSite = mb.Homepage;
     // http load homepage
     // display html content(tostring)
     htmlTextView.Buffer.Text = mb.RequestResult(mb.Homepage);
     CheckButtonsStatus();
 }
Ejemplo n.º 2
0
 // Event Methods
 // =============
 protected void OnDeleteEvent(object sender, DeleteEventArgs a)
 {
     mb.Store();
     Application.Quit();
     a.RetVal = true;
 }