feat: autoupdater

This commit is contained in:
2026-03-10 16:02:23 +01:00
parent f065f58f71
commit a7aad1a5ef
12 changed files with 507 additions and 72 deletions

View File

@@ -28,50 +28,69 @@
/// </summary>
private void InitializeComponent()
{
progressBar1 = new System.Windows.Forms.ProgressBar();
label1 = new System.Windows.Forms.Label();
lblContent = new System.Windows.Forms.Label();
animatedProgressBar1 = new AnimatedProgressBar();
flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
flowLayoutPanel1.SuspendLayout();
SuspendLayout();
//
// progressBar1
//
progressBar1.Location = new System.Drawing.Point(12, 78);
progressBar1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
progressBar1.Name = "progressBar1";
progressBar1.Size = new System.Drawing.Size(422, 29);
progressBar1.Style = System.Windows.Forms.ProgressBarStyle.Marquee;
progressBar1.TabIndex = 0;
progressBar1.Click += progressBar1_Click;
//
// label1
//
label1.AutoSize = true;
label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0);
label1.Location = new System.Drawing.Point(12, 16);
label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0);
label1.Location = new System.Drawing.Point(13, 10);
label1.Name = "label1";
label1.Size = new System.Drawing.Size(121, 20);
label1.Size = new System.Drawing.Size(140, 25);
label1.TabIndex = 1;
label1.Text = "Please wait...";
label1.UseWaitCursor = true;
//
// lblContent
//
lblContent.AutoSize = true;
lblContent.Location = new System.Drawing.Point(13, 41);
lblContent.Location = new System.Drawing.Point(13, 40);
lblContent.Margin = new System.Windows.Forms.Padding(3, 5, 3, 10);
lblContent.Name = "lblContent";
lblContent.Size = new System.Drawing.Size(144, 20);
lblContent.TabIndex = 2;
lblContent.Text = "Saving your changes";
lblContent.UseWaitCursor = true;
//
// animatedProgressBar1
//
animatedProgressBar1.Location = new System.Drawing.Point(13, 73);
animatedProgressBar1.Name = "animatedProgressBar1";
animatedProgressBar1.PrimaryColor = System.Drawing.Color.FromArgb(0, 120, 215);
animatedProgressBar1.ProgressBackColor = System.Drawing.Color.FromArgb(240, 240, 240);
animatedProgressBar1.SecondaryColor = System.Drawing.Color.FromArgb(100, 180, 255);
animatedProgressBar1.Size = new System.Drawing.Size(408, 22);
animatedProgressBar1.TabIndex = 3;
animatedProgressBar1.UseWaitCursor = true;
//
// flowLayoutPanel1
//
flowLayoutPanel1.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom;
flowLayoutPanel1.Controls.Add(label1);
flowLayoutPanel1.Controls.Add(lblContent);
flowLayoutPanel1.Controls.Add(animatedProgressBar1);
flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);
flowLayoutPanel1.Name = "flowLayoutPanel1";
flowLayoutPanel1.Padding = new System.Windows.Forms.Padding(10);
flowLayoutPanel1.Size = new System.Drawing.Size(437, 153);
flowLayoutPanel1.TabIndex = 4;
flowLayoutPanel1.UseWaitCursor = true;
flowLayoutPanel1.WrapContents = false;
//
// PleaseWait
//
AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
AutoSize = true;
ClientSize = new System.Drawing.Size(446, 121);
ClientSize = new System.Drawing.Size(437, 153);
ControlBox = false;
Controls.Add(lblContent);
Controls.Add(label1);
Controls.Add(progressBar1);
Controls.Add(flowLayoutPanel1);
FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
MaximizeBox = false;
@@ -79,16 +98,20 @@
Name = "PleaseWait";
ShowIcon = false;
ShowInTaskbar = false;
StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
Text = "Please Wait";
TopMost = true;
UseWaitCursor = true;
flowLayoutPanel1.ResumeLayout(false);
flowLayoutPanel1.PerformLayout();
ResumeLayout(false);
PerformLayout();
}
#endregion
private System.Windows.Forms.ProgressBar progressBar1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label lblContent;
private AnimatedProgressBar animatedProgressBar1;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
}
}

View File

@@ -8,11 +8,16 @@ namespace CarManagerV3
public PleaseWait(string content = "Saving your changes...")
{
InitializeComponent();
this.SetStyle(ControlStyles.OptimizedDoubleBuffer |
ControlStyles.AllPaintingInWmPaint |
ControlStyles.UserPaint, true);
// loading animation
progressBar1.Style = ProgressBarStyle.Marquee;
progressBar1.MarqueeAnimationSpeed = 30;
animatedProgressBar1.StartAnimation();
lblContent.Text = content;
}
private void progressBar1_Click(object sender, EventArgs e)