Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Winforms.Views.Bootstrap
- {
- public partial class BootstrapView : Form, IBootstrapView
- {
- public BootstrapView()
- {
- InitializeComponent();
- }
- #region IBootstrapView
- public event QuitApplicationEventHandler QuitApplication;
- private void uxQuit_Click(object sender, EventArgs e)
- {
- if (QuitApplication != null) {
- QuitApplication(this, ActionEventArgs.Empty);
- }
- }
- public event StartBootstrapEventHandler StartBootstrap;
- private bool _startBootstrapCalled = false;
- private void BootstrapView_Activated(object sender, EventArgs e)
- {
- if (StartBootstrap != null && !_startBootstrapCalled) {
- _startBootstrapCalled = true;
- StartBootstrap();
- }
- }
- public string Title
- {
- set { this.Text = value; }
- }
- public ProgressInfo Progress
- {
- set {
- uxProgressMessage.Text = value.Message;
- if (value.IsIndeterminate) {
- uxProgress.Style = ProgressBarStyle.Marquee;
- } else {
- uxProgress.Style = ProgressBarStyle.Continuous;
- uxProgress.Minimum = value.Range.Minimum;
- uxProgress.Maximum = value.Range.Maximum;
- uxProgress.Value = value.Progress;
- }
- }
- }
- #endregion
- }
- partial class BootstrapView
- {
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null)) {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
- #region Windows Form Designer generated code
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.uxQuit = new System.Windows.Forms.Button();
- this.uxProgress = new System.Windows.Forms.ProgressBar();
- this.uxProgressMessage = new System.Windows.Forms.Label();
- this.SuspendLayout();
- //
- // uxQuit
- //
- this.uxQuit.Location = new System.Drawing.Point(402, 44);
- this.uxQuit.Name = "uxQuit";
- this.uxQuit.Size = new System.Drawing.Size(75, 23);
- this.uxQuit.TabIndex = 0;
- this.uxQuit.Text = "Afsluiten";
- this.uxQuit.UseVisualStyleBackColor = true;
- this.uxQuit.Click += new System.EventHandler(this.uxQuit_Click);
- //
- // uxProgress
- //
- this.uxProgress.Location = new System.Drawing.Point(12, 44);
- this.uxProgress.Name = "uxProgress";
- this.uxProgress.Size = new System.Drawing.Size(384, 23);
- this.uxProgress.Style = System.Windows.Forms.ProgressBarStyle.Marquee;
- this.uxProgress.TabIndex = 1;
- //
- // uxProgressMessage
- //
- this.uxProgressMessage.AutoSize = true;
- this.uxProgressMessage.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.uxProgressMessage.Location = new System.Drawing.Point(12, 21);
- this.uxProgressMessage.Name = "uxProgressMessage";
- this.uxProgressMessage.Size = new System.Drawing.Size(157, 16);
- this.uxProgressMessage.TabIndex = 2;
- this.uxProgressMessage.Text = "%uxProgressMessage%";
- //
- // BootstrapView
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(489, 79);
- this.ControlBox = false;
- this.Controls.Add(this.uxProgressMessage);
- this.Controls.Add(this.uxProgress);
- this.Controls.Add(this.uxQuit);
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
- this.Name = "BootstrapView";
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
- this.Text = "%BootstrapView%";
- this.Activated += new System.EventHandler(this.BootstrapView_Activated);
- this.ResumeLayout(false);
- this.PerformLayout();
- }
- #endregion
- private System.Windows.Forms.Button uxQuit;
- private System.Windows.Forms.ProgressBar uxProgress;
- private System.Windows.Forms.Label uxProgressMessage;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement