2437 lines
80 KiB
C#
2437 lines
80 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Diagnostics;
|
|
using System.Drawing;
|
|
using System.IO;
|
|
using System.Threading;
|
|
using System.Windows.Forms;
|
|
using MLV;
|
|
using MMB;
|
|
using MyNes.Core;
|
|
using MyNes.Properties;
|
|
using SevenZip;
|
|
|
|
namespace MyNes;
|
|
|
|
public class FormLauncher : Form
|
|
{
|
|
private enum DBMode
|
|
{
|
|
ALL,
|
|
DATABASE,
|
|
NOTDB,
|
|
FILES,
|
|
MISSING
|
|
}
|
|
|
|
private GameInfoViewer gameInfoViewer;
|
|
|
|
private ImagesViewer imagesViewer_snaps;
|
|
|
|
private ImagesViewer imagesViewer_covers;
|
|
|
|
private InfoViewer infoViewer;
|
|
|
|
private string _generate_dbName;
|
|
|
|
private string _generate_dbPath;
|
|
|
|
private bool _generate_dbMakeNesCartEntries;
|
|
|
|
private Thread _generate_thread;
|
|
|
|
private string[] _assign_folders;
|
|
|
|
private bool _assign_subfolders;
|
|
|
|
private bool _assign_addFilesNotFound;
|
|
|
|
private bool _assign_update_entries_already_assigned;
|
|
|
|
private bool _thread_busy;
|
|
|
|
private FormGeneratingDatabase frmG;
|
|
|
|
private string currentPlayedGameId = "";
|
|
|
|
private int currentPlayedGameIndex = -1;
|
|
|
|
private int playTime;
|
|
|
|
private bool isPlayingGame;
|
|
|
|
private DBMode mode;
|
|
|
|
private int searchTimer = 3;
|
|
|
|
private bool performQuickSearch;
|
|
|
|
private string quickSearchText;
|
|
|
|
private bool performSearch;
|
|
|
|
private SearchRequestArgs searchArgs;
|
|
|
|
private string status;
|
|
|
|
private int progress;
|
|
|
|
private int selectionTimer;
|
|
|
|
private bool doSort;
|
|
|
|
private string sortColumnName;
|
|
|
|
private bool sortAZ;
|
|
|
|
private IContainer components;
|
|
|
|
private ToolStrip toolStrip1;
|
|
|
|
private SplitContainer splitContainer1;
|
|
|
|
private SplitContainer splitContainer2;
|
|
|
|
private ManagedListView managedListView1;
|
|
|
|
private ImageList imageList1;
|
|
|
|
private StatusStrip statusStrip1;
|
|
|
|
private ToolStripStatusLabel toolStripStatusLabel1;
|
|
|
|
private ImageList imageList_items;
|
|
|
|
private ToolStripButton toolStripButton1;
|
|
|
|
private ToolStripButton toolStripButton2;
|
|
|
|
private ToolStripSeparator toolStripSeparator1;
|
|
|
|
private System.Windows.Forms.Timer timer_play;
|
|
|
|
private ToolStripTextBox toolStripTextBox_find;
|
|
|
|
private ToolStripButton toolStripButton4;
|
|
|
|
private ToolStrip toolStrip2;
|
|
|
|
private ToolStripButton Button_mode_all;
|
|
|
|
private ToolStripButton Button_mode_database;
|
|
|
|
private ToolStripButton Button_mode_files;
|
|
|
|
private ToolStripButton Button_mode_missing;
|
|
|
|
private ToolStripButton Button_mode_notDB;
|
|
|
|
private System.Windows.Forms.Timer timer_search;
|
|
|
|
private ContextMenuStrip contextMenuStrip_list_main;
|
|
|
|
private ToolStripMenuItem playToolStripMenuItem;
|
|
|
|
private ContextMenuStrip contextMenuStrip_list_columns;
|
|
|
|
private ToolStripSeparator toolStripSeparator3;
|
|
|
|
private ToolStripMenuItem openFileLocationToolStripMenuItem;
|
|
|
|
private ToolStripButton toolStripButton5;
|
|
|
|
private ToolStripStatusLabel toolStripStatusLabel2;
|
|
|
|
private ToolStripStatusLabel StatusLabel;
|
|
|
|
private ToolStripProgressBar ProgressBar;
|
|
|
|
private System.Windows.Forms.Timer timer_progress;
|
|
|
|
private System.Windows.Forms.Timer timer_selection;
|
|
|
|
private ToolStripSeparator toolStripSeparator4;
|
|
|
|
private ToolStripButton toolStripButton6;
|
|
|
|
private ToolStripSplitButton toolStripSplitButton1;
|
|
|
|
private ToolStripMenuItem autoMinimizeToolStripMenuItem;
|
|
|
|
private ToolStripMenuItem cycleImagesOnGameInfoToolStripMenuItem;
|
|
|
|
private ToolStripMenuItem rememberSelectionToolStripMenuItem;
|
|
|
|
private ToolStripButton toolStripButton7;
|
|
|
|
private ToolStripSeparator toolStripSeparator2;
|
|
|
|
private ToolStripButton toolStripButton3;
|
|
|
|
private ToolStripSeparator toolStripSeparator5;
|
|
|
|
private ToolStripSeparator toolStripSeparator6;
|
|
|
|
private ToolStripLabel toolStripLabel1;
|
|
|
|
private ToolStripSeparator toolStripSeparator7;
|
|
|
|
private ToolStripButton toolStripButton8;
|
|
|
|
private ToolStripSeparator toolStripSeparator8;
|
|
|
|
private ToolStripMenuItem infoToolStripMenuItem;
|
|
|
|
private ToolStripButton toolStripButton9;
|
|
|
|
private ToolStripMenuItem deleteToolStripMenuItem;
|
|
|
|
private ToolStripSeparator toolStripSeparator9;
|
|
|
|
private ToolStripMenuItem showLauncherAtAppStartToolStripMenuItem;
|
|
|
|
private SplitContainer splitContainer3;
|
|
|
|
private GroupBox groupBox_game;
|
|
|
|
private GroupBox groupBox_info;
|
|
|
|
private SplitContainer splitContainer4;
|
|
|
|
private GroupBox groupBox_snapshots;
|
|
|
|
private GroupBox groupBox_covers;
|
|
|
|
private ToolStripSeparator toolStripSeparator10;
|
|
|
|
private ToolStripLabel toolStripLabel2;
|
|
|
|
public FormLauncher()
|
|
{
|
|
InitializeComponent();
|
|
base.Tag = "Launcher";
|
|
InitializeControls();
|
|
LoadSettings();
|
|
LoadDatabase();
|
|
NesEmu.EmuShutdown += NesEmu_EMUShutdown;
|
|
if (Program.Settings.LauncherRememberLastSelection && Program.Settings.LauncherLatestSelection >= 0 && Program.Settings.LauncherLatestSelection < managedListView1.Items.Count)
|
|
{
|
|
managedListView1.Items[Program.Settings.LauncherLatestSelection].Selected = true;
|
|
managedListView1.ScrollToItem(managedListView1.Items[Program.Settings.LauncherLatestSelection]);
|
|
selectionTimer = 3;
|
|
timer_selection.Start();
|
|
}
|
|
toolStripLabel2.Visible = Program.Settings.LauncherAutoMinimize;
|
|
}
|
|
|
|
private void InitializeControls()
|
|
{
|
|
gameInfoViewer = new GameInfoViewer();
|
|
imagesViewer_snaps = new ImagesViewer();
|
|
imagesViewer_covers = new ImagesViewer();
|
|
infoViewer = new InfoViewer();
|
|
gameInfoViewer.Dock = DockStyle.Fill;
|
|
gameInfoViewer.Location = new Point(3, 3);
|
|
gameInfoViewer.Name = "gameInfoViewer";
|
|
gameInfoViewer.Size = new Size(215, 175);
|
|
gameInfoViewer.TabIndex = 0;
|
|
gameInfoViewer.RatingChanged += gameInfoViewer_RatingChanged;
|
|
groupBox_game.Controls.Add(gameInfoViewer);
|
|
imagesViewer_snaps.Dock = DockStyle.Fill;
|
|
imagesViewer_snaps.Location = new Point(3, 3);
|
|
imagesViewer_snaps.MODE = DetectMode.SNAPS;
|
|
imagesViewer_snaps.Name = "imagesViewer_snaps";
|
|
imagesViewer_snaps.Size = new Size(215, 175);
|
|
imagesViewer_snaps.TabIndex = 0;
|
|
groupBox_snapshots.Controls.Add(imagesViewer_snaps);
|
|
imagesViewer_covers.Dock = DockStyle.Fill;
|
|
imagesViewer_covers.Location = new Point(3, 3);
|
|
imagesViewer_covers.MODE = DetectMode.COVERS;
|
|
imagesViewer_covers.Name = "imagesViewer_covers";
|
|
imagesViewer_covers.Size = new Size(215, 175);
|
|
imagesViewer_covers.TabIndex = 0;
|
|
groupBox_covers.Controls.Add(imagesViewer_covers);
|
|
infoViewer.Dock = DockStyle.Fill;
|
|
infoViewer.Location = new Point(3, 3);
|
|
infoViewer.Name = "infoViewer";
|
|
infoViewer.Size = new Size(215, 175);
|
|
infoViewer.TabIndex = 0;
|
|
groupBox_info.Controls.Add(infoViewer);
|
|
}
|
|
|
|
private void LoadSettings()
|
|
{
|
|
base.Location = new Point(Program.Settings.LauncherLocationX, Program.Settings.LauncherLocationY);
|
|
base.Size = new Size(Program.Settings.LauncherSizeW, Program.Settings.LauncherSizeH);
|
|
splitContainer1.SplitterDistance = Program.Settings.LauncherSpliter1;
|
|
splitContainer2.SplitterDistance = Program.Settings.LauncherSpliter2;
|
|
splitContainer3.SplitterDistance = Program.Settings.LauncherSpliter3;
|
|
splitContainer4.SplitterDistance = Program.Settings.LauncherSpliter4;
|
|
imagesViewer_covers.LoadSettings();
|
|
imagesViewer_snaps.LoadSettings();
|
|
}
|
|
|
|
private void SaveSettings()
|
|
{
|
|
Program.Settings.LauncherLocationX = base.Location.X;
|
|
Program.Settings.LauncherLocationY = base.Location.Y;
|
|
Program.Settings.LauncherSizeW = base.Size.Width;
|
|
Program.Settings.LauncherSizeH = base.Size.Height;
|
|
Program.Settings.LauncherSpliter1 = splitContainer1.SplitterDistance;
|
|
Program.Settings.LauncherSpliter2 = splitContainer2.SplitterDistance;
|
|
Program.Settings.LauncherSpliter3 = splitContainer3.SplitterDistance;
|
|
Program.Settings.LauncherSpliter4 = splitContainer4.SplitterDistance;
|
|
if (managedListView1.SelectedItems.Count > 0)
|
|
{
|
|
Program.Settings.LauncherLatestSelection = managedListView1.Items.IndexOf(managedListView1.SelectedItems[0]);
|
|
}
|
|
else
|
|
{
|
|
Program.Settings.LauncherLatestSelection = -1;
|
|
}
|
|
}
|
|
|
|
private void LoadDatabase()
|
|
{
|
|
if (Program.Settings.Database_FilePath == "")
|
|
{
|
|
Program.Settings.Database_FilePath = Path.Combine(Program.ApplicationFolder, "MyNesDatabase.mndb");
|
|
}
|
|
if (!File.Exists(Path.GetFullPath(Program.Settings.Database_FilePath)))
|
|
{
|
|
GenerateDatabase();
|
|
return;
|
|
}
|
|
MyNesDB.OpenDatabase(Path.GetFullPath(Program.Settings.Database_FilePath));
|
|
RefreshColumns();
|
|
RefreshEntries();
|
|
}
|
|
|
|
private void GenerateDatabase()
|
|
{
|
|
if (NesEmu.ON)
|
|
{
|
|
NesEmu.PAUSED = true;
|
|
}
|
|
FormCreateDatabase formCreateDatabase = new FormCreateDatabase();
|
|
if (formCreateDatabase.ShowDialog(this) == DialogResult.OK)
|
|
{
|
|
mode = DBMode.ALL;
|
|
Button_mode_all.Checked = true;
|
|
Button_mode_database.Checked = false;
|
|
Button_mode_files.Checked = false;
|
|
Button_mode_missing.Checked = false;
|
|
Button_mode_notDB.Checked = false;
|
|
_generate_dbName = formCreateDatabase.DBName;
|
|
_generate_dbPath = formCreateDatabase.DBPath;
|
|
_generate_dbMakeNesCartEntries = formCreateDatabase.DBGenerateNesCart;
|
|
_generate_thread = new Thread(GenerateDatabaseThreaded);
|
|
_generate_thread.CurrentUICulture = Thread.CurrentThread.CurrentUICulture;
|
|
_generate_thread.Start();
|
|
frmG = new FormGeneratingDatabase(isCenter: true);
|
|
frmG.ShowDialog(this);
|
|
}
|
|
}
|
|
|
|
private void GenerateDatabaseThreaded()
|
|
{
|
|
_thread_busy = true;
|
|
MyNesDB.CreateDatabase(_generate_dbName, _generate_dbPath);
|
|
if (_generate_dbMakeNesCartEntries)
|
|
{
|
|
GenerateEntriesFromNesCart();
|
|
}
|
|
RefreshColumnsThreaded();
|
|
RefreshEntriesThreaded();
|
|
CloseWorkFormThreaded();
|
|
}
|
|
|
|
private void GenerateEntriesFromNesCart()
|
|
{
|
|
Tracer.WriteLine(Resources.Status24);
|
|
int num = 0;
|
|
if (NesCartDatabase.DatabaseRoms == null)
|
|
{
|
|
return;
|
|
}
|
|
DataSet dataSet = MyNesDB.GetDataSet("GAMES");
|
|
for (int i = 0; i < NesCartDatabase.DatabaseRoms.Count; i++)
|
|
{
|
|
if (frmG.CancelRequest)
|
|
{
|
|
break;
|
|
}
|
|
MyNesDBEntryInfo entry = default(MyNesDBEntryInfo);
|
|
entry.IsDB = true;
|
|
entry.AlternativeName = NesCartDatabase.DatabaseRoms[i].Game_AltName;
|
|
if (NesCartDatabase.DatabaseRoms[i].Cartridges != null)
|
|
{
|
|
entry.BoardMapper = Convert.ToInt32(NesCartDatabase.DatabaseRoms[i].Cartridges[0].Board_Mapper);
|
|
foreach (NesCartDatabaseCartridgeInfo cartridge in NesCartDatabase.DatabaseRoms[i].Cartridges)
|
|
{
|
|
if (entry.BoardPcb != null)
|
|
{
|
|
if (!entry.BoardPcb.Contains(cartridge.Board_Pcb))
|
|
{
|
|
entry.BoardPcb = entry.BoardPcb + cartridge.Board_Pcb + ", ";
|
|
}
|
|
}
|
|
else
|
|
{
|
|
entry.BoardPcb = cartridge.Board_Pcb + ", ";
|
|
}
|
|
if (entry.BoardType != null)
|
|
{
|
|
if (!entry.BoardType.Contains(cartridge.Board_Type))
|
|
{
|
|
entry.BoardType = entry.BoardType + cartridge.Board_Type + ", ";
|
|
}
|
|
}
|
|
else
|
|
{
|
|
entry.BoardType = cartridge.Board_Type + ", ";
|
|
}
|
|
}
|
|
}
|
|
entry.Catalog = NesCartDatabase.DatabaseRoms[i].Game_Catalog;
|
|
entry.Class = NesCartDatabase.DatabaseRoms[i].Game_Class;
|
|
entry.Developer = NesCartDatabase.DatabaseRoms[i].Game_Developer;
|
|
entry.Name = NesCartDatabase.DatabaseRoms[i].Game_Name;
|
|
entry.Players = NesCartDatabase.DatabaseRoms[i].Game_Players;
|
|
entry.Publisher = NesCartDatabase.DatabaseRoms[i].Game_Publisher;
|
|
entry.Region = NesCartDatabase.DatabaseRoms[i].Game_Region;
|
|
entry.ReleaseDate = NesCartDatabase.DatabaseRoms[i].Game_ReleaseDate;
|
|
for (int j = 0; j < NesCartDatabase.DatabaseRoms[i].Cartridges.Count; j++)
|
|
{
|
|
entry.CRC = NesCartDatabase.DatabaseRoms[i].Cartridges[j].CRC;
|
|
entry.DateDumped = NesCartDatabase.DatabaseRoms[i].Cartridges[j].DateDumped;
|
|
entry.Dump = NesCartDatabase.DatabaseRoms[i].Cartridges[j].Dump;
|
|
entry.Dumper = NesCartDatabase.DatabaseRoms[i].Cartridges[j].Dumper;
|
|
entry.System = NesCartDatabase.DatabaseRoms[i].Cartridges[j].System;
|
|
entry.SHA1 = NesCartDatabase.DatabaseRoms[i].Cartridges[j].SHA1;
|
|
entry.Path = "N/A";
|
|
entry.Rating = 0;
|
|
entry.Size = 0;
|
|
entry.Played = 0;
|
|
entry.PlayTime = 0;
|
|
entry.LastPlayed = DateTimeFormater.ToFull(DateTime.MinValue);
|
|
DataRow row = dataSet.Tables[0].NewRow();
|
|
MyNesDB.SetEntryToRow(entry, row);
|
|
dataSet.Tables[0].Rows.Add(row);
|
|
}
|
|
num = i * 100 / NesCartDatabase.DatabaseRoms.Count;
|
|
frmG.WriteStatus(Resources.Status21 + " ... (" + num + "%)", Color.Black);
|
|
}
|
|
Tracer.WriteLine("..... " + Resources.Status22 + " .....");
|
|
MyNesDB.UpdateTableFromDataSet("GAMES", dataSet);
|
|
Tracer.WriteLine(Resources.Status23);
|
|
}
|
|
|
|
private void AssignFiles()
|
|
{
|
|
if (NesEmu.ON)
|
|
{
|
|
NesEmu.PAUSED = true;
|
|
}
|
|
FormAssignFilesToDB formAssignFilesToDB = new FormAssignFilesToDB();
|
|
if (formAssignFilesToDB.ShowDialog(this) == DialogResult.OK)
|
|
{
|
|
mode = DBMode.ALL;
|
|
Button_mode_all.Checked = true;
|
|
Button_mode_database.Checked = false;
|
|
Button_mode_files.Checked = false;
|
|
Button_mode_missing.Checked = false;
|
|
Button_mode_notDB.Checked = false;
|
|
_thread_busy = true;
|
|
_assign_folders = formAssignFilesToDB.FoldersToScan;
|
|
_assign_subfolders = formAssignFilesToDB.IncludeSubFolders;
|
|
_assign_addFilesNotFound = formAssignFilesToDB.AddFilesNotFound;
|
|
_assign_update_entries_already_assigned = formAssignFilesToDB.UpdateEntriesAlreadyAssigned;
|
|
_generate_thread = new Thread(AssignFilesThreaded);
|
|
_generate_thread.CurrentUICulture = Thread.CurrentThread.CurrentUICulture;
|
|
_generate_thread.Start();
|
|
frmG = new FormGeneratingDatabase(isCenter: false);
|
|
frmG.ShowDialog(this);
|
|
}
|
|
}
|
|
|
|
private void AssignFilesThreaded()
|
|
{
|
|
Tracer.WriteLine(Resources.Status25);
|
|
List<string> list = new List<string>();
|
|
string[] assign_folders = _assign_folders;
|
|
foreach (string path in assign_folders)
|
|
{
|
|
if (Directory.Exists(path))
|
|
{
|
|
list.AddRange(Directory.GetFiles(path, "*", _assign_subfolders ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly));
|
|
}
|
|
}
|
|
Tracer.WriteLine(Resources.Status26 + " " + list.Count + " " + Resources.Status27);
|
|
Tracer.WriteLine(Resources.Status28);
|
|
AddFiles(list.ToArray());
|
|
RefreshEntriesThreaded();
|
|
CloseWorkFormThreaded();
|
|
}
|
|
|
|
private void AddFiles(string[] files)
|
|
{
|
|
string obj = Path.GetTempPath() + "\\MYNES\\";
|
|
string filePath = obj + "fileTemp";
|
|
Directory.CreateDirectory(obj);
|
|
Tracer.WriteLine(Resources.Status29);
|
|
DataSet dataSet = MyNesDB.GetDataSet("GAMES");
|
|
foreach (string text in files)
|
|
{
|
|
if (frmG.CancelRequest)
|
|
{
|
|
break;
|
|
}
|
|
switch (Path.GetExtension(text).ToLower())
|
|
{
|
|
case ".nes":
|
|
{
|
|
INes nes2 = new INes();
|
|
nes2.Load(text, loadDumps: false);
|
|
bool flag2 = false;
|
|
for (int m = 0; m < dataSet.Tables[0].Rows.Count; m++)
|
|
{
|
|
if (!(dataSet.Tables[0].Rows[m]["SHA1"].ToString().ToLower() == nes2.SHA1.ToLower()) || !(bool)dataSet.Tables[0].Rows[m]["IsDB"])
|
|
{
|
|
continue;
|
|
}
|
|
string text3 = dataSet.Tables[0].Rows[m]["Path"].ToString().Replace("'", "'");
|
|
if (File.Exists(text3) && text3 != "")
|
|
{
|
|
if (_assign_update_entries_already_assigned)
|
|
{
|
|
dataSet.Tables[0].Rows[m]["Path"] = text.Replace("'", "'");
|
|
dataSet.Tables[0].Rows[m]["Size"] = GetFileSize(text);
|
|
Tracer.WriteLine(Resources.Status30 + ": [" + dataSet.Tables[0].Rows[m]["Name"].ToString() + "]");
|
|
}
|
|
else
|
|
{
|
|
Tracer.WriteLine(Resources.Status31 + ": [" + dataSet.Tables[0].Rows[m]["Name"].ToString() + "]");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
dataSet.Tables[0].Rows[m]["Path"] = text;
|
|
dataSet.Tables[0].Rows[m]["Size"] = GetFileSize(text);
|
|
Tracer.WriteLine(Resources.Status30 + ": [" + dataSet.Tables[0].Rows[m]["Name"].ToString() + "]");
|
|
}
|
|
flag2 = true;
|
|
break;
|
|
}
|
|
if (flag2 || !_assign_addFilesNotFound)
|
|
{
|
|
break;
|
|
}
|
|
flag2 = false;
|
|
for (int n = 0; n < dataSet.Tables[0].Rows.Count; n++)
|
|
{
|
|
if (dataSet.Tables[0].Rows[n]["Path"].ToString().Replace("'", "'") == text)
|
|
{
|
|
flag2 = true;
|
|
if (_assign_update_entries_already_assigned)
|
|
{
|
|
dataSet.Tables[0].Rows[n]["Path"] = text.Replace("'", "'");
|
|
dataSet.Tables[0].Rows[n]["Size"] = GetFileSize(text);
|
|
Tracer.WriteLine(Resources.Status30 + ": [" + dataSet.Tables[0].Rows[n]["Name"].ToString() + "]");
|
|
}
|
|
else
|
|
{
|
|
Tracer.WriteLine(Resources.Status31 + ": [" + dataSet.Tables[0].Rows[n]["Name"].ToString() + "]");
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
if (!flag2)
|
|
{
|
|
DataRow row2 = dataSet.Tables[0].NewRow();
|
|
MyNesDBEntryInfo entry2 = default(MyNesDBEntryInfo);
|
|
entry2.IsDB = false;
|
|
entry2.AlternativeName = "";
|
|
entry2.BoardMapper = (nes2.IsValid ? nes2.MapperNumber : 0);
|
|
entry2.BoardPcb = "";
|
|
entry2.BoardType = "";
|
|
entry2.Catalog = "";
|
|
entry2.Class = "";
|
|
entry2.Developer = "";
|
|
entry2.Name = Path.GetFileNameWithoutExtension(text);
|
|
entry2.Players = "";
|
|
entry2.Publisher = "";
|
|
entry2.Region = "";
|
|
entry2.ReleaseDate = "";
|
|
entry2.CRC = CalculateCRC(text, 16);
|
|
entry2.DateDumped = "";
|
|
entry2.Dump = "";
|
|
entry2.Dumper = "";
|
|
entry2.System = "";
|
|
entry2.SHA1 = nes2.SHA1.ToUpper();
|
|
entry2.Path = text;
|
|
entry2.Rating = 0;
|
|
entry2.Size = GetFileSize(text);
|
|
entry2.LastPlayed = DateTimeFormater.ToFull(DateTime.MinValue);
|
|
entry2.Played = 0;
|
|
entry2.PlayTime = 0;
|
|
MyNesDB.SetEntryToRow(entry2, row2);
|
|
dataSet.Tables[0].Rows.Add(row2);
|
|
Tracer.WriteLine(Resources.Status32 + ":[" + entry2.Name + "]");
|
|
}
|
|
break;
|
|
}
|
|
case ".7z":
|
|
case ".zip":
|
|
case ".rar":
|
|
case ".gzip":
|
|
case ".tar":
|
|
case ".bzip2":
|
|
case ".xz":
|
|
try
|
|
{
|
|
SevenZipExtractor sevenZipExtractor = new SevenZipExtractor(text);
|
|
Directory.CreateDirectory(Path.GetTempPath() + "\\MyNes\\");
|
|
string[] files2 = Directory.GetFiles(Path.GetTempPath() + "\\MyNes\\");
|
|
string[] array = files2;
|
|
for (int j = 0; j < array.Length; j++)
|
|
{
|
|
File.Delete(array[j]);
|
|
}
|
|
sevenZipExtractor.ExtractArchive(Path.GetTempPath() + "\\MyNes\\");
|
|
files2 = Directory.GetFiles(Path.GetTempPath() + "\\MyNes\\");
|
|
foreach (ArchiveFileInfo archiveFileDatum in sevenZipExtractor.ArchiveFileData)
|
|
{
|
|
if (!(Path.GetExtension(archiveFileDatum.FileName).ToLower() == ".nes"))
|
|
{
|
|
continue;
|
|
}
|
|
string text2 = "(" + archiveFileDatum.Index + ")" + text;
|
|
INes nes = new INes();
|
|
nes.Load(Path.GetTempPath() + "\\MyNes\\" + archiveFileDatum.FileName, loadDumps: false);
|
|
bool flag = false;
|
|
for (int k = 0; k < dataSet.Tables[0].Rows.Count; k++)
|
|
{
|
|
if (!(dataSet.Tables[0].Rows[k]["SHA1"].ToString().ToLower() == nes.SHA1.ToLower()) || !(bool)dataSet.Tables[0].Rows[k]["IsDB"])
|
|
{
|
|
continue;
|
|
}
|
|
string filePathFromArchivePath = GetFilePathFromArchivePath(dataSet.Tables[0].Rows[k]["Path"].ToString().Replace("'", "'"));
|
|
if (File.Exists(filePathFromArchivePath) && filePathFromArchivePath != "")
|
|
{
|
|
if (_assign_update_entries_already_assigned)
|
|
{
|
|
dataSet.Tables[0].Rows[k]["Path"] = text2;
|
|
dataSet.Tables[0].Rows[k]["Size"] = GetFileSize(filePath);
|
|
Tracer.WriteLine(Resources.Status30 + ": [" + dataSet.Tables[0].Rows[k]["Name"].ToString() + "]");
|
|
}
|
|
else
|
|
{
|
|
Tracer.WriteLine(Resources.Status31 + ": [" + dataSet.Tables[0].Rows[k]["Name"].ToString() + "]");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
dataSet.Tables[0].Rows[k]["Path"] = text2;
|
|
dataSet.Tables[0].Rows[k]["Size"] = GetFileSize(filePath);
|
|
Tracer.WriteLine(Resources.Status30 + ": [" + dataSet.Tables[0].Rows[k]["Name"].ToString() + "]");
|
|
}
|
|
flag = true;
|
|
break;
|
|
}
|
|
if (flag || !_assign_addFilesNotFound)
|
|
{
|
|
continue;
|
|
}
|
|
flag = false;
|
|
for (int l = 0; l < dataSet.Tables[0].Rows.Count; l++)
|
|
{
|
|
if (dataSet.Tables[0].Rows[l]["Path"].ToString().Replace("'", "'") == text2)
|
|
{
|
|
flag = true;
|
|
if (_assign_update_entries_already_assigned)
|
|
{
|
|
dataSet.Tables[0].Rows[l]["Path"] = text2;
|
|
dataSet.Tables[0].Rows[l]["Size"] = GetFileSize(filePath);
|
|
Tracer.WriteLine(Resources.Status30 + ": [" + dataSet.Tables[0].Rows[l]["Name"].ToString() + "]");
|
|
}
|
|
else
|
|
{
|
|
Tracer.WriteLine(Resources.Status31 + ": [" + dataSet.Tables[0].Rows[l]["Name"].ToString() + "]");
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
if (!flag)
|
|
{
|
|
DataRow row = dataSet.Tables[0].NewRow();
|
|
MyNesDBEntryInfo entry = default(MyNesDBEntryInfo);
|
|
entry.IsDB = false;
|
|
entry.AlternativeName = "";
|
|
entry.BoardMapper = (nes.IsValid ? nes.MapperNumber : 0);
|
|
entry.BoardPcb = "";
|
|
entry.BoardType = "";
|
|
entry.Catalog = "";
|
|
entry.Class = "";
|
|
entry.Developer = "";
|
|
entry.Name = Path.GetFileNameWithoutExtension(archiveFileDatum.FileName);
|
|
entry.Players = "";
|
|
entry.Publisher = "";
|
|
entry.Region = "";
|
|
entry.ReleaseDate = "";
|
|
entry.CRC = CalculateCRC(filePath, 16);
|
|
entry.DateDumped = "";
|
|
entry.Dump = "";
|
|
entry.Dumper = "";
|
|
entry.System = "";
|
|
entry.SHA1 = nes.SHA1.ToUpper();
|
|
entry.Path = text2;
|
|
entry.Rating = 0;
|
|
entry.Size = GetFileSize(filePath);
|
|
entry.LastPlayed = DateTimeFormater.ToFull(DateTime.MinValue);
|
|
entry.Played = 0;
|
|
entry.PlayTime = 0;
|
|
MyNesDB.SetEntryToRow(entry, row);
|
|
dataSet.Tables[0].Rows.Add(row);
|
|
Tracer.WriteLine(Resources.Status32 + ":[" + entry.Name + "]");
|
|
}
|
|
}
|
|
array = files2;
|
|
for (int j = 0; j < array.Length; j++)
|
|
{
|
|
File.Delete(array[j]);
|
|
}
|
|
}
|
|
catch
|
|
{
|
|
Tracer.WriteLine(Resources.Status33 + " [" + text + "] " + Resources.Status34);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
Tracer.WriteLine(".... " + Resources.Status22 + " ....");
|
|
MyNesDB.UpdateTableFromDataSet("GAMES", dataSet);
|
|
}
|
|
|
|
private void CloseWorkFormThreaded()
|
|
{
|
|
if (!base.InvokeRequired)
|
|
{
|
|
CloseWorkForm();
|
|
}
|
|
else
|
|
{
|
|
Invoke(new Action(CloseWorkForm));
|
|
}
|
|
}
|
|
|
|
private void CloseWorkForm()
|
|
{
|
|
frmG.Close();
|
|
ClearViewers();
|
|
_thread_busy = false;
|
|
}
|
|
|
|
private void RefreshColumnsThreaded()
|
|
{
|
|
if (!base.InvokeRequired)
|
|
{
|
|
RefreshColumns();
|
|
}
|
|
else
|
|
{
|
|
Invoke(new Action(RefreshColumns));
|
|
}
|
|
}
|
|
|
|
private void RefreshColumns()
|
|
{
|
|
managedListView1.Columns.Clear();
|
|
contextMenuStrip_list_columns.Items.Clear();
|
|
MyNesDBColumn[] columns = MyNesDB.GetColumns();
|
|
for (int i = 0; i < columns.Length; i++)
|
|
{
|
|
MyNesDBColumn myNesDBColumn = columns[i];
|
|
if (myNesDBColumn.Visible)
|
|
{
|
|
ManagedListViewColumn managedListViewColumn = new ManagedListViewColumn();
|
|
managedListViewColumn.HeaderText = myNesDBColumn.Name;
|
|
managedListViewColumn.ID = myNesDBColumn.Name;
|
|
managedListViewColumn.Width = myNesDBColumn.Width;
|
|
managedListView1.Columns.Add(managedListViewColumn);
|
|
}
|
|
ToolStripMenuItem toolStripMenuItem = new ToolStripMenuItem();
|
|
toolStripMenuItem.Text = myNesDBColumn.Name;
|
|
toolStripMenuItem.Checked = myNesDBColumn.Visible;
|
|
contextMenuStrip_list_columns.Items.Add(toolStripMenuItem);
|
|
}
|
|
}
|
|
|
|
private void RefreshEntriesThreaded()
|
|
{
|
|
if (!base.InvokeRequired)
|
|
{
|
|
RefreshEntries();
|
|
}
|
|
else
|
|
{
|
|
Invoke(new Action(RefreshEntries));
|
|
}
|
|
}
|
|
|
|
private void RefreshEntries()
|
|
{
|
|
managedListView1.Items.Clear();
|
|
bool flag = false;
|
|
bool flag2 = false;
|
|
bool flag3 = false;
|
|
bool flag4 = false;
|
|
DataSet dataSet = null;
|
|
dataSet = (doSort ? MyNesDB.GetDataSet("GAMES", sortColumnName, sortAZ) : MyNesDB.GetDataSet("GAMES"));
|
|
switch (mode)
|
|
{
|
|
case DBMode.DATABASE:
|
|
flag3 = true;
|
|
flag4 = true;
|
|
break;
|
|
case DBMode.NOTDB:
|
|
flag3 = true;
|
|
flag4 = false;
|
|
break;
|
|
case DBMode.FILES:
|
|
flag = true;
|
|
flag2 = true;
|
|
break;
|
|
case DBMode.MISSING:
|
|
flag = true;
|
|
flag2 = false;
|
|
break;
|
|
}
|
|
doSort = false;
|
|
if (dataSet == null)
|
|
{
|
|
return;
|
|
}
|
|
MyNesDBColumn[] columns = MyNesDB.GetColumns();
|
|
for (int i = 0; i < dataSet.Tables[0].Rows.Count; i++)
|
|
{
|
|
string text = dataSet.Tables[0].Rows[i]["Path"].ToString().Replace("'", "'");
|
|
if (text.StartsWith("("))
|
|
{
|
|
text = GetFilePathFromArchivePath(text);
|
|
}
|
|
if (flag3)
|
|
{
|
|
if (flag4)
|
|
{
|
|
if (dataSet.Tables[0].Rows[i]["IsDB"].ToString().Replace("'", "'") != "True")
|
|
{
|
|
continue;
|
|
}
|
|
}
|
|
else if (dataSet.Tables[0].Rows[i]["IsDB"].ToString().Replace("'", "'") != "False")
|
|
{
|
|
continue;
|
|
}
|
|
}
|
|
if (flag)
|
|
{
|
|
if (flag2)
|
|
{
|
|
if (!File.Exists(text))
|
|
{
|
|
continue;
|
|
}
|
|
}
|
|
else if (File.Exists(text))
|
|
{
|
|
continue;
|
|
}
|
|
}
|
|
if (performQuickSearch)
|
|
{
|
|
if (quickSearchText.Length > 0 && !dataSet.Tables[0].Rows[i]["Name"].ToString().Replace("'", "'").ToLower()
|
|
.Contains(quickSearchText.ToLower()))
|
|
{
|
|
continue;
|
|
}
|
|
}
|
|
else if (performSearch && !FilterGame(dataSet.Tables[0].Rows[i]))
|
|
{
|
|
continue;
|
|
}
|
|
ManagedListViewItem managedListViewItem = new ManagedListViewItem();
|
|
managedListViewItem.Tag = dataSet.Tables[0].Rows[i]["Id"].ToString();
|
|
MyNesDBColumn[] array = columns;
|
|
for (int j = 0; j < array.Length; j++)
|
|
{
|
|
MyNesDBColumn myNesDBColumn = array[j];
|
|
if (myNesDBColumn.Name == "Rating")
|
|
{
|
|
ManagedListViewRatingSubItem managedListViewRatingSubItem = new ManagedListViewRatingSubItem();
|
|
managedListViewRatingSubItem.ColumnID = myNesDBColumn.Name;
|
|
int result = 0;
|
|
int.TryParse(dataSet.Tables[0].Rows[i][myNesDBColumn.Name].ToString(), out result);
|
|
managedListViewRatingSubItem.Rating = result;
|
|
managedListViewRatingSubItem.RatingChanged += rat_RatingChanged;
|
|
managedListViewItem.SubItems.Add(managedListViewRatingSubItem);
|
|
}
|
|
else if (myNesDBColumn.Name == "Played")
|
|
{
|
|
ManagedListViewSubItem managedListViewSubItem = new ManagedListViewSubItem();
|
|
managedListViewSubItem.ColumnID = myNesDBColumn.Name;
|
|
string text2 = dataSet.Tables[0].Rows[i][myNesDBColumn.Name].ToString();
|
|
if (text2 == "0")
|
|
{
|
|
managedListViewSubItem.Text = Resources.Text0;
|
|
}
|
|
else if (text2 == "1")
|
|
{
|
|
managedListViewSubItem.Text = Resources.Text1;
|
|
}
|
|
else
|
|
{
|
|
managedListViewSubItem.Text = text2 + " " + Resources.Text2;
|
|
}
|
|
managedListViewItem.SubItems.Add(managedListViewSubItem);
|
|
}
|
|
else if (myNesDBColumn.Name == "Play Time")
|
|
{
|
|
ManagedListViewSubItem managedListViewSubItem2 = new ManagedListViewSubItem();
|
|
managedListViewSubItem2.ColumnID = myNesDBColumn.Name;
|
|
string text3 = dataSet.Tables[0].Rows[i][myNesDBColumn.Name].ToString();
|
|
if (text3 == "0")
|
|
{
|
|
managedListViewSubItem2.Text = Resources.Text0;
|
|
}
|
|
else
|
|
{
|
|
int result2 = 0;
|
|
int.TryParse(text3, out result2);
|
|
managedListViewSubItem2.Text = TimeSpan.FromSeconds(result2).ToString();
|
|
}
|
|
managedListViewItem.SubItems.Add(managedListViewSubItem2);
|
|
}
|
|
else if (myNesDBColumn.Name == "Last Played")
|
|
{
|
|
ManagedListViewSubItem managedListViewSubItem3 = new ManagedListViewSubItem();
|
|
managedListViewSubItem3.ColumnID = myNesDBColumn.Name;
|
|
DateTime dateTime = (DateTime)dataSet.Tables[0].Rows[i][myNesDBColumn.Name];
|
|
if (dateTime != DateTime.MinValue)
|
|
{
|
|
managedListViewSubItem3.Text = dateTime.ToLocalTime().ToString();
|
|
}
|
|
else
|
|
{
|
|
managedListViewSubItem3.Text = Resources.Text0;
|
|
}
|
|
managedListViewItem.SubItems.Add(managedListViewSubItem3);
|
|
}
|
|
else if (myNesDBColumn.Name == "Size")
|
|
{
|
|
ManagedListViewSubItem managedListViewSubItem4 = new ManagedListViewSubItem();
|
|
managedListViewSubItem4.ColumnID = myNesDBColumn.Name;
|
|
int result3 = 0;
|
|
int.TryParse(dataSet.Tables[0].Rows[i]["Size"].ToString(), out result3);
|
|
managedListViewSubItem4.Text = GetSize(result3);
|
|
managedListViewItem.SubItems.Add(managedListViewSubItem4);
|
|
}
|
|
else
|
|
{
|
|
ManagedListViewSubItem managedListViewSubItem5 = new ManagedListViewSubItem();
|
|
managedListViewSubItem5.ColumnID = myNesDBColumn.Name;
|
|
if (myNesDBColumn.Name == "Name")
|
|
{
|
|
managedListViewSubItem5.DrawMode = ManagedListViewItemDrawMode.TextAndImage;
|
|
managedListViewSubItem5.ImageIndex = (File.Exists(text) ? 1 : 0);
|
|
}
|
|
managedListViewSubItem5.Text = dataSet.Tables[0].Rows[i][myNesDBColumn.Name].ToString().Replace("'", "'");
|
|
managedListViewItem.SubItems.Add(managedListViewSubItem5);
|
|
}
|
|
}
|
|
managedListView1.Items.Add(managedListViewItem);
|
|
}
|
|
performQuickSearch = false;
|
|
quickSearchText = "";
|
|
performSearch = false;
|
|
}
|
|
|
|
private void Detect()
|
|
{
|
|
if (_thread_busy)
|
|
{
|
|
ManagedMessageBox.ShowErrorMessage(Resources.Message37);
|
|
return;
|
|
}
|
|
if (!MyNesDB.IsDatabaseLoaded)
|
|
{
|
|
ManagedMessageBox.ShowErrorMessage(Resources.Message38);
|
|
return;
|
|
}
|
|
if (NesEmu.ON)
|
|
{
|
|
NesEmu.PAUSED = true;
|
|
}
|
|
FormDetectSelection formDetectSelection = new FormDetectSelection();
|
|
if (formDetectSelection.ShowDialog(this) == DialogResult.OK)
|
|
{
|
|
new FormDetectForDatabase(formDetectSelection.MODE).ShowDialog(this);
|
|
}
|
|
}
|
|
|
|
private bool FilterGame(DataRow row)
|
|
{
|
|
if (searchArgs == null)
|
|
{
|
|
return false;
|
|
}
|
|
string text = (searchArgs.CaseSensitive ? searchArgs.SearchWhat : searchArgs.SearchWhat.ToLower());
|
|
if (!searchArgs.IsNumber)
|
|
{
|
|
string text2 = row[searchArgs.SearchColumn].ToString().Replace("'", "'");
|
|
if (!searchArgs.CaseSensitive)
|
|
{
|
|
text2 = text2.ToLower();
|
|
}
|
|
if (searchArgs.SearchColumn == "Path" && text2.StartsWith("("))
|
|
{
|
|
text2 = text2.Split('(', ')')[2];
|
|
}
|
|
string[] array = text.Split('+');
|
|
switch (searchArgs.TextCondition)
|
|
{
|
|
case TextSearchCondition.Contains:
|
|
{
|
|
string[] array2 = array;
|
|
foreach (string value5 in array2)
|
|
{
|
|
if (text2.Contains(value5))
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
case TextSearchCondition.DoesNotContain:
|
|
{
|
|
bool result2 = true;
|
|
string[] array2 = array;
|
|
foreach (string value2 in array2)
|
|
{
|
|
if (text2.Contains(value2))
|
|
{
|
|
result2 = false;
|
|
break;
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
case TextSearchCondition.Is:
|
|
{
|
|
string[] array2 = array;
|
|
foreach (string text3 in array2)
|
|
{
|
|
if (text2 == text3)
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
case TextSearchCondition.IsNot:
|
|
{
|
|
bool result4 = true;
|
|
string[] array2 = array;
|
|
foreach (string text4 in array2)
|
|
{
|
|
if (text2 == text4)
|
|
{
|
|
result4 = false;
|
|
break;
|
|
}
|
|
}
|
|
return result4;
|
|
}
|
|
case TextSearchCondition.StartWith:
|
|
{
|
|
string[] array2 = array;
|
|
foreach (string value3 in array2)
|
|
{
|
|
if (text2.StartsWith(value3))
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
case TextSearchCondition.DoesNotStartWith:
|
|
{
|
|
bool result3 = true;
|
|
string[] array2 = array;
|
|
foreach (string value6 in array2)
|
|
{
|
|
if (text2.StartsWith(value6))
|
|
{
|
|
result3 = false;
|
|
break;
|
|
}
|
|
}
|
|
return result3;
|
|
}
|
|
case TextSearchCondition.EndWith:
|
|
{
|
|
string[] array2 = array;
|
|
foreach (string value4 in array2)
|
|
{
|
|
if (text2.EndsWith(value4))
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
case TextSearchCondition.DoesNotEndWith:
|
|
{
|
|
bool result = true;
|
|
string[] array2 = array;
|
|
foreach (string value in array2)
|
|
{
|
|
if (text2.EndsWith(value))
|
|
{
|
|
result = false;
|
|
break;
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
long result5 = 0L;
|
|
if (searchArgs.SearchColumn == "Size")
|
|
{
|
|
result5 = DecodeSizeLabel(row["Size"].ToString());
|
|
}
|
|
else
|
|
{
|
|
long.TryParse(row[searchArgs.SearchColumn].ToString(), out result5);
|
|
}
|
|
long num = DecodeSizeLabel(text);
|
|
switch (searchArgs.NumberCondition)
|
|
{
|
|
case NumberSearchCondition.Equal:
|
|
if (result5 == num)
|
|
{
|
|
return true;
|
|
}
|
|
break;
|
|
case NumberSearchCondition.DoesNotEqual:
|
|
if (result5 != num)
|
|
{
|
|
return true;
|
|
}
|
|
break;
|
|
case NumberSearchCondition.EqualSmaller:
|
|
if (result5 <= num)
|
|
{
|
|
return true;
|
|
}
|
|
break;
|
|
case NumberSearchCondition.EuqalLarger:
|
|
if (result5 >= num)
|
|
{
|
|
return true;
|
|
}
|
|
break;
|
|
case NumberSearchCondition.Larger:
|
|
if (result5 > num)
|
|
{
|
|
return true;
|
|
}
|
|
break;
|
|
case NumberSearchCondition.Smaller:
|
|
if (result5 < num)
|
|
{
|
|
return true;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
private void AfterColumnResizeUpdateThreaded()
|
|
{
|
|
status = Resources.Status35;
|
|
if (MyNesDB.IsDatabaseLoaded)
|
|
{
|
|
int num = 0;
|
|
foreach (ManagedListViewColumn column in managedListView1.Columns)
|
|
{
|
|
MyNesDB.UpdateColumn(column.ID, colVisible: true, column.Width);
|
|
progress = num * 100 / managedListView1.Columns.Count;
|
|
num++;
|
|
}
|
|
}
|
|
status = Resources.Status36;
|
|
CloseStatus();
|
|
_thread_busy = false;
|
|
}
|
|
|
|
private void AfterColumnReorderUpdateThreaded()
|
|
{
|
|
if (MyNesDB.IsDatabaseLoaded)
|
|
{
|
|
status = Resources.Status35;
|
|
List<MyNesDBColumn> list = new List<MyNesDBColumn>(MyNesDB.GetColumns());
|
|
MyNesDB.DeleteAllColumns();
|
|
int num = 0;
|
|
foreach (ManagedListViewColumn column in managedListView1.Columns)
|
|
{
|
|
foreach (MyNesDBColumn item in list)
|
|
{
|
|
if (column.ID == item.Name)
|
|
{
|
|
list.Remove(item);
|
|
break;
|
|
}
|
|
}
|
|
MyNesDB.AddColumn(column.ID, colVisible: true, column.Width);
|
|
progress = num * 100 / managedListView1.Columns.Count;
|
|
num++;
|
|
}
|
|
foreach (MyNesDBColumn item2 in list)
|
|
{
|
|
MyNesDB.AddColumn(item2.Name, colVisible: false, item2.Width);
|
|
}
|
|
}
|
|
managedListView1.AllowColumnsReorder = true;
|
|
status = Resources.Status36;
|
|
CloseStatus();
|
|
_thread_busy = false;
|
|
}
|
|
|
|
private void CloseStatus()
|
|
{
|
|
if (!base.InvokeRequired)
|
|
{
|
|
CloseStatusThreaded();
|
|
}
|
|
else
|
|
{
|
|
Invoke(new Action(CloseStatusThreaded));
|
|
}
|
|
}
|
|
|
|
private void CloseStatusThreaded()
|
|
{
|
|
timer_progress.Stop();
|
|
ProgressBar.Visible = false;
|
|
StatusLabel.Text = Resources.Done;
|
|
}
|
|
|
|
private void UpdateSelection()
|
|
{
|
|
toolStripStatusLabel1.Text = managedListView1.SelectedItems.Count + " / " + managedListView1.Items.Count;
|
|
if (managedListView1.SelectedItems.Count == 1)
|
|
{
|
|
string id = managedListView1.SelectedItems[0].Tag.ToString();
|
|
gameInfoViewer.RefreshForEntry(id);
|
|
imagesViewer_covers.RefreshForEntry(id);
|
|
imagesViewer_snaps.RefreshForEntry(id);
|
|
infoViewer.RefreshForEntry(id);
|
|
}
|
|
else
|
|
{
|
|
ClearViewers();
|
|
}
|
|
}
|
|
|
|
private void ClearViewers()
|
|
{
|
|
gameInfoViewer.RefreshForEntry("");
|
|
imagesViewer_covers.RefreshForEntry("");
|
|
imagesViewer_snaps.RefreshForEntry("");
|
|
infoViewer.RefreshForEntry("");
|
|
}
|
|
|
|
private void ReturnToNormalWindowState()
|
|
{
|
|
if (base.Visible)
|
|
{
|
|
base.WindowState = FormWindowState.Normal;
|
|
}
|
|
}
|
|
|
|
private void PlaySelected()
|
|
{
|
|
if (managedListView1.SelectedItems.Count != 1)
|
|
{
|
|
ManagedMessageBox.ShowErrorMessage(Resources.Message39);
|
|
return;
|
|
}
|
|
string id = managedListView1.SelectedItems[0].Tag.ToString();
|
|
bool flag = false;
|
|
string text = MyNesDB.GetEntry(id).Path;
|
|
string text2 = text;
|
|
int index = 0;
|
|
if (text.StartsWith("("))
|
|
{
|
|
flag = true;
|
|
index = GetFileIndexFromArchivePath(text);
|
|
text = GetFilePathFromArchivePath(text);
|
|
}
|
|
if (flag)
|
|
{
|
|
string obj = Path.GetTempPath() + "\\MYNES\\";
|
|
Directory.CreateDirectory(obj);
|
|
SevenZipExtractor sevenZipExtractor = new SevenZipExtractor(text);
|
|
text2 = obj + sevenZipExtractor.ArchiveFileData[index].FileName;
|
|
Stream stream = new FileStream(text2, FileMode.Create, FileAccess.Write);
|
|
sevenZipExtractor.ExtractFile(index, stream);
|
|
stream.Close();
|
|
}
|
|
if (File.Exists(text2))
|
|
{
|
|
if (NesEmu.ON)
|
|
{
|
|
UpdatePlayStatus();
|
|
}
|
|
currentPlayedGameIndex = managedListView1.Items.IndexOf(managedListView1.SelectedItems[0]);
|
|
currentPlayedGameId = id;
|
|
Program.FormMain.LoadGame(text2);
|
|
Program.FormMain.Activate();
|
|
if (NesEmu.ON)
|
|
{
|
|
isPlayingGame = true;
|
|
playTime = 0;
|
|
timer_play.Start();
|
|
if (Program.Settings.LauncherAutoMinimize)
|
|
{
|
|
base.WindowState = FormWindowState.Minimized;
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
ManagedMessageBox.ShowErrorMessage(Resources.Message40);
|
|
}
|
|
}
|
|
|
|
private void UpdatePlayStatus()
|
|
{
|
|
if (!isPlayingGame || currentPlayedGameId == "")
|
|
{
|
|
return;
|
|
}
|
|
timer_play.Stop();
|
|
Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentUICulture;
|
|
MyNesDBEntryInfo entry = MyNesDB.GetEntry(currentPlayedGameId);
|
|
entry.Played++;
|
|
entry.PlayTime += playTime;
|
|
DateTime now = DateTime.Now;
|
|
MyNesDB.UpdateEntry(currentPlayedGameId, entry.Played, entry.PlayTime, now);
|
|
if (currentPlayedGameIndex >= 0 && currentPlayedGameIndex < managedListView1.Items.Count && managedListView1.Items[currentPlayedGameIndex].Tag.ToString() == currentPlayedGameId)
|
|
{
|
|
if (entry.Played == 0)
|
|
{
|
|
managedListView1.Items[currentPlayedGameIndex].GetSubItemByID("Played").Text = Resources.Text0;
|
|
}
|
|
else if (entry.Played == 1)
|
|
{
|
|
managedListView1.Items[currentPlayedGameIndex].GetSubItemByID("Played").Text = Resources.Text1;
|
|
}
|
|
else
|
|
{
|
|
managedListView1.Items[currentPlayedGameIndex].GetSubItemByID("Played").Text = entry.Played + " " + Resources.Text2;
|
|
}
|
|
if (entry.PlayTime == 0)
|
|
{
|
|
managedListView1.Items[currentPlayedGameIndex].GetSubItemByID("Play Time").Text = Resources.Text0;
|
|
}
|
|
else
|
|
{
|
|
managedListView1.Items[currentPlayedGameIndex].GetSubItemByID("Play Time").Text = TimeSpan.FromSeconds(entry.PlayTime).ToString();
|
|
}
|
|
if (now != DateTime.MinValue)
|
|
{
|
|
managedListView1.Items[currentPlayedGameIndex].GetSubItemByID("Last Played").Text = now.ToLocalTime().ToString();
|
|
}
|
|
else
|
|
{
|
|
managedListView1.Items[currentPlayedGameIndex].GetSubItemByID("Last Played").Text = Resources.Text0;
|
|
}
|
|
}
|
|
isPlayingGame = false;
|
|
_thread_busy = false;
|
|
currentPlayedGameId = "";
|
|
currentPlayedGameIndex = -1;
|
|
}
|
|
|
|
private string GetFilePathFromArchivePath(string arFile)
|
|
{
|
|
if (arFile.StartsWith("("))
|
|
{
|
|
for (int i = 0; i < arFile.Length; i++)
|
|
{
|
|
if (arFile[i] == ')')
|
|
{
|
|
i++;
|
|
return arFile.Substring(i, arFile.Length - i);
|
|
}
|
|
}
|
|
return "";
|
|
}
|
|
return arFile;
|
|
}
|
|
|
|
private int GetFileIndexFromArchivePath(string arFile)
|
|
{
|
|
if (arFile.StartsWith("("))
|
|
{
|
|
for (int i = 0; i < arFile.Length; i++)
|
|
{
|
|
if (arFile[i] == ')')
|
|
{
|
|
string s = arFile.Substring(1, i - 1);
|
|
int result = -1;
|
|
int.TryParse(s, out result);
|
|
return result;
|
|
}
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
private string GetFileSizeLabel(string FilePath)
|
|
{
|
|
if (File.Exists(Path.GetFullPath(FilePath)))
|
|
{
|
|
FileInfo fileInfo = new FileInfo(FilePath);
|
|
string text = " Byte";
|
|
double num = fileInfo.Length;
|
|
if (fileInfo.Length >= 1024)
|
|
{
|
|
num = (double)fileInfo.Length / 1024.0;
|
|
text = " KB";
|
|
}
|
|
if (num >= 1024.0)
|
|
{
|
|
num /= 1024.0;
|
|
text = " MB";
|
|
}
|
|
if (num >= 1024.0)
|
|
{
|
|
num /= 1024.0;
|
|
text = " GB";
|
|
}
|
|
return num.ToString("F2") + text;
|
|
}
|
|
return "";
|
|
}
|
|
|
|
private int GetFileSize(string FilePath)
|
|
{
|
|
if (File.Exists(Path.GetFullPath(FilePath)))
|
|
{
|
|
return (int)new FileInfo(FilePath).Length;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
private string GetSize(long size)
|
|
{
|
|
string text = " Byte";
|
|
double num = size;
|
|
if (size >= 1024)
|
|
{
|
|
num = (double)size / 1024.0;
|
|
text = " KB";
|
|
}
|
|
if (num >= 1024.0)
|
|
{
|
|
num /= 1024.0;
|
|
text = " MB";
|
|
}
|
|
if (num >= 1024.0)
|
|
{
|
|
num /= 1024.0;
|
|
text = " GB";
|
|
}
|
|
if (num < 0.0)
|
|
{
|
|
return "???";
|
|
}
|
|
return num.ToString("F2") + text;
|
|
}
|
|
|
|
private string CalculateCRC(string filePath, int bytesToSkip)
|
|
{
|
|
if (File.Exists(filePath))
|
|
{
|
|
Stream stream = new FileStream(filePath, FileMode.Open, FileAccess.Read);
|
|
stream.Read(new byte[bytesToSkip], 0, bytesToSkip);
|
|
byte[] buffer = new byte[stream.Length - bytesToSkip];
|
|
stream.Read(buffer, 0, (int)(stream.Length - bytesToSkip));
|
|
stream.Close();
|
|
string text = "";
|
|
byte[] array = new Crc32().ComputeHash(buffer);
|
|
foreach (byte b in array)
|
|
{
|
|
text += b.ToString("x2").ToLower();
|
|
}
|
|
return text;
|
|
}
|
|
return "";
|
|
}
|
|
|
|
private long DecodeSizeLabel(string sizeLabel)
|
|
{
|
|
string s = sizeLabel.ToLower().Replace("kb", "").Replace("mb", "")
|
|
.Replace("gb", "")
|
|
.Replace(" ", "");
|
|
double result = 0.0;
|
|
double.TryParse(s, out result);
|
|
if (sizeLabel.ToLower().Contains("kb"))
|
|
{
|
|
result *= 1024.0;
|
|
}
|
|
else if (sizeLabel.ToLower().Contains("mb"))
|
|
{
|
|
result *= 1048576.0;
|
|
}
|
|
else if (sizeLabel.ToLower().Contains("gb"))
|
|
{
|
|
result *= 1073741824.0;
|
|
}
|
|
return (long)result;
|
|
}
|
|
|
|
private void rat_RatingChanged(object sender, ManagedListViewRatingChangedArgs e)
|
|
{
|
|
if (MyNesDB.IsDatabaseLoaded)
|
|
{
|
|
MyNesDB.UpdateEntry(managedListView1.Items[e.ItemIndex].Tag.ToString(), e.Rating);
|
|
}
|
|
}
|
|
|
|
private void managedListView1_AfterColumnReorder(object sender, EventArgs e)
|
|
{
|
|
if (!_thread_busy)
|
|
{
|
|
timer_progress.Start();
|
|
ProgressBar.Visible = true;
|
|
managedListView1.AllowColumnsReorder = false;
|
|
_thread_busy = true;
|
|
Thread thread = new Thread(AfterColumnReorderUpdateThreaded);
|
|
thread.CurrentUICulture = Thread.CurrentThread.CurrentUICulture;
|
|
thread.Start();
|
|
}
|
|
}
|
|
|
|
private void managedListView1_AfterColumnResize(object sender, EventArgs e)
|
|
{
|
|
if (!_thread_busy)
|
|
{
|
|
timer_progress.Start();
|
|
ProgressBar.Visible = true;
|
|
_thread_busy = true;
|
|
Thread thread = new Thread(AfterColumnResizeUpdateThreaded);
|
|
thread.CurrentUICulture = Thread.CurrentThread.CurrentUICulture;
|
|
thread.Start();
|
|
}
|
|
}
|
|
|
|
private void managedListView1_DrawSubItem(object sender, ManagedListViewSubItemDrawArgs e)
|
|
{
|
|
}
|
|
|
|
private void managedListView1_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
selectionTimer = 3;
|
|
timer_selection.Start();
|
|
}
|
|
|
|
private void gameInfoViewer_RatingChanged(object sender, EventArgs e)
|
|
{
|
|
if (managedListView1.SelectedItems.Count == 1)
|
|
{
|
|
((ManagedListViewRatingSubItem)managedListView1.SelectedItems[0].GetSubItemByID("Rating")).Rating = ((Rating)sender).rating;
|
|
}
|
|
}
|
|
|
|
private void toolStripButton1_Click(object sender, EventArgs e)
|
|
{
|
|
if (_thread_busy)
|
|
{
|
|
ManagedMessageBox.ShowErrorMessage(Resources.Message37);
|
|
}
|
|
else if (MyNesDB.IsDatabaseLoaded)
|
|
{
|
|
if (ManagedMessageBox.ShowQuestionMessage(Resources.Message41, Resources.MessageCap6).ClickedButtonIndex == 0)
|
|
{
|
|
GenerateDatabase();
|
|
}
|
|
}
|
|
else
|
|
{
|
|
GenerateDatabase();
|
|
}
|
|
}
|
|
|
|
private void toolStripButton2_Click(object sender, EventArgs e)
|
|
{
|
|
if (_thread_busy)
|
|
{
|
|
ManagedMessageBox.ShowErrorMessage(Resources.Message37);
|
|
}
|
|
else if (!MyNesDB.IsDatabaseLoaded)
|
|
{
|
|
ManagedMessageBox.ShowErrorMessage(Resources.Message38);
|
|
}
|
|
else
|
|
{
|
|
AssignFiles();
|
|
}
|
|
}
|
|
|
|
private void managedListView1_MouseDoubleClick(object sender, MouseEventArgs e)
|
|
{
|
|
PlaySelected();
|
|
}
|
|
|
|
private void managedListView1_EnterPressed(object sender, EventArgs e)
|
|
{
|
|
PlaySelected();
|
|
}
|
|
|
|
private void PlayGame_Click(object sender, EventArgs e)
|
|
{
|
|
PlaySelected();
|
|
}
|
|
|
|
private void NesEmu_EMUShutdown(object sender, EventArgs e)
|
|
{
|
|
if (isPlayingGame)
|
|
{
|
|
if (!base.InvokeRequired)
|
|
{
|
|
ReturnToNormalWindowState();
|
|
}
|
|
else
|
|
{
|
|
Invoke(new Action(ReturnToNormalWindowState));
|
|
}
|
|
}
|
|
_thread_busy = true;
|
|
Thread thread = new Thread(UpdatePlayStatus);
|
|
thread.CurrentUICulture = Thread.CurrentThread.CurrentUICulture;
|
|
thread.Start();
|
|
}
|
|
|
|
private void timer_play_Tick(object sender, EventArgs e)
|
|
{
|
|
playTime++;
|
|
}
|
|
|
|
private void FormLauncher_FormClosing(object sender, FormClosingEventArgs e)
|
|
{
|
|
if (!base.InvokeRequired)
|
|
{
|
|
ReturnToNormalWindowState();
|
|
}
|
|
else
|
|
{
|
|
Invoke(new Action(ReturnToNormalWindowState));
|
|
}
|
|
SaveSettings();
|
|
MyNesDB.ReleaseDatabase();
|
|
NesEmu.EmuShutdown -= NesEmu_EMUShutdown;
|
|
}
|
|
|
|
private void Button_mode_all_Click(object sender, EventArgs e)
|
|
{
|
|
mode = DBMode.ALL;
|
|
Button_mode_all.Checked = true;
|
|
Button_mode_database.Checked = false;
|
|
Button_mode_files.Checked = false;
|
|
Button_mode_missing.Checked = false;
|
|
Button_mode_notDB.Checked = false;
|
|
RefreshEntries();
|
|
}
|
|
|
|
private void Button_mode_database_Click(object sender, EventArgs e)
|
|
{
|
|
mode = DBMode.DATABASE;
|
|
Button_mode_all.Checked = false;
|
|
Button_mode_database.Checked = true;
|
|
Button_mode_files.Checked = false;
|
|
Button_mode_missing.Checked = false;
|
|
Button_mode_notDB.Checked = false;
|
|
RefreshEntries();
|
|
}
|
|
|
|
private void Button_mode_notDB_Click(object sender, EventArgs e)
|
|
{
|
|
mode = DBMode.NOTDB;
|
|
Button_mode_all.Checked = false;
|
|
Button_mode_database.Checked = false;
|
|
Button_mode_files.Checked = false;
|
|
Button_mode_missing.Checked = false;
|
|
Button_mode_notDB.Checked = true;
|
|
RefreshEntries();
|
|
}
|
|
|
|
private void Button_mode_files_Click(object sender, EventArgs e)
|
|
{
|
|
mode = DBMode.FILES;
|
|
Button_mode_all.Checked = false;
|
|
Button_mode_database.Checked = false;
|
|
Button_mode_files.Checked = true;
|
|
Button_mode_missing.Checked = false;
|
|
Button_mode_notDB.Checked = false;
|
|
RefreshEntries();
|
|
}
|
|
|
|
private void Button_mode_missing_Click(object sender, EventArgs e)
|
|
{
|
|
mode = DBMode.MISSING;
|
|
Button_mode_all.Checked = false;
|
|
Button_mode_database.Checked = false;
|
|
Button_mode_files.Checked = false;
|
|
Button_mode_missing.Checked = true;
|
|
Button_mode_notDB.Checked = false;
|
|
RefreshEntries();
|
|
}
|
|
|
|
private void timer_search_Tick(object sender, EventArgs e)
|
|
{
|
|
if (searchTimer > 0)
|
|
{
|
|
searchTimer--;
|
|
return;
|
|
}
|
|
timer_search.Stop();
|
|
performQuickSearch = true;
|
|
quickSearchText = toolStripTextBox_find.Text;
|
|
RefreshEntries();
|
|
}
|
|
|
|
private void toolStripTextBox_find_TextChanged(object sender, EventArgs e)
|
|
{
|
|
searchTimer = 3;
|
|
timer_search.Start();
|
|
}
|
|
|
|
private void toolStripButton4_Click(object sender, EventArgs e)
|
|
{
|
|
Form[] ownedForms = base.OwnedForms;
|
|
foreach (Form form in ownedForms)
|
|
{
|
|
if (form.Tag.ToString() == "find")
|
|
{
|
|
form.Activate();
|
|
return;
|
|
}
|
|
}
|
|
FormSearchLauncher formSearchLauncher = new FormSearchLauncher();
|
|
formSearchLauncher.SearchRequest += newfrm_SearchRequest;
|
|
formSearchLauncher.Show(this);
|
|
}
|
|
|
|
private void newfrm_SearchRequest(object sender, SearchRequestArgs e)
|
|
{
|
|
if (e.SearchWhat.Length != 0)
|
|
{
|
|
performSearch = true;
|
|
searchArgs = e;
|
|
RefreshEntries();
|
|
}
|
|
}
|
|
|
|
private void managedListView1_SwitchToColumnsContextMenu(object sender, EventArgs e)
|
|
{
|
|
managedListView1.ContextMenuStrip = contextMenuStrip_list_columns;
|
|
}
|
|
|
|
private void managedListView1_SwitchToNormalContextMenu(object sender, EventArgs e)
|
|
{
|
|
managedListView1.ContextMenuStrip = contextMenuStrip_list_main;
|
|
}
|
|
|
|
private void contextMenuStrip_list_columns_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
|
|
{
|
|
((ToolStripMenuItem)e.ClickedItem).Checked = !((ToolStripMenuItem)e.ClickedItem).Checked;
|
|
MyNesDB.UpdateColumn(e.ClickedItem.Text, ((ToolStripMenuItem)e.ClickedItem).Checked);
|
|
if (!((ToolStripMenuItem)e.ClickedItem).Checked)
|
|
{
|
|
for (int i = 0; i < managedListView1.Columns.Count; i++)
|
|
{
|
|
if (managedListView1.Columns[i].HeaderText == e.ClickedItem.Text)
|
|
{
|
|
managedListView1.Columns.RemoveAt(i);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
MyNesDBColumn column = MyNesDB.GetColumn(e.ClickedItem.Text);
|
|
int columnIndex = MyNesDB.GetColumnIndex(e.ClickedItem.Text);
|
|
ManagedListViewColumn managedListViewColumn = new ManagedListViewColumn();
|
|
managedListViewColumn.HeaderText = e.ClickedItem.Text;
|
|
managedListViewColumn.ID = e.ClickedItem.Text;
|
|
managedListViewColumn.Width = column.Width;
|
|
managedListView1.Columns.Insert(columnIndex, managedListViewColumn);
|
|
}
|
|
}
|
|
|
|
private void openFileLocationToolStripMenuItem_Click(object sender, EventArgs e)
|
|
{
|
|
if (managedListView1.SelectedItems.Count != 1)
|
|
{
|
|
ManagedMessageBox.ShowErrorMessage(Resources.Message42);
|
|
return;
|
|
}
|
|
MyNesDBEntryInfo entry = MyNesDB.GetEntry(managedListView1.SelectedItems[0].Tag.ToString());
|
|
if (File.Exists(entry.Path))
|
|
{
|
|
try
|
|
{
|
|
Process.Start("explorer.exe", "/select, " + entry.Path);
|
|
return;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ManagedMessageBox.ShowErrorMessage(ex.Message);
|
|
return;
|
|
}
|
|
}
|
|
ManagedMessageBox.ShowErrorMessage(Resources.Message43);
|
|
}
|
|
|
|
private void timer_progress_Tick(object sender, EventArgs e)
|
|
{
|
|
StatusLabel.Text = status;
|
|
ProgressBar.Value = progress;
|
|
}
|
|
|
|
private void toolStripButton5_Click(object sender, EventArgs e)
|
|
{
|
|
Detect();
|
|
}
|
|
|
|
private void timer_selection_Tick(object sender, EventArgs e)
|
|
{
|
|
if (!_thread_busy)
|
|
{
|
|
if (selectionTimer > 0)
|
|
{
|
|
selectionTimer--;
|
|
return;
|
|
}
|
|
timer_selection.Stop();
|
|
UpdateSelection();
|
|
}
|
|
}
|
|
|
|
private void toolStripButton6_Click(object sender, EventArgs e)
|
|
{
|
|
FormDetectSelection formDetectSelection = new FormDetectSelection();
|
|
if (formDetectSelection.ShowDialog(this) != DialogResult.OK)
|
|
{
|
|
return;
|
|
}
|
|
DataSet dataSet = MyNesDB.GetDataSet(formDetectSelection.MODE.ToString());
|
|
if (dataSet == null || dataSet.Tables[0].Rows.Count <= 0)
|
|
{
|
|
return;
|
|
}
|
|
managedListView1.Items.Clear();
|
|
managedListView1.Columns.Clear();
|
|
for (int i = 0; i < dataSet.Tables[0].Columns.Count; i++)
|
|
{
|
|
ManagedListViewColumn managedListViewColumn = new ManagedListViewColumn();
|
|
string headerText = (managedListViewColumn.ID = dataSet.Tables[0].Columns[i].ToString());
|
|
managedListViewColumn.HeaderText = headerText;
|
|
managedListView1.Columns.Add(managedListViewColumn);
|
|
}
|
|
for (int j = 0; j < dataSet.Tables[0].Rows.Count; j++)
|
|
{
|
|
ManagedListViewItem managedListViewItem = new ManagedListViewItem();
|
|
managedListViewItem.Tag = dataSet.Tables[0].Rows[j]["Id"].ToString();
|
|
foreach (ManagedListViewColumn column in managedListView1.Columns)
|
|
{
|
|
ManagedListViewSubItem managedListViewSubItem = new ManagedListViewSubItem();
|
|
managedListViewSubItem.ColumnID = column.ID;
|
|
managedListViewSubItem.Text = dataSet.Tables[0].Rows[j][column.ID].ToString();
|
|
managedListViewItem.SubItems.Add(managedListViewSubItem);
|
|
}
|
|
managedListView1.Items.Add(managedListViewItem);
|
|
}
|
|
}
|
|
|
|
private void toolStripSplitButton1_DropDownOpening(object sender, EventArgs e)
|
|
{
|
|
autoMinimizeToolStripMenuItem.Checked = Program.Settings.LauncherAutoMinimize;
|
|
cycleImagesOnGameInfoToolStripMenuItem.Checked = Program.Settings.LauncherAutoCycleImagesInGameTab;
|
|
rememberSelectionToolStripMenuItem.Checked = Program.Settings.LauncherRememberLastSelection;
|
|
showLauncherAtAppStartToolStripMenuItem.Checked = Program.Settings.LauncherShowAyAppStart;
|
|
}
|
|
|
|
private void autoMinimizeToolStripMenuItem_Click(object sender, EventArgs e)
|
|
{
|
|
Program.Settings.LauncherAutoMinimize = !Program.Settings.LauncherAutoMinimize;
|
|
toolStripLabel2.Visible = Program.Settings.LauncherAutoMinimize;
|
|
}
|
|
|
|
private void cycleImagesOnGameInfoToolStripMenuItem_Click(object sender, EventArgs e)
|
|
{
|
|
Program.Settings.LauncherAutoCycleImagesInGameTab = !Program.Settings.LauncherAutoCycleImagesInGameTab;
|
|
}
|
|
|
|
private void rememberSelectionToolStripMenuItem_Click(object sender, EventArgs e)
|
|
{
|
|
Program.Settings.LauncherRememberLastSelection = !Program.Settings.LauncherRememberLastSelection;
|
|
}
|
|
|
|
private void showLauncherAtAppStartToolStripMenuItem_Click(object sender, EventArgs e)
|
|
{
|
|
Program.Settings.LauncherShowAyAppStart = !Program.Settings.LauncherShowAyAppStart;
|
|
}
|
|
|
|
private void toolStripButton7_Click(object sender, EventArgs e)
|
|
{
|
|
OpenFileDialog openFileDialog = new OpenFileDialog();
|
|
openFileDialog.Title = Resources.Desc16;
|
|
openFileDialog.Filter = Resources.Filter_Rom;
|
|
openFileDialog.Multiselect = true;
|
|
if (openFileDialog.ShowDialog(this) == DialogResult.OK)
|
|
{
|
|
frmG = new FormGeneratingDatabase(isCenter: false);
|
|
frmG.Show(this);
|
|
_assign_subfolders = false;
|
|
_assign_addFilesNotFound = true;
|
|
_assign_update_entries_already_assigned = false;
|
|
AddFiles(openFileDialog.FileNames);
|
|
RefreshEntriesThreaded();
|
|
CloseWorkFormThreaded();
|
|
}
|
|
}
|
|
|
|
private void managedListView1_DragOver(object sender, DragEventArgs e)
|
|
{
|
|
if (e.Data.GetDataPresent(DataFormats.FileDrop))
|
|
{
|
|
e.Effect = DragDropEffects.All;
|
|
}
|
|
else
|
|
{
|
|
e.Effect = DragDropEffects.None;
|
|
}
|
|
}
|
|
|
|
private void managedListView1_DragDrop(object sender, DragEventArgs e)
|
|
{
|
|
if (e.Data.GetDataPresent(DataFormats.FileDrop))
|
|
{
|
|
_assign_addFilesNotFound = true;
|
|
AddFiles((string[])e.Data.GetData(DataFormats.FileDrop));
|
|
}
|
|
}
|
|
|
|
private void ShowGameInfo(object sender, EventArgs e)
|
|
{
|
|
if (managedListView1.SelectedItems.Count != 1)
|
|
{
|
|
ManagedMessageBox.ShowErrorMessage(Resources.Message44);
|
|
return;
|
|
}
|
|
string id = managedListView1.SelectedItems[0].Tag.ToString();
|
|
bool flag = false;
|
|
string text = MyNesDB.GetEntry(id).Path;
|
|
string text2 = text;
|
|
int result = 0;
|
|
if (text.StartsWith("("))
|
|
{
|
|
flag = true;
|
|
string[] array = text.Split('(', ')');
|
|
int.TryParse(array[1], out result);
|
|
text = array[2];
|
|
}
|
|
if (flag)
|
|
{
|
|
string obj = Path.GetTempPath() + "\\MYNES\\";
|
|
Directory.CreateDirectory(obj);
|
|
SevenZipExtractor sevenZipExtractor = new SevenZipExtractor(text);
|
|
text2 = obj + sevenZipExtractor.ArchiveFileData[result].FileName;
|
|
Stream stream = new FileStream(text2, FileMode.Create, FileAccess.Write);
|
|
sevenZipExtractor.ExtractFile(result, stream);
|
|
stream.Close();
|
|
}
|
|
if (File.Exists(text2))
|
|
{
|
|
if (NesEmu.ON)
|
|
{
|
|
NesEmu.PAUSED = true;
|
|
}
|
|
new FormRomInfo(text2).ShowDialog(this);
|
|
if (NesEmu.ON)
|
|
{
|
|
NesEmu.PAUSED = false;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
ManagedMessageBox.ShowErrorMessage(Resources.Message43);
|
|
}
|
|
}
|
|
|
|
private void DeleteSelectedEntries(object sender, EventArgs e)
|
|
{
|
|
if (managedListView1.SelectedItems.Count == 0)
|
|
{
|
|
ManagedMessageBox.ShowErrorMessage(Resources.Message45);
|
|
return;
|
|
}
|
|
ManagedMessageBoxResult managedMessageBoxResult = ManagedMessageBox.ShowMessage(Resources.Message46, Resources.MessageCap7, new string[2]
|
|
{
|
|
Resources.Button2,
|
|
Resources.Button3
|
|
}, 1, ManagedMessageBoxIcon.Question, showCheckBox: true, checkBoxValue: true, Resources.Button4);
|
|
if (managedMessageBoxResult.ClickedButtonIndex != 0)
|
|
{
|
|
return;
|
|
}
|
|
ProgressBar.Visible = true;
|
|
StatusLabel.Text = Resources.Status37;
|
|
int num = 0;
|
|
int count = managedListView1.SelectedItems.Count;
|
|
ManagedListViewItem[] array = managedListView1.SelectedItems.ToArray();
|
|
foreach (ManagedListViewItem managedListViewItem in array)
|
|
{
|
|
string id = managedListViewItem.Tag.ToString();
|
|
MyNesDBEntryInfo entry = MyNesDB.GetEntry(id);
|
|
if (!managedMessageBoxResult.Checked || !entry.IsDB)
|
|
{
|
|
MyNesDB.DeleteEntry(id);
|
|
managedListView1.Items.Remove(managedListViewItem);
|
|
ProgressBar.Value = num * 100 / count;
|
|
statusStrip1.Refresh();
|
|
num++;
|
|
}
|
|
}
|
|
ProgressBar.Visible = false;
|
|
}
|
|
|
|
private void managedListView1_ColumnClicked(object sender, ManagedListViewColumnClickArgs e)
|
|
{
|
|
if (_thread_busy)
|
|
{
|
|
return;
|
|
}
|
|
ManagedListViewColumn columnByID = managedListView1.Columns.GetColumnByID(e.ColumnID);
|
|
if (columnByID == null)
|
|
{
|
|
return;
|
|
}
|
|
bool flag = false;
|
|
switch (columnByID.SortMode)
|
|
{
|
|
case ManagedListViewSortMode.AtoZ:
|
|
flag = false;
|
|
break;
|
|
case ManagedListViewSortMode.ZtoA:
|
|
case ManagedListViewSortMode.None:
|
|
flag = true;
|
|
break;
|
|
}
|
|
foreach (ManagedListViewColumn column in managedListView1.Columns)
|
|
{
|
|
column.SortMode = ManagedListViewSortMode.None;
|
|
}
|
|
columnByID.SortMode = ((!flag) ? ManagedListViewSortMode.ZtoA : ManagedListViewSortMode.AtoZ);
|
|
doSort = true;
|
|
sortColumnName = e.ColumnID;
|
|
sortAZ = flag;
|
|
RefreshEntries();
|
|
}
|
|
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
if (disposing && components != null)
|
|
{
|
|
components.Dispose();
|
|
}
|
|
base.Dispose(disposing);
|
|
}
|
|
|
|
private void InitializeComponent()
|
|
{
|
|
this.components = new System.ComponentModel.Container();
|
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MyNes.FormLauncher));
|
|
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
|
this.managedListView1 = new MLV.ManagedListView();
|
|
this.contextMenuStrip_list_main = new System.Windows.Forms.ContextMenuStrip(this.components);
|
|
this.playToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
|
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
|
|
this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
|
this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator();
|
|
this.infoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
|
this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();
|
|
this.openFileLocationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
|
this.imageList_items = new System.Windows.Forms.ImageList(this.components);
|
|
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
|
|
this.splitContainer3 = new System.Windows.Forms.SplitContainer();
|
|
this.groupBox_game = new System.Windows.Forms.GroupBox();
|
|
this.groupBox_info = new System.Windows.Forms.GroupBox();
|
|
this.splitContainer4 = new System.Windows.Forms.SplitContainer();
|
|
this.groupBox_snapshots = new System.Windows.Forms.GroupBox();
|
|
this.groupBox_covers = new System.Windows.Forms.GroupBox();
|
|
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
|
|
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
|
|
this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
|
|
this.toolStripButton7 = new System.Windows.Forms.ToolStripButton();
|
|
this.toolStripButton5 = new System.Windows.Forms.ToolStripButton();
|
|
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
|
this.toolStripButton4 = new System.Windows.Forms.ToolStripButton();
|
|
this.toolStripTextBox_find = new System.Windows.Forms.ToolStripTextBox();
|
|
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
|
|
this.toolStripSplitButton1 = new System.Windows.Forms.ToolStripSplitButton();
|
|
this.autoMinimizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
|
this.cycleImagesOnGameInfoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
|
this.rememberSelectionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
|
this.showLauncherAtAppStartToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
|
this.toolStripButton6 = new System.Windows.Forms.ToolStripButton();
|
|
this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator();
|
|
this.toolStripLabel2 = new System.Windows.Forms.ToolStripLabel();
|
|
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
|
|
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
|
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
|
|
this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
|
|
this.StatusLabel = new System.Windows.Forms.ToolStripStatusLabel();
|
|
this.ProgressBar = new System.Windows.Forms.ToolStripProgressBar();
|
|
this.timer_play = new System.Windows.Forms.Timer(this.components);
|
|
this.toolStrip2 = new System.Windows.Forms.ToolStrip();
|
|
this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
|
|
this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();
|
|
this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
|
|
this.Button_mode_all = new System.Windows.Forms.ToolStripButton();
|
|
this.Button_mode_database = new System.Windows.Forms.ToolStripButton();
|
|
this.Button_mode_notDB = new System.Windows.Forms.ToolStripButton();
|
|
this.Button_mode_files = new System.Windows.Forms.ToolStripButton();
|
|
this.Button_mode_missing = new System.Windows.Forms.ToolStripButton();
|
|
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
|
|
this.toolStripButton3 = new System.Windows.Forms.ToolStripButton();
|
|
this.toolStripButton8 = new System.Windows.Forms.ToolStripButton();
|
|
this.toolStripButton9 = new System.Windows.Forms.ToolStripButton();
|
|
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
|
|
this.timer_search = new System.Windows.Forms.Timer(this.components);
|
|
this.contextMenuStrip_list_columns = new System.Windows.Forms.ContextMenuStrip(this.components);
|
|
this.timer_progress = new System.Windows.Forms.Timer(this.components);
|
|
this.timer_selection = new System.Windows.Forms.Timer(this.components);
|
|
((System.ComponentModel.ISupportInitialize)this.splitContainer1).BeginInit();
|
|
this.splitContainer1.Panel1.SuspendLayout();
|
|
this.splitContainer1.Panel2.SuspendLayout();
|
|
this.splitContainer1.SuspendLayout();
|
|
this.contextMenuStrip_list_main.SuspendLayout();
|
|
((System.ComponentModel.ISupportInitialize)this.splitContainer2).BeginInit();
|
|
this.splitContainer2.Panel1.SuspendLayout();
|
|
this.splitContainer2.Panel2.SuspendLayout();
|
|
this.splitContainer2.SuspendLayout();
|
|
((System.ComponentModel.ISupportInitialize)this.splitContainer3).BeginInit();
|
|
this.splitContainer3.Panel1.SuspendLayout();
|
|
this.splitContainer3.Panel2.SuspendLayout();
|
|
this.splitContainer3.SuspendLayout();
|
|
((System.ComponentModel.ISupportInitialize)this.splitContainer4).BeginInit();
|
|
this.splitContainer4.Panel1.SuspendLayout();
|
|
this.splitContainer4.Panel2.SuspendLayout();
|
|
this.splitContainer4.SuspendLayout();
|
|
this.toolStrip1.SuspendLayout();
|
|
this.statusStrip1.SuspendLayout();
|
|
this.toolStrip2.SuspendLayout();
|
|
base.SuspendLayout();
|
|
resources.ApplyResources(this.splitContainer1, "splitContainer1");
|
|
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
|
this.splitContainer1.Name = "splitContainer1";
|
|
resources.ApplyResources(this.splitContainer1.Panel1, "splitContainer1.Panel1");
|
|
this.splitContainer1.Panel1.Controls.Add(this.managedListView1);
|
|
resources.ApplyResources(this.splitContainer1.Panel2, "splitContainer1.Panel2");
|
|
this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
|
|
resources.ApplyResources(this.managedListView1, "managedListView1");
|
|
this.managedListView1.AllowColumnsReorder = true;
|
|
this.managedListView1.AllowDrop = true;
|
|
this.managedListView1.AllowItemsDragAndDrop = false;
|
|
this.managedListView1.AutoSetWheelScrollSpeed = true;
|
|
this.managedListView1.BackgroundRenderMode = MLV.ManagedListViewBackgroundRenderMode.NormalStretchNoAspectRatio;
|
|
this.managedListView1.ChangeColumnSortModeWhenClick = false;
|
|
this.managedListView1.ColumnClickColor = System.Drawing.Color.PaleVioletRed;
|
|
this.managedListView1.ColumnColor = System.Drawing.Color.Silver;
|
|
this.managedListView1.ColumnHighlightColor = System.Drawing.Color.LightSkyBlue;
|
|
this.managedListView1.ContextMenuStrip = this.contextMenuStrip_list_main;
|
|
this.managedListView1.DrawHighlight = true;
|
|
this.managedListView1.ImagesList = this.imageList_items;
|
|
this.managedListView1.ItemHighlightColor = System.Drawing.Color.LightSkyBlue;
|
|
this.managedListView1.ItemMouseOverColor = System.Drawing.Color.LightGray;
|
|
this.managedListView1.ItemSpecialColor = System.Drawing.Color.YellowGreen;
|
|
this.managedListView1.Name = "managedListView1";
|
|
this.managedListView1.ShowItemInfoOnThumbnailMode = true;
|
|
this.managedListView1.ShowSubItemToolTip = true;
|
|
this.managedListView1.StretchThumbnailsToFit = false;
|
|
this.managedListView1.ThunmbnailsHeight = 36;
|
|
this.managedListView1.ThunmbnailsWidth = 36;
|
|
this.managedListView1.ViewMode = MLV.ManagedListViewViewMode.Details;
|
|
this.managedListView1.WheelScrollSpeed = 18;
|
|
this.managedListView1.SelectedIndexChanged += new System.EventHandler(managedListView1_SelectedIndexChanged);
|
|
this.managedListView1.ColumnClicked += new System.EventHandler<MLV.ManagedListViewColumnClickArgs>(managedListView1_ColumnClicked);
|
|
this.managedListView1.EnterPressed += new System.EventHandler(managedListView1_EnterPressed);
|
|
this.managedListView1.SwitchToColumnsContextMenu += new System.EventHandler(managedListView1_SwitchToColumnsContextMenu);
|
|
this.managedListView1.SwitchToNormalContextMenu += new System.EventHandler(managedListView1_SwitchToNormalContextMenu);
|
|
this.managedListView1.AfterColumnResize += new System.EventHandler(managedListView1_AfterColumnResize);
|
|
this.managedListView1.AfterColumnReorder += new System.EventHandler(managedListView1_AfterColumnReorder);
|
|
this.managedListView1.DragDrop += new System.Windows.Forms.DragEventHandler(managedListView1_DragDrop);
|
|
this.managedListView1.DragOver += new System.Windows.Forms.DragEventHandler(managedListView1_DragOver);
|
|
this.managedListView1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(managedListView1_MouseDoubleClick);
|
|
resources.ApplyResources(this.contextMenuStrip_list_main, "contextMenuStrip_list_main");
|
|
this.contextMenuStrip_list_main.Items.AddRange(new System.Windows.Forms.ToolStripItem[7] { this.playToolStripMenuItem, this.toolStripSeparator3, this.deleteToolStripMenuItem, this.toolStripSeparator9, this.infoToolStripMenuItem, this.toolStripSeparator8, this.openFileLocationToolStripMenuItem });
|
|
this.contextMenuStrip_list_main.Name = "contextMenuStrip_list_main";
|
|
resources.ApplyResources(this.playToolStripMenuItem, "playToolStripMenuItem");
|
|
this.playToolStripMenuItem.Image = MyNes.Properties.Resources.control_play;
|
|
this.playToolStripMenuItem.Name = "playToolStripMenuItem";
|
|
resources.ApplyResources(this.toolStripSeparator3, "toolStripSeparator3");
|
|
this.toolStripSeparator3.Name = "toolStripSeparator3";
|
|
resources.ApplyResources(this.deleteToolStripMenuItem, "deleteToolStripMenuItem");
|
|
this.deleteToolStripMenuItem.Image = MyNes.Properties.Resources.cross_black;
|
|
this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem";
|
|
this.deleteToolStripMenuItem.Click += new System.EventHandler(DeleteSelectedEntries);
|
|
resources.ApplyResources(this.toolStripSeparator9, "toolStripSeparator9");
|
|
this.toolStripSeparator9.Name = "toolStripSeparator9";
|
|
resources.ApplyResources(this.infoToolStripMenuItem, "infoToolStripMenuItem");
|
|
this.infoToolStripMenuItem.Image = MyNes.Properties.Resources.information;
|
|
this.infoToolStripMenuItem.Name = "infoToolStripMenuItem";
|
|
this.infoToolStripMenuItem.Click += new System.EventHandler(ShowGameInfo);
|
|
resources.ApplyResources(this.toolStripSeparator8, "toolStripSeparator8");
|
|
this.toolStripSeparator8.Name = "toolStripSeparator8";
|
|
resources.ApplyResources(this.openFileLocationToolStripMenuItem, "openFileLocationToolStripMenuItem");
|
|
this.openFileLocationToolStripMenuItem.Name = "openFileLocationToolStripMenuItem";
|
|
this.openFileLocationToolStripMenuItem.Click += new System.EventHandler(openFileLocationToolStripMenuItem_Click);
|
|
this.imageList_items.ImageStream = (System.Windows.Forms.ImageListStreamer)resources.GetObject("imageList_items.ImageStream");
|
|
this.imageList_items.TransparentColor = System.Drawing.Color.Transparent;
|
|
this.imageList_items.Images.SetKeyName(0, "cross.png");
|
|
this.imageList_items.Images.SetKeyName(1, "INES.ico");
|
|
resources.ApplyResources(this.splitContainer2, "splitContainer2");
|
|
this.splitContainer2.Name = "splitContainer2";
|
|
resources.ApplyResources(this.splitContainer2.Panel1, "splitContainer2.Panel1");
|
|
this.splitContainer2.Panel1.Controls.Add(this.splitContainer3);
|
|
resources.ApplyResources(this.splitContainer2.Panel2, "splitContainer2.Panel2");
|
|
this.splitContainer2.Panel2.Controls.Add(this.splitContainer4);
|
|
resources.ApplyResources(this.splitContainer3, "splitContainer3");
|
|
this.splitContainer3.Name = "splitContainer3";
|
|
resources.ApplyResources(this.splitContainer3.Panel1, "splitContainer3.Panel1");
|
|
this.splitContainer3.Panel1.Controls.Add(this.groupBox_game);
|
|
resources.ApplyResources(this.splitContainer3.Panel2, "splitContainer3.Panel2");
|
|
this.splitContainer3.Panel2.Controls.Add(this.groupBox_info);
|
|
resources.ApplyResources(this.groupBox_game, "groupBox_game");
|
|
this.groupBox_game.Name = "groupBox_game";
|
|
this.groupBox_game.TabStop = false;
|
|
resources.ApplyResources(this.groupBox_info, "groupBox_info");
|
|
this.groupBox_info.Name = "groupBox_info";
|
|
this.groupBox_info.TabStop = false;
|
|
resources.ApplyResources(this.splitContainer4, "splitContainer4");
|
|
this.splitContainer4.Name = "splitContainer4";
|
|
resources.ApplyResources(this.splitContainer4.Panel1, "splitContainer4.Panel1");
|
|
this.splitContainer4.Panel1.Controls.Add(this.groupBox_snapshots);
|
|
resources.ApplyResources(this.splitContainer4.Panel2, "splitContainer4.Panel2");
|
|
this.splitContainer4.Panel2.Controls.Add(this.groupBox_covers);
|
|
resources.ApplyResources(this.groupBox_snapshots, "groupBox_snapshots");
|
|
this.groupBox_snapshots.Name = "groupBox_snapshots";
|
|
this.groupBox_snapshots.TabStop = false;
|
|
resources.ApplyResources(this.groupBox_covers, "groupBox_covers");
|
|
this.groupBox_covers.Name = "groupBox_covers";
|
|
this.groupBox_covers.TabStop = false;
|
|
resources.ApplyResources(this.toolStrip1, "toolStrip1");
|
|
this.toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
|
|
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[12]
|
|
{
|
|
this.toolStripButton1, this.toolStripButton2, this.toolStripButton7, this.toolStripButton5, this.toolStripSeparator1, this.toolStripButton4, this.toolStripTextBox_find, this.toolStripSeparator4, this.toolStripSplitButton1, this.toolStripButton6,
|
|
this.toolStripSeparator10, this.toolStripLabel2
|
|
});
|
|
this.toolStrip1.Name = "toolStrip1";
|
|
resources.ApplyResources(this.toolStripButton1, "toolStripButton1");
|
|
this.toolStripButton1.Image = MyNes.Properties.Resources.database_add;
|
|
this.toolStripButton1.Name = "toolStripButton1";
|
|
this.toolStripButton1.Click += new System.EventHandler(toolStripButton1_Click);
|
|
resources.ApplyResources(this.toolStripButton2, "toolStripButton2");
|
|
this.toolStripButton2.Image = MyNes.Properties.Resources.database_table;
|
|
this.toolStripButton2.Name = "toolStripButton2";
|
|
this.toolStripButton2.Click += new System.EventHandler(toolStripButton2_Click);
|
|
resources.ApplyResources(this.toolStripButton7, "toolStripButton7");
|
|
this.toolStripButton7.Image = MyNes.Properties.Resources.add;
|
|
this.toolStripButton7.Name = "toolStripButton7";
|
|
this.toolStripButton7.Click += new System.EventHandler(toolStripButton7_Click);
|
|
resources.ApplyResources(this.toolStripButton5, "toolStripButton5");
|
|
this.toolStripButton5.Image = MyNes.Properties.Resources.database_go;
|
|
this.toolStripButton5.Name = "toolStripButton5";
|
|
this.toolStripButton5.Click += new System.EventHandler(toolStripButton5_Click);
|
|
resources.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1");
|
|
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
|
resources.ApplyResources(this.toolStripButton4, "toolStripButton4");
|
|
this.toolStripButton4.Image = MyNes.Properties.Resources.find;
|
|
this.toolStripButton4.Name = "toolStripButton4";
|
|
this.toolStripButton4.Click += new System.EventHandler(toolStripButton4_Click);
|
|
resources.ApplyResources(this.toolStripTextBox_find, "toolStripTextBox_find");
|
|
this.toolStripTextBox_find.Name = "toolStripTextBox_find";
|
|
this.toolStripTextBox_find.TextChanged += new System.EventHandler(toolStripTextBox_find_TextChanged);
|
|
resources.ApplyResources(this.toolStripSeparator4, "toolStripSeparator4");
|
|
this.toolStripSeparator4.Name = "toolStripSeparator4";
|
|
resources.ApplyResources(this.toolStripSplitButton1, "toolStripSplitButton1");
|
|
this.toolStripSplitButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[4] { this.autoMinimizeToolStripMenuItem, this.cycleImagesOnGameInfoToolStripMenuItem, this.rememberSelectionToolStripMenuItem, this.showLauncherAtAppStartToolStripMenuItem });
|
|
this.toolStripSplitButton1.Image = MyNes.Properties.Resources.wrench;
|
|
this.toolStripSplitButton1.Name = "toolStripSplitButton1";
|
|
this.toolStripSplitButton1.DropDownOpening += new System.EventHandler(toolStripSplitButton1_DropDownOpening);
|
|
resources.ApplyResources(this.autoMinimizeToolStripMenuItem, "autoMinimizeToolStripMenuItem");
|
|
this.autoMinimizeToolStripMenuItem.Checked = true;
|
|
this.autoMinimizeToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
|
this.autoMinimizeToolStripMenuItem.Name = "autoMinimizeToolStripMenuItem";
|
|
this.autoMinimizeToolStripMenuItem.Click += new System.EventHandler(autoMinimizeToolStripMenuItem_Click);
|
|
resources.ApplyResources(this.cycleImagesOnGameInfoToolStripMenuItem, "cycleImagesOnGameInfoToolStripMenuItem");
|
|
this.cycleImagesOnGameInfoToolStripMenuItem.Checked = true;
|
|
this.cycleImagesOnGameInfoToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
|
this.cycleImagesOnGameInfoToolStripMenuItem.Name = "cycleImagesOnGameInfoToolStripMenuItem";
|
|
this.cycleImagesOnGameInfoToolStripMenuItem.Click += new System.EventHandler(cycleImagesOnGameInfoToolStripMenuItem_Click);
|
|
resources.ApplyResources(this.rememberSelectionToolStripMenuItem, "rememberSelectionToolStripMenuItem");
|
|
this.rememberSelectionToolStripMenuItem.Checked = true;
|
|
this.rememberSelectionToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
|
this.rememberSelectionToolStripMenuItem.Name = "rememberSelectionToolStripMenuItem";
|
|
this.rememberSelectionToolStripMenuItem.Click += new System.EventHandler(rememberSelectionToolStripMenuItem_Click);
|
|
resources.ApplyResources(this.showLauncherAtAppStartToolStripMenuItem, "showLauncherAtAppStartToolStripMenuItem");
|
|
this.showLauncherAtAppStartToolStripMenuItem.Name = "showLauncherAtAppStartToolStripMenuItem";
|
|
this.showLauncherAtAppStartToolStripMenuItem.Click += new System.EventHandler(showLauncherAtAppStartToolStripMenuItem_Click);
|
|
resources.ApplyResources(this.toolStripButton6, "toolStripButton6");
|
|
this.toolStripButton6.Image = MyNes.Properties.Resources.application_view_list;
|
|
this.toolStripButton6.Name = "toolStripButton6";
|
|
this.toolStripButton6.Click += new System.EventHandler(toolStripButton6_Click);
|
|
resources.ApplyResources(this.toolStripSeparator10, "toolStripSeparator10");
|
|
this.toolStripSeparator10.Name = "toolStripSeparator10";
|
|
resources.ApplyResources(this.toolStripLabel2, "toolStripLabel2");
|
|
this.toolStripLabel2.Name = "toolStripLabel2";
|
|
this.imageList1.ImageStream = (System.Windows.Forms.ImageListStreamer)resources.GetObject("imageList1.ImageStream");
|
|
this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
|
|
this.imageList1.Images.SetKeyName(0, "table.png");
|
|
this.imageList1.Images.SetKeyName(1, "database.png");
|
|
this.imageList1.Images.SetKeyName(2, "database_table.png");
|
|
this.imageList1.Images.SetKeyName(3, "INES.ico");
|
|
this.imageList1.Images.SetKeyName(4, "cross.png");
|
|
resources.ApplyResources(this.statusStrip1, "statusStrip1");
|
|
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[4] { this.toolStripStatusLabel1, this.toolStripStatusLabel2, this.StatusLabel, this.ProgressBar });
|
|
this.statusStrip1.Name = "statusStrip1";
|
|
resources.ApplyResources(this.toolStripStatusLabel1, "toolStripStatusLabel1");
|
|
this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
|
|
resources.ApplyResources(this.toolStripStatusLabel2, "toolStripStatusLabel2");
|
|
this.toolStripStatusLabel2.Name = "toolStripStatusLabel2";
|
|
resources.ApplyResources(this.StatusLabel, "StatusLabel");
|
|
this.StatusLabel.Name = "StatusLabel";
|
|
resources.ApplyResources(this.ProgressBar, "ProgressBar");
|
|
this.ProgressBar.Name = "ProgressBar";
|
|
this.timer_play.Interval = 1000;
|
|
this.timer_play.Tick += new System.EventHandler(timer_play_Tick);
|
|
resources.ApplyResources(this.toolStrip2, "toolStrip2");
|
|
this.toolStrip2.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
|
|
this.toolStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[13]
|
|
{
|
|
this.toolStripSeparator6, this.toolStripLabel1, this.toolStripSeparator7, this.Button_mode_all, this.Button_mode_database, this.Button_mode_notDB, this.Button_mode_files, this.Button_mode_missing, this.toolStripSeparator2, this.toolStripButton3,
|
|
this.toolStripButton8, this.toolStripButton9, this.toolStripSeparator5
|
|
});
|
|
this.toolStrip2.Name = "toolStrip2";
|
|
resources.ApplyResources(this.toolStripSeparator6, "toolStripSeparator6");
|
|
this.toolStripSeparator6.Name = "toolStripSeparator6";
|
|
resources.ApplyResources(this.toolStripLabel1, "toolStripLabel1");
|
|
this.toolStripLabel1.ForeColor = System.Drawing.Color.DarkGray;
|
|
this.toolStripLabel1.Name = "toolStripLabel1";
|
|
resources.ApplyResources(this.toolStripSeparator7, "toolStripSeparator7");
|
|
this.toolStripSeparator7.Name = "toolStripSeparator7";
|
|
resources.ApplyResources(this.Button_mode_all, "Button_mode_all");
|
|
this.Button_mode_all.Checked = true;
|
|
this.Button_mode_all.CheckState = System.Windows.Forms.CheckState.Checked;
|
|
this.Button_mode_all.Image = MyNes.Properties.Resources.server_database;
|
|
this.Button_mode_all.Name = "Button_mode_all";
|
|
this.Button_mode_all.Click += new System.EventHandler(Button_mode_all_Click);
|
|
resources.ApplyResources(this.Button_mode_database, "Button_mode_database");
|
|
this.Button_mode_database.Image = MyNes.Properties.Resources.database;
|
|
this.Button_mode_database.Name = "Button_mode_database";
|
|
this.Button_mode_database.Click += new System.EventHandler(Button_mode_database_Click);
|
|
resources.ApplyResources(this.Button_mode_notDB, "Button_mode_notDB");
|
|
this.Button_mode_notDB.Image = MyNes.Properties.Resources.database_delete;
|
|
this.Button_mode_notDB.Name = "Button_mode_notDB";
|
|
this.Button_mode_notDB.Click += new System.EventHandler(Button_mode_notDB_Click);
|
|
resources.ApplyResources(this.Button_mode_files, "Button_mode_files");
|
|
this.Button_mode_files.Name = "Button_mode_files";
|
|
this.Button_mode_files.Click += new System.EventHandler(Button_mode_files_Click);
|
|
resources.ApplyResources(this.Button_mode_missing, "Button_mode_missing");
|
|
this.Button_mode_missing.Image = MyNes.Properties.Resources.cross;
|
|
this.Button_mode_missing.Name = "Button_mode_missing";
|
|
this.Button_mode_missing.Click += new System.EventHandler(Button_mode_missing_Click);
|
|
resources.ApplyResources(this.toolStripSeparator2, "toolStripSeparator2");
|
|
this.toolStripSeparator2.Name = "toolStripSeparator2";
|
|
resources.ApplyResources(this.toolStripButton3, "toolStripButton3");
|
|
this.toolStripButton3.Image = MyNes.Properties.Resources.control_play;
|
|
this.toolStripButton3.Name = "toolStripButton3";
|
|
this.toolStripButton3.Click += new System.EventHandler(PlayGame_Click);
|
|
resources.ApplyResources(this.toolStripButton8, "toolStripButton8");
|
|
this.toolStripButton8.Image = MyNes.Properties.Resources.information;
|
|
this.toolStripButton8.Name = "toolStripButton8";
|
|
this.toolStripButton8.Click += new System.EventHandler(ShowGameInfo);
|
|
resources.ApplyResources(this.toolStripButton9, "toolStripButton9");
|
|
this.toolStripButton9.Image = MyNes.Properties.Resources.cross_black;
|
|
this.toolStripButton9.Name = "toolStripButton9";
|
|
this.toolStripButton9.Click += new System.EventHandler(DeleteSelectedEntries);
|
|
resources.ApplyResources(this.toolStripSeparator5, "toolStripSeparator5");
|
|
this.toolStripSeparator5.Name = "toolStripSeparator5";
|
|
this.timer_search.Tick += new System.EventHandler(timer_search_Tick);
|
|
resources.ApplyResources(this.contextMenuStrip_list_columns, "contextMenuStrip_list_columns");
|
|
this.contextMenuStrip_list_columns.Name = "contextMenuStrip_list_columns";
|
|
this.contextMenuStrip_list_columns.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(contextMenuStrip_list_columns_ItemClicked);
|
|
this.timer_progress.Tick += new System.EventHandler(timer_progress_Tick);
|
|
this.timer_selection.Interval = 50;
|
|
this.timer_selection.Tick += new System.EventHandler(timer_selection_Tick);
|
|
resources.ApplyResources(this, "$this");
|
|
base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
|
base.Controls.Add(this.splitContainer1);
|
|
base.Controls.Add(this.toolStrip2);
|
|
base.Controls.Add(this.statusStrip1);
|
|
base.Controls.Add(this.toolStrip1);
|
|
base.Name = "FormLauncher";
|
|
base.ShowIcon = false;
|
|
base.ShowInTaskbar = false;
|
|
base.FormClosing += new System.Windows.Forms.FormClosingEventHandler(FormLauncher_FormClosing);
|
|
this.splitContainer1.Panel1.ResumeLayout(false);
|
|
this.splitContainer1.Panel2.ResumeLayout(false);
|
|
((System.ComponentModel.ISupportInitialize)this.splitContainer1).EndInit();
|
|
this.splitContainer1.ResumeLayout(false);
|
|
this.contextMenuStrip_list_main.ResumeLayout(false);
|
|
this.splitContainer2.Panel1.ResumeLayout(false);
|
|
this.splitContainer2.Panel2.ResumeLayout(false);
|
|
((System.ComponentModel.ISupportInitialize)this.splitContainer2).EndInit();
|
|
this.splitContainer2.ResumeLayout(false);
|
|
this.splitContainer3.Panel1.ResumeLayout(false);
|
|
this.splitContainer3.Panel2.ResumeLayout(false);
|
|
((System.ComponentModel.ISupportInitialize)this.splitContainer3).EndInit();
|
|
this.splitContainer3.ResumeLayout(false);
|
|
this.splitContainer4.Panel1.ResumeLayout(false);
|
|
this.splitContainer4.Panel2.ResumeLayout(false);
|
|
((System.ComponentModel.ISupportInitialize)this.splitContainer4).EndInit();
|
|
this.splitContainer4.ResumeLayout(false);
|
|
this.toolStrip1.ResumeLayout(false);
|
|
this.toolStrip1.PerformLayout();
|
|
this.statusStrip1.ResumeLayout(false);
|
|
this.statusStrip1.PerformLayout();
|
|
this.toolStrip2.ResumeLayout(false);
|
|
this.toolStrip2.PerformLayout();
|
|
base.ResumeLayout(false);
|
|
base.PerformLayout();
|
|
}
|
|
}
|