Example #1
0
 public BrowserForm(MainForm theMainForm)
 {
     _theMainForm = theMainForm;
     InitializeComponent();
     //Load settings
     checkBox1.Checked = Program.Settings.ShowBrowser;
     Location = new Point(Program.Settings.Browser_X, Program.Settings.Browser_Y);
     Size = new Size(Program.Settings.Browser_W, Program.Settings.Browser_H);
     splitContainer1.SplitterDistance = Program.Settings.Container1;
     splitContainer2.SplitterDistance = Program.Settings.Container2;
     columnHeader1_Name.Width = Program.Settings.Column_Name;
     columnHeader2_Size.Width = Program.Settings.Column_Size;
     columnHeader3_Mapper.Width = Program.Settings.Column_Mapper;
     listView1.View = Program.Settings.View;
     switch (Program.Settings.View)
     {
         case View.Details:
             tilesToolStripMenuItem.Checked = false;
             detailsToolStripMenuItem.Checked = true;
             listToolStripMenuItem.Checked = false;
             break;
         case View.Tile:
             tilesToolStripMenuItem.Checked = true;
             detailsToolStripMenuItem.Checked = false;
             listToolStripMenuItem.Checked = false;
             break;
         case View.List:
             tilesToolStripMenuItem.Checked = false;
             detailsToolStripMenuItem.Checked = false;
             listToolStripMenuItem.Checked = true;
             break;
     }
     //Load folders
     if (Program.Settings.Folders == null)
         Program.Settings.Folders = new MFolderCollection();
     RefreshFolders();
 }
Example #2
0
 private static void Main(string[] args)
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     //Let's see if My Nes is running or not
     foreach (var process in Process.GetProcesses())
     {
         if (process.MainWindowTitle.Length >= "My Nes".Length)
         {
             if (process.MainWindowTitle.Substring(0, "My Nes".Length) == "My Nes" &
                 process != Process.GetCurrentProcess())
             {
                 process.CloseMainWindow(); //Kill the old one
                 break;
             }
         }
     }
     //Load settings
     Settings = new Settings();
     Settings.Reload();
     //Build control profile if it's the first time of launch
     Frm_ControlsSettings.BuildControlProfile();
     //Get paths..... I never trust the ./
     try
     {
         if (Settings.StateFloder.Substring(0, 2) == @".\")
         {
             Settings.StateFloder = Path.GetFullPath(Settings.StateFloder);
         }
         if (Settings.SnapshotsFolder.Substring(0, 2) == @".\")
         {
             Settings.SnapshotsFolder = Path.GetFullPath(Settings.SnapshotsFolder);
         }
     }
     catch
     {
     }
     //Load the main window
     MainForm = new MainForm(args);
     MainForm.LoadSettings();
     MainForm.ShowDialogs();
     Application.Run(MainForm);
 }