91 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			91 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| using System;
 | |
| using System.Collections.Generic;
 | |
| using System.ComponentModel;
 | |
| using System.Data;
 | |
| using System.Drawing;
 | |
| using System.Text;
 | |
| using System.Windows.Forms;
 | |
| 
 | |
| using VEPROMS.CSLA.Library;
 | |
| using Volian.Base.Library;
 | |
| using JR.Utils.GUI.Forms;
 | |
| using System.Threading;
 | |
| 
 | |
| namespace VEPROMS.CSLA.Library
 | |
| {
 | |
| 	public partial class frmRofstLoadStatus : Form
 | |
| 	{
 | |
| 		#region Fields
 | |
| 
 | |
| 		#endregion
 | |
| 
 | |
| 		#region Properties
 | |
| 
 | |
| 		public string Title
 | |
| 		{
 | |
| 			get { return lblTitle.Text; }
 | |
| 		}
 | |
| 
 | |
| 		public string DisplayText
 | |
| 		{
 | |
| 			get { return statusProgressBar.Text; }
 | |
| 		}
 | |
| 
 | |
| 		#endregion
 | |
| 
 | |
| 		#region Constructor
 | |
| 
 | |
| 		public frmRofstLoadStatus()
 | |
| 		{
 | |
| 			// B2022-107: Display Progress Bar Messages/Statuses when a new ROFST binary file is loaded into the database
 | |
| 			// Initialize Base Component
 | |
| 			InitializeComponent();
 | |
| 		}
 | |
| 
 | |
| 		#endregion
 | |
| 
 | |
| 		#region Public Methods
 | |
| 
 | |
| 		public void UpdateProgress(string title, string displayText, int curVal = 0, int maxVal = 100)
 | |
| 		{
 | |
| 			// Check if Initializing Status/Progress Bar
 | |
| 			if (curVal <= 0)
 | |
| 			{
 | |
| 				statusProgressBar.TextVisible = true;
 | |
| 				statusProgressBar.Maximum = maxVal;
 | |
| 				statusProgressBar.Minimum = 0;
 | |
| 			}
 | |
| 
 | |
| 			if (displayText == null) displayText = string.Empty;
 | |
| 			if (title == null) title = string.Empty;
 | |
| 
 | |
| 			statusProgressBar.Value = curVal;
 | |
| 			statusProgressBar.Text = displayText;
 | |
| 
 | |
| 			lblTitle.Text = title;
 | |
| 
 | |
| 			this.Refresh();
 | |
| 			Application.DoEvents();
 | |
| 
 | |
| 			// Check if Finalizing Status/Progress Bar
 | |
| 			if (curVal >= 100)
 | |
| 			{
 | |
| 				Thread.Sleep(3000);
 | |
| 				this.Close();
 | |
| 			}
 | |
| 		}
 | |
| 
 | |
| 		#endregion
 | |
| 
 | |
| 		#region Private Methods
 | |
| 
 | |
| 		private void frmRofstLoadStatus_Load(object sender, EventArgs e)
 | |
| 		{
 | |
| 			// Initialize Display/Variables 
 | |
| 			UpdateProgress("Initializing ROFST file..", null, 0, 100);
 | |
| 		}
 | |
| 
 | |
| 		#endregion
 | |
| 	}
 | |
| }
 | 
