using System; using System.Drawing; using System.Windows.Forms; using EmuXPortal.Api; using Enterprise.Logging; using Utilities.TransparentControls; namespace EmuXPortal { public class Splash : UserControl { const float PROGRESS_BAR_FONT_SIZE = 24; private CustomProgressBar progress_bar; public Splash () { InitializeComponent (); } public FormBorderStyle FormBorderStyle { get; private set; } private void InitializeComponent () { progress_bar = new CustomProgressBar (); this.SuspendLayout (); // // progress_bar // progress_bar.Dock = DockStyle.Top; progress_bar.ProgressColor = Color.Lime; progress_bar.Font = new Font (this.Font.FontFamily, PROGRESS_BAR_FONT_SIZE); this.Controls.Add (progress_bar); // // this // this.BackColor = Color.Black; this.ForeColor = Color.Lime; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Load += Splash_Load; gLog.ReportProgressEvent += Splash_ReportProgress; this.ResumeLayout (false); } private void Splash_Load (object sender, EventArgs e) { #if !DISABLE_CURSOR_HIDE Cursor.Hide (); #else Cursor.Show(); #endif progress_bar.Margin = new System.Windows.Forms.Padding (0); progress_bar.Size = new Size (this.Width - 25, 100); } private void Splash_ReportProgress (object sender, ReportProgressEventArgs e) { int progress = e.Progress; string message = e.UserState == null ? "" : e.UserState.ToString (); progress_bar.Message = message; progress_bar.Value = progress; //progress_bar.Refresh (); } } }