示例#1
0
 public MainForm(string rom_path)
 {
     this.settings = this.LoadSettings();
     this.InitializeComponent();
     Win32.MoveWindow(this.Handle, this.settings.WndRect.left, this.settings.WndRect.top, this.settings.WndRect.Width, this.settings.WndRect.Height, false);
     if (rom_path != null)
     {
         this.OpenTheROMFile(rom_path);
     }
     if (!this.settings.Maximized)
     {
         return;
     }
     this.WindowState = FormWindowState.Maximized;
 }
示例#2
0
 private MainForm.Settings LoadSettings()
 {
     try
     {
         XmlSerializer     xmlSerializer = new XmlSerializer(typeof(MainForm.Settings));
         FileStream        fileStream    = new FileStream(Application.StartupPath + "\\ge.xml", FileMode.Open);
         MainForm.Settings settings      = (MainForm.Settings)xmlSerializer.Deserialize((Stream)fileStream);
         fileStream.Close();
         return(settings);
     }
     catch (Exception ex)
     {
         System.Diagnostics.Debug.WriteLine(ex.Message);
     }
     return(new MainForm.Settings());
 }