static void Main() { AppDomain.CurrentDomain.UnhandledException += (s, e) => { if (e.IsTerminating) { Exception ex = e.ExceptionObject as Exception; WriteCrash(ex); } }; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); mainForm = new MainForm(); // Check if application is already running. if (Process.GetProcessesByName(Path.GetFileNameWithoutExtension(Assembly.GetEntryAssembly().Location)).Count() > 1) { MetroMessageBox.Show(mainForm, "An instance of CustomGameBrowser is already running. Exiting.", "", MessageBoxButtons.OK, MessageBoxIcon.Error); Process.GetCurrentProcess().Kill(); } Application.Run(mainForm); }
public UpdateInfoForm(MainForm mainForm) { this.mainForm = mainForm; this.updater = mainForm.updater; // parse out the changelog from releases_page_source. changelog = getChangelog(); InitializeComponent(); this.Text = "Update Available! (v" + updater.newVers + ")"; changelogTextBox.Text = "CHANGELOG:\r\n" + changelog; }
public CustomGame(MainForm mainForm, string installationDir) { this.mainForm = mainForm; this.installationDir = installationDir; workshopID = installationDir.Substring(installationDir.LastIndexOf('\\')+1); url = "http://steamcommunity.com/sharedfiles/filedetails/?id=" + workshopID; workshopImagePath = Path.Combine("Thumbnails", workshopID + ".jpg"); changelogUrl = "http://steamcommunity.com/sharedfiles/filedetails/changelog/" + workshopID; var gameFiles = Directory.GetFiles(installationDir); foreach (var file in gameFiles) { if (file.EndsWith(".vpk")) { vpk = file; } else if (file.EndsWith("publish_data.txt")) { publish_data = file; getPublishDataInfo(); } } }
public Updater(MainForm mainForm) { this.mainForm = mainForm; version = mainForm.version; checkForUpdates(); }