1 using Mesen.GUI.Config;
2 using Mesen.GUI.Forms;
3 using System;
4 using System.Collections.Generic;
5 using System.ComponentModel;
6 using System.Data;
7 using System.Drawing;
8 using System.Linq;
9 using System.Text;
10 using System.Threading.Tasks;
11 using System.Windows.Forms;
12 
13 namespace Mesen.GUI.Debugger
14 {
15 	public partial class frmProfiler : BaseForm
16 	{
frmProfiler()17 		public frmProfiler()
18 		{
19 			InitializeComponent();
20 
21 			if(!DesignMode) {
22 				DebugWorkspaceManager.AutoLoadDbgFiles(true);
23 
24 				ctrlProfiler.RefreshData();
25 				tmrRefresh.Start();
26 
27 				if(!ConfigManager.Config.DebugInfo.ProfilerSize.IsEmpty) {
28 					this.StartPosition = FormStartPosition.Manual;
29 					this.Size = ConfigManager.Config.DebugInfo.ProfilerSize;
30 					this.Location = ConfigManager.Config.DebugInfo.ProfilerLocation;
31 				}
32 			}
33 		}
34 
OnFormClosing(FormClosingEventArgs e)35 		protected override void OnFormClosing(FormClosingEventArgs e)
36 		{
37 			base.OnFormClosing(e);
38 
39 			ConfigManager.Config.DebugInfo.ProfilerSize = this.WindowState != FormWindowState.Normal ? this.RestoreBounds.Size : this.Size;
40 			ConfigManager.Config.DebugInfo.ProfilerLocation = this.WindowState != FormWindowState.Normal ? this.RestoreBounds.Location : this.Location;
41 			ConfigManager.ApplyChanges();
42 		}
43 
tmrRefresh_Tick(object sender, EventArgs e)44 		private void tmrRefresh_Tick(object sender, EventArgs e)
45 		{
46 			ctrlProfiler.RefreshData();
47 		}
48 	}
49 }
50