private bool UpdateSection(Label label, MetroProgressSpinner spinner, InstallSection section) { label.ForeColor = System.Drawing.Color.Black; spinner.Invoke((MethodInvoker)(() => { spinner.Value = 20; })); var success = false; try { switch (section) { case InstallSection.Prepare: success = Helper.Instance.PrepareFiles(); break; case InstallSection.Install: success = Helper.Instance.Install("0", "0", addressTxtBox.Text, webRootTxtBox.Text, "FOG", (logSwitch.Checked) ? "1" : "0", null); break; case InstallSection.Configure: success = Configure(); break; case InstallSection.Secure: success = InstallCerts(); break; } } catch (Exception ex) { logBox.Invoke((MethodInvoker)(() => { logBox.AppendText(ex.Message); })); success = false; } spinner.Invoke((MethodInvoker)(() => { spinner.Value = 100; spinner.ForeColor = (success) ? Color.ForestGreen : Color.Crimson; })); return(success); }
/// <summary> /// The task sync window. /// </summary> /// <param name="access"> /// The access. /// </param> public async void TaskSyncWindow(Task access) { this.Enabled = true; this.MaximizeBox = false; this.MinimizeBox = false; this.Text = "잠시만 기다려주세요..."; if (this.progressSpinner == null) { this.progressSpinner = new MetroProgressSpinner(); } if (!this.Controls.Contains(this.progressSpinner)) { this.Controls.Add(this.progressSpinner); } this.progressSpinner.Size = new Size(150, 150); this.progressSpinner.Location = new Point( (this.Size.Width / 2) - (this.progressSpinner.Size.Width / 2), (this.Size.Height / 2) - (this.progressSpinner.Size.Height / 2)); this.progressSpinner.Reset(); this.progressSpinner.Show(); this.progressSpinner.BringToFront(); try { access.Start(); await access; } catch (Exception exception) { this.InvokeOnMainThread(() => MetroMessageBox.Show(this, exception.ToString())); } finally { this.Enabled = true; if (this.progressSpinner != null) { this.progressSpinner.Hide(); this.Controls.Remove(this.progressSpinner); } } }
private void MakeLoadScreen() { LoadPanel = new MetroPanel(); LoadSpinner = new MetroProgressSpinner(); LoadLabel = new MetroLabel(); LoadLabel2 = new MetroLabel(); LoadPanel.HorizontalScrollbarBarColor = true; LoadPanel.HorizontalScrollbarHighlightOnWheel = false; LoadPanel.HorizontalScrollbarSize = 10; LoadPanel.Location = new System.Drawing.Point(5, 60); LoadPanel.Name = "metroPanel1"; LoadPanel.Size = new System.Drawing.Size(740, 440); LoadPanel.TabIndex = 10; LoadPanel.VerticalScrollbarBarColor = true; LoadPanel.VerticalScrollbarHighlightOnWheel = false; LoadPanel.VerticalScrollbarSize = 10; LoadSpinner.Location = new System.Drawing.Point(326, 123); LoadSpinner.Maximum = 100; LoadSpinner.Name = "metroProgressSpinner1"; LoadSpinner.Size = new System.Drawing.Size(48, 48); LoadSpinner.TabIndex = 2; LoadSpinner.UseSelectable = true; LoadLabel.AutoSize = true; LoadLabel.Location = new System.Drawing.Point(323, 174); LoadLabel.Name = "label1"; LoadLabel.Size = new System.Drawing.Size(55, 15); LoadLabel.TabIndex = 3; LoadLabel.Text = "Working!"; LoadLabel2.AutoSize = true; LoadLabel2.Location = new System.Drawing.Point(170, 189); LoadLabel2.Name = "metroLabel1"; LoadLabel2.Size = new System.Drawing.Size(367, 19); LoadLabel2.TabIndex = 4; LoadLabel2.Text = "Please do not exit this program or restart until this is finished!"; LoadPanel.Controls.Add(LoadSpinner); LoadPanel.Controls.Add(LoadLabel); LoadPanel.Controls.Add(LoadLabel2); Controls.Add(LoadPanel); LoadPanel.BringToFront(); }
private void ConnectionForm_Load_1(object sender, EventArgs e) { tb_password.PasswordChar = '*'; tb_server.Text = "localdb"; tb_password.Text = "1234"; tb_id.Text = "fabio"; cB_true.Checked = true; spinner = new MetroFramework.Controls.MetroProgressSpinner() { Location = new System.Drawing.Point(135, 110), Maximum = 100, Name = "spinner", Size = new System.Drawing.Size(100, 100), TabIndex = 25, Visible = true, }; }
public frmMain() { InitializeComponent(); _loader = loader; _loader.Visible = false; _userDisplayLabel = metroLabelDisplayName; _pictureBoxProfilePhoto = pictureBoxProfilePhoto; _displayNameValue = lblDisplayNameValue; _mobileNumberValue = lblMobileNumberValue; _userPrincipalNameValue = lblUserPrincipalNameValue; _jobTitleValue = lblJobTitleValue; _officeLocationValue = lblOfficeLocationValue; _filesLayout = flowLayoutPanelFiles; _dataGridViewMessages = dataGridViewMessages; ClearControls(); }
private void InitializeComponent() { this.Icon = Resources.Starflier; this.label1 = new System.Windows.Forms.Label(); this.settingsBackgroundWorker = new System.ComponentModel.BackgroundWorker(); this.startDownloadBackgroundWorker = new System.ComponentModel.BackgroundWorker(); this.metroProgressSpinner1 = new MetroFramework.Controls.MetroProgressSpinner(); this.ProgressBar = new MetroFramework.Controls.MetroProgressBar(); this.SuspendLayout(); // // label1 // this.label1.Anchor = System.Windows.Forms.AnchorStyles.None; this.label1.ForeColor = System.Drawing.SystemColors.Control; this.label1.Location = new System.Drawing.Point(47, 17); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(275, 28); this.label1.TabIndex = 1; this.label1.Text = "Updating launcher, please wait."; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // settingsBackgroundWorker // this.settingsBackgroundWorker.WorkerReportsProgress = true; this.settingsBackgroundWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorker1_DoWork); this.settingsBackgroundWorker.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.backgroundWorker1_ProgressChanged); this.settingsBackgroundWorker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.backgroundWorker1_RunWorkerCompleted); // // startDownloadBackgroundWorker // this.startDownloadBackgroundWorker.WorkerReportsProgress = true; this.startDownloadBackgroundWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.startDownloadBackgroundWorker_DoWork); this.startDownloadBackgroundWorker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.startDownloadBackgroundWorker_RunWorkerCompleted); // // metroProgressSpinner1 // this.metroProgressSpinner1.Anchor = System.Windows.Forms.AnchorStyles.None; this.metroProgressSpinner1.Location = new System.Drawing.Point(23, 11); this.metroProgressSpinner1.Maximum = 100; this.metroProgressSpinner1.Name = "metroProgressSpinner1"; this.metroProgressSpinner1.Size = new System.Drawing.Size(35, 33); this.metroProgressSpinner1.Style = MetroFramework.MetroColorStyle.Blue; this.metroProgressSpinner1.TabIndex = 2; this.metroProgressSpinner1.Theme = MetroFramework.MetroThemeStyle.Dark; this.metroProgressSpinner1.UseSelectable = true; // // ProgressBar // this.ProgressBar.Anchor = System.Windows.Forms.AnchorStyles.None; this.ProgressBar.Location = new System.Drawing.Point(27, 48); this.ProgressBar.Name = "ProgressBar"; this.ProgressBar.Size = new System.Drawing.Size(295, 23); this.ProgressBar.Style = MetroFramework.MetroColorStyle.Blue; this.ProgressBar.TabIndex = 3; this.ProgressBar.Theme = MetroFramework.MetroThemeStyle.Dark; // // Patch // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(345, 79); this.ControlBox = false; this.Controls.Add(this.ProgressBar); this.Controls.Add(this.metroProgressSpinner1); this.Controls.Add(this.label1); this.Name = "Patch"; this.Resizable = false; this.Theme = MetroThemeStyle.Dark; this.TopMost = true; this.TransparencyKey = Color.PaleTurquoise; this.Shown += new EventHandler(this.Form1_Shown); this.ResumeLayout(false); }
public BuildPageControl() { MetroSkinManager.ApplyMetroStyle(this); AutoScroll = true; MetroLabel title = new MetroLabel(); MetroSkinManager.ApplyMetroStyle(title); title.Text = "Active target: "; title.Size = new Size(); title.AutoSize = true; title.Location = new Point(64, 64); Controls.Add(title); m_activeBuildComboBox = new MetroComboBox(); MetroSkinManager.ApplyMetroStyle(m_activeBuildComboBox); m_activeBuildComboBox.BindingContext = new BindingContext(); m_activeBuildComboBox.Location = new Point(title.Right, title.Top); m_activeBuildComboBox.SelectedValueChanged += new EventHandler(m_activeBuildComboBox_SelectedValueChanged); Controls.Add(m_activeBuildComboBox); m_progressSpinner = new MetroProgressSpinner(); MetroSkinManager.ApplyMetroStyle(m_progressSpinner); m_progressSpinner.Visible = false; m_progressSpinner.Size = new Size(m_activeBuildComboBox.Height, m_activeBuildComboBox.Height); m_progressSpinner.Value = -1; m_progressSpinner.Location = new Point(m_activeBuildComboBox.Right + DEFAULT_TILE_SEPARATOR.X, m_activeBuildComboBox.Top); Controls.Add(m_progressSpinner); m_buildTile = new MetroTileIcon(); MetroSkinManager.ApplyMetroStyle(m_buildTile); m_buildTile.Text = "BUILD"; m_buildTile.Image = Bitmap.FromFile("resources/icons/appbar.cog.png"); m_buildTile.Size = DEFAULT_TILE_SIZE; m_buildTile.Location = new Point(64, m_activeBuildComboBox.Bottom + DEFAULT_TILE_SEPARATOR.Y + DEFAULT_TILE_SEPARATOR.Y); m_buildTile.Click += new EventHandler(m_buildTile_Click); Controls.Add(m_buildTile); m_rebuildTile = new MetroTileIcon(); MetroSkinManager.ApplyMetroStyle(m_rebuildTile); m_rebuildTile.Text = "REBUILD"; m_rebuildTile.Image = Bitmap.FromFile("resources/icons/appbar.cogs.png"); m_rebuildTile.Size = DEFAULT_TILE_SIZE; m_rebuildTile.Location = new Point(m_buildTile.Right + DEFAULT_TILE_SEPARATOR.X, m_buildTile.Top); m_rebuildTile.Click += new EventHandler(m_rebuildTile_Click); Controls.Add(m_rebuildTile); m_cleanTile = new MetroTileIcon(); MetroSkinManager.ApplyMetroStyle(m_cleanTile); m_cleanTile.Text = "CLEAN"; m_cleanTile.Image = Bitmap.FromFile("resources/icons/appbar.delete.png"); m_cleanTile.Size = DEFAULT_TILE_SIZE; m_cleanTile.Location = new Point(m_rebuildTile.Right + DEFAULT_TILE_SEPARATOR.X, m_rebuildTile.Top); m_cleanTile.Click += new EventHandler(m_cleanTile_Click); Controls.Add(m_cleanTile); m_buildAndRunTile = new MetroTileIcon(); MetroSkinManager.ApplyMetroStyle(m_buildAndRunTile); m_buildAndRunTile.Text = "BUILD && RUN"; m_buildAndRunTile.Image = Bitmap.FromFile("resources/icons/appbar.control.play.png"); m_buildAndRunTile.Size = DEFAULT_TILE_SIZE; m_buildAndRunTile.Location = new Point(m_buildTile.Left, m_buildTile.Bottom + DEFAULT_TILE_SEPARATOR.Y); m_buildAndRunTile.Click += new EventHandler(m_buildAndRunTile_Click); Controls.Add(m_buildAndRunTile); m_runTile = new MetroTileIcon(); MetroSkinManager.ApplyMetroStyle(m_runTile); m_runTile.Text = "RUN"; m_runTile.Image = Bitmap.FromFile("resources/icons/appbar.control.play.png"); m_runTile.Size = DEFAULT_TILE_SIZE; m_runTile.Location = new Point(m_buildAndRunTile.Right + DEFAULT_TILE_SEPARATOR.X, m_buildAndRunTile.Top); m_runTile.Click += new EventHandler(m_runTile_Click); Controls.Add(m_runTile); m_syncTile = new MetroTileIcon(); MetroSkinManager.ApplyMetroStyle(m_syncTile); m_syncTile.Text = "SYNC WITH\nCODE::BLOCKS"; m_syncTile.Image = Bitmap.FromFile("resources/icons/appbar.refresh.png"); m_syncTile.Size = DEFAULT_TILE_SIZE; m_syncTile.Location = new Point(m_runTile.Right + DEFAULT_TILE_SEPARATOR.X, m_runTile.Top); m_syncTile.Click += new EventHandler(m_syncTile_Click); Controls.Add(m_syncTile); }
public static void Stop(this MetroProgressSpinner spinner) { spinner.Visible = false; spinner.Value = 100; }
public static void Start(this MetroProgressSpinner spinner) { spinner.Visible = true; spinner.Value = 50; }