private void btnDownloadBonusSkins_Click(object sender, EventArgs e) { this.btnDownloadBonusSkins.Text = "Downloading..."; this.btnDownloadBonusSkins.Enabled = false; var dllPath = this.bonusSkinDllPath; var client = new WebClient(); client.Proxy = null; client.DownloadFileCompleted += delegate(object o, AsyncCompletedEventArgs args) { ((WebClient)o).Dispose(); if (args.Error != null) { XtraMessageBox.Show(this, "Failed to download bonus skin pack:\n" + args.Error, "Skin Pack", MessageBoxButtons.OK, MessageBoxIcon.Error); File.Delete(dllPath); this.SetBonusSkinLinkState(); return; } ServerBrowserForm.LoadBonusSkins(this.bonusSkinDllPath); this.SetBonusSkinLinkState(); this.InitGallery(); }; client.DownloadFileAsync(new Uri("https://github.com/PredatH0r/SteamServerBrowser/blob/master/ServerBrowser/DLL/" + Path.GetFileName(dllPath) + "?raw=true"), dllPath); }
public ServerConnectorForm(ServerBrowserForm frmServerBrowser) { InitializeComponent(); InitCommands(); ServerBrowserForm = frmServerBrowser; }
private void ShowServerBrowser() { ServerBrowserForm frmServerBrowser = new ServerBrowserForm(); ConfigureServerBrowser(frmServerBrowser); splitContainer.Panel1.Controls.Add(frmServerBrowser); frmServerBrowser.Show(); }
private void ConfigureServerBrowser(ServerBrowserForm frmServerBrowser) { this.ServerBrowser = frmServerBrowser; this.ServerBrowser.MainForm = this; frmServerBrowser.TopLevel = false; frmServerBrowser.FormBorderStyle = FormBorderStyle.None; frmServerBrowser.WindowState = FormWindowState.Minimized; frmServerBrowser.WindowState = FormWindowState.Maximized; frmServerBrowser.Dock = DockStyle.Fill; }
public static void Main() { #if false var culture = new System.Globalization.CultureInfo("en"); Application.CurrentCulture = culture; System.Threading.Thread.CurrentThread.CurrentUICulture = culture; System.Threading.Thread.CurrentThread.CurrentCulture = culture; #endif var iniPath = Path.Combine(Path.GetDirectoryName(typeof(Program).Assembly.Location), "ServerBrowser.ini"); var iniFile = new IniFile(iniPath); var baseFontSize = iniFile.GetSection("Options")?.GetDecimal("FontSize", 9) ?? 9m; // change font before creating the main form to get correct auto-scaling Init(new Font("Segoe UI", (float)baseFontSize), "Office 2010 Black"); var mainForm = new ServerBrowserForm(iniFile); Application.Run(mainForm); }
public ServerBrowserCommandBase(ServerBrowserForm form) { this.Form = form; InitEvents(); }