Esempio n. 1
0
 public MainWindow()
     : base(Catalog.GetString ("Mono Visual Profiler"))
 {
     history = History.Load ();
     history.LogFiles.Changed += UpdateRecentLogs;
     history.Configs.Changed += UpdateRepeatSessions;
     DefaultSize = new Gdk.Size (800, 600);
     Gtk.Box box = new Gtk.VBox (false, 0);
     Gtk.UIManager uim = BuildUIManager ();
      			box.PackStart (uim.GetWidget ("/Menubar"), false, false, 0);
      			box.PackStart (uim.GetWidget ("/Toolbar"), false, false, 0);
     UpdateRecentLogs (null, null);
     UpdateRepeatSessions (null, null);
     content_area = new Gtk.VBox (false, 0);
     content_area.Show ();
     box.PackStart (content_area, true, true, 0);
     StartPage start_page = new StartPage (history);
     start_page.Activated += OnStartPageActivated;
     start_page.Show ();
     View = start_page;
     box.ShowAll ();
     Add (box);
 }
Esempio n. 2
0
 public StartPage(History history)
 {
     this.history = history;
     history.Changed += delegate { Refresh (); };
     CanFocus = true;
     Events = Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask | Gdk.EventMask.ExposureMask | Gdk.EventMask.KeyPressMask | Gdk.EventMask.PointerMotionMask;
     layout = CreatePangoLayout (String.Empty);
 }
Esempio n. 3
0
        public static History Load()
        {
            string path = Filename;
            if (!File.Exists (path))
                return new History ();

            History result;
            try {
                XmlSerializer serializer = new XmlSerializer (typeof (History));
                XmlTextReader rdr = new XmlTextReader (path);
                result = (History) serializer.Deserialize (rdr);
                rdr.Close ();
            } catch (Exception) {
                result = new History ();
            }

            return result;
        }