Files
UVtools/PrusaSL1Viewer/FrmLoading.cs
T
Tiago Conceição d91986f803 v0.3.3
* (Add) PHZ file format
* (Add) "Phrozen Sonic Mini" printer
* (Add) Convert Chitubox files to PHZ files and otherwise
* (Add) Convert Chitubox and PHZ files to ZCodex
* (Add) Elapsed seconds to convertion and extract dialog
* (Improvement) "Convert To" menu now only show available formats to convert to, if none menu is disabled
* (Fixed) Enforce cbt encryption
* (Fixed) Not implemented convertions stay processing forever
2020-05-19 16:57:04 +01:00

70 lines
1.6 KiB
C#

using System;
using System.Diagnostics;
using System.Windows.Forms;
namespace PrusaSL1Viewer
{
public partial class FrmLoading : Form
{
public Stopwatch StopWatch { get; } = new Stopwatch();
public FrmLoading()
{
InitializeComponent();
}
public FrmLoading(string description) : this()
{
SetDescription(description);
}
protected override void OnKeyDown(KeyEventArgs e)
{
base.OnKeyDown(e);
e.Handled = true;
}
protected override void OnKeyPress(KeyPressEventArgs e)
{
base.OnKeyPress(e);
e.Handled = true;
}
protected override void OnKeyUp(KeyEventArgs e)
{
base.OnKeyUp(e);
e.Handled = true;
}
protected override void OnShown(EventArgs e)
{
base.OnShown(e);
StopWatch.Restart();
timer.Start();
}
protected override void OnClosed(EventArgs e)
{
base.OnClosed(e);
timer.Stop();
StopWatch.Stop();
}
public void SetDescription(string description)
{
Text =
lbDescription.Text = description;
}
public void SetProgress(int value)
{
progressBar.Style = ProgressBarStyle.Blocks;
progressBar.Value = value;
}
private void timer_Tick(object sender, EventArgs e)
{
lbElapsedTime.Text = $"Elapsed Time: {StopWatch.ElapsedMilliseconds}ms";
}
}
}