private void adjustMaxToolStripMenuItem_Click(object sender, EventArgs e) { ToolStripItem item = (sender as ToolStripItem); if (item != null) { ContextMenuStrip owner = item.Owner as ContextMenuStrip; if (owner != null) { CircularProgressBar.CircularProgressBar progressBar = owner.SourceControl as CircularProgressBar.CircularProgressBar; if (progressBar != null) { var newMax = Microsoft.VisualBasic.Interaction.InputBox("Set Max", "Set Max", "" + progressBar.Maximum); int newMaxInt; if (int.TryParse(newMax, out newMaxInt)) { progressBar.Maximum = newMaxInt; if (progressBar.Text == "Speed") { numericUpDownSpeedRegulator.Maximum = newMaxInt; } } } } } }
private void cpbCount_Click(object sender, EventArgs e) { CircularProgressBar.CircularProgressBar cpb = sender as CircularProgressBar.CircularProgressBar; Random r = new Random(); cpb.Text = r.Next(0, 999).ToString(); }
public static void progressbar____color(CircularProgressBar.CircularProgressBar e, double v) { //value MIN-MAX e.Text = string.Format("{0:0.00}%", v).ToString(); if (v < 100) { e.Value = (int)v; } else { e.Value = 99; } //color if (e.Value < 50) { e.ProgressColor = System.Drawing.Color.IndianRed; } else if (e.Value > 50 && e.Value < 70) { e.ProgressColor = System.Drawing.Color.Orange; } else if (e.Value > 70) { e.ProgressColor = System.Drawing.Color.DarkSeaGreen; } }
private void CreateCircularProgressBar() { foreach (Control ctrl in Controls) { ctrl.Visible = false; } CircularProgressBar.CircularProgressBar bar = new CircularProgressBar.CircularProgressBar(); bar.Location = new Point(Width / 2 - bar.Width / 2, Height / 2 - bar.Height / 2); bar.Value = 0; bar.Minimum = 0; bar.Maximum = 100; bar.SuperscriptText = "%"; bar.Visible = true; Controls.Add(bar); for (int i = 0; i < 100; i++) { Thread.Sleep(10); bar.Value = i; bar.Text = i.ToString(); bar.SubscriptText = $".{rnd.Next(0, 100).ToString()}"; bar.Update(); } Controls.Remove(bar); bar.Dispose(); foreach (Control ctrl in Controls) { ctrl.Visible = true; } }
public static void progressbar_seuil_color(CircularProgressBar.CircularProgressBar e, double v) { //value MIN-MAX e.Text = string.Format("{0:0.00}%", v).ToString(); if (v < 100) { e.Value = (int)v; } else { e.Value = 99; } //color if (((int)Calcul_TRS.produit_1_qualite_seuil_1 < Calcul_TRS.rebut) && (Calcul_TRS.rebut < (int)Calcul_TRS.produit_1_qualite_seuil_2)) { e.ProgressColor = System.Drawing.Color.DarkSeaGreen; } else if (((int)Calcul_TRS.produit_1_qualite_seuil_2 < Calcul_TRS.rebut) && (Calcul_TRS.rebut < (int)Calcul_TRS.produit_1_qualite_seuil_3)) { e.ProgressColor = System.Drawing.Color.Orange; } else if ((int)Calcul_TRS.produit_1_qualite_seuil_3 < Calcul_TRS.rebut) // alerte { e.ProgressColor = System.Drawing.Color.IndianRed; } }
private void ProcessIncreaseTo(CircularProgressBar.CircularProgressBar bar, int Num) { CheckForIllegalCrossThreadCalls = false; int increase = Num - bar.Value; if (increase > 0) { bar.Increment(increase); bar.Text = Num.ToString() + "%"; } }
public void UpdateCircularProgressBar(CircularProgressBar.CircularProgressBar cpb, int i) { if (cpb.InvokeRequired) { UpdateCircularProgressBarCallback d = new UpdateCircularProgressBarCallback(UpdateCircularProgressBar); this.Invoke(d, new object[] { cpb, i }); } else { cpb.Value = i; } }
public void CheckColor(CircularProgressBar.CircularProgressBar cpb) { if (cpb.Value > 90) { cpb.ProgressColor = Color.FromArgb(255, 0, 0); } else if (cpb.Value > 80) { cpb.ProgressColor = Color.FromArgb(255, 75, 0); } else if (cpb.Value > 70) { cpb.ProgressColor = Color.FromArgb(255, 160, 0); } else if (cpb.Value > 60) { cpb.ProgressColor = Color.FromArgb(255, 240, 0); } else if (cpb.Value > 50) { cpb.ProgressColor = Color.FromArgb(200, 255, 0); } else if (cpb.Value > 40) { cpb.ProgressColor = Color.FromArgb(140, 255, 0); } else if (cpb.Value > 30) { cpb.ProgressColor = Color.FromArgb(0, 255, 0); } else if (cpb.Value > 20) { cpb.ProgressColor = Color.FromArgb(0, 255, 60); } else if (cpb.Value > 10) { cpb.ProgressColor = Color.FromArgb(0, 255, 110); } else if (cpb.Value > 0) { cpb.ProgressColor = Color.FromArgb(0, 255, 200); } }
CircularProgressBar.CircularProgressBar Circular(int value) { CircularProgressBar.CircularProgressBar pbUpload = new CircularProgressBar.CircularProgressBar(); MainPanel.Controls.Add(pbUpload); pbUpload.Width = 75; pbUpload.Height = 60; pbUpload.Top = 135; pbUpload.Left = 806; pbUpload.Minimum = 0; pbUpload.Maximum = 100; //pbUpload.Value = value; //the value of the transfare process //pbUpload.Update(); for (int i = 0; i < value; i++) { Thread.Sleep(5); pbUpload.Value = i; pbUpload.Update(); } return(pbUpload); }
private void InitializeComponent() { _progressbar = new CircularProgressBar.CircularProgressBar(); _Label1 = new System.Windows.Forms.Label(); _exitAppLink = new System.Windows.Forms.LinkLabel(); _exitAppLink.LinkClicked += exitAppLink_LinkClicked; this.SuspendLayout(); // // progressbar // this.progressbar.AnimationFunction = KnownAnimationFunctions.Liner; this.progressbar.Anchor = System.Windows.Forms.AnchorStyles.None; this.progressbar.AnimationSpeed = 500; this.progressbar.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(255))))); this.progressbar.Font = new System.Drawing.Font("Arial", 72F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(178))); this.progressbar.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); this.progressbar.InnerColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.progressbar.InnerMargin = 2; this.progressbar.InnerWidth = -1; this.progressbar.Location = new System.Drawing.Point(12, 12); this.progressbar.MarqueeAnimationSpeed = 2000; this.progressbar.Name = "progressbar"; this.progressbar.OuterColor = System.Drawing.Color.Gray; this.progressbar.OuterMargin = -25; this.progressbar.OuterWidth = 26; this.progressbar.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0))))); this.progressbar.ProgressWidth = 25; this.progressbar.SecondaryFont = new System.Drawing.Font("Arial", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(178))); this.progressbar.Size = new System.Drawing.Size(320, 320); this.progressbar.StartAngle = 270; this.progressbar.SubscriptColor = System.Drawing.Color.FromArgb(((int)(((byte)(166)))), ((int)(((byte)(166)))), ((int)(((byte)(166))))); this.progressbar.SubscriptMargin = new System.Windows.Forms.Padding(10, -35, 0, 0); this.progressbar.SubscriptText = ".23"; this.progressbar.SuperscriptColor = System.Drawing.Color.FromArgb(((int)(((byte)(166)))), ((int)(((byte)(166)))), ((int)(((byte)(166))))); this.progressbar.SuperscriptMargin = new System.Windows.Forms.Padding(10, 35, 0, 0); this.progressbar.SuperscriptText = "°C"; this.progressbar.TabIndex = 3; this.progressbar.Text = "32"; this.progressbar.TextMargin = new System.Windows.Forms.Padding(-8, 8, 0, 0); this.progressbar.Value = 68; // // Label1 // _Label1.AutoSize = true; _Label1.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); _Label1.Location = new System.Drawing.Point(382, 278); _Label1.Name = "_Label1"; _Label1.Size = new System.Drawing.Size(44, 13); _Label1.TabIndex = 353; // // exitAppLink // _Label1.Text = "Label1"; // //exitAppLink // _exitAppLink.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; _exitAppLink.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); _exitAppLink.LinkColor = System.Drawing.Color.LightGray; _exitAppLink.Location = new System.Drawing.Point(645, 418); _exitAppLink.Name = "_exitAppLink"; _exitAppLink.Size = new System.Drawing.Size(143, 23); _exitAppLink.TabIndex = 354; _exitAppLink.TabStop = true; _exitAppLink.Text = "Exit"; _exitAppLink.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // loadingForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6.0F, 13.0F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.WhiteSmoke; this.ClientSize = new System.Drawing.Size(800, 450); this.ControlBox = false; this.Controls.Add(_exitAppLink); this.Controls.Add(_Label1); this.Controls.Add(_progressbar); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "loadingForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Form1"; this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.ResumeLayout(false); this.PerformLayout(); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { CircularProgressBar.CircularProgressBar circularProgressBar1; System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); this.panel1 = new System.Windows.Forms.Panel(); this.btnSettings = new System.Windows.Forms.Button(); this.btnContactUs = new System.Windows.Forms.Button(); this.btnCalender = new System.Windows.Forms.Button(); this.btnAnalytics = new System.Windows.Forms.Button(); this.btnDashboard = new System.Windows.Forms.Button(); this.panel2 = new System.Windows.Forms.Panel(); this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.pnlNav = new System.Windows.Forms.Panel(); this.Dashboard = new System.Windows.Forms.Label(); this.textBox1 = new System.Windows.Forms.TextBox(); this.button1 = new System.Windows.Forms.Button(); this.panel3 = new System.Windows.Forms.Panel(); this.pictureBox2 = new System.Windows.Forms.PictureBox(); this.label4 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.panel4 = new System.Windows.Forms.Panel(); this.pictureBox3 = new System.Windows.Forms.PictureBox(); this.label6 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label(); this.panel5 = new System.Windows.Forms.Panel(); this.label11 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); this.panel6 = new System.Windows.Forms.Panel(); this.pictureBox5 = new System.Windows.Forms.PictureBox(); this.label14 = new System.Windows.Forms.Label(); this.panel7 = new System.Windows.Forms.Panel(); this.label13 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label(); this.panel8 = new System.Windows.Forms.Panel(); this.label15 = new System.Windows.Forms.Label(); this.label16 = new System.Windows.Forms.Label(); circularProgressBar1 = new CircularProgressBar.CircularProgressBar(); this.panel1.SuspendLayout(); this.panel2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.panel3.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); this.panel4.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit(); this.panel5.SuspendLayout(); this.panel6.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).BeginInit(); this.panel7.SuspendLayout(); this.panel8.SuspendLayout(); this.SuspendLayout(); // // circularProgressBar1 // circularProgressBar1.AnimationFunction = WinFormAnimation.KnownAnimationFunctions.Liner; circularProgressBar1.AnimationSpeed = 500; circularProgressBar1.BackColor = System.Drawing.Color.Transparent; circularProgressBar1.Font = new System.Drawing.Font("Microsoft Sans Serif", 72F, System.Drawing.FontStyle.Bold); circularProgressBar1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); circularProgressBar1.InnerColor = System.Drawing.Color.FromArgb(((int)(((byte)(68)))), ((int)(((byte)(62)))), ((int)(((byte)(112))))); circularProgressBar1.InnerMargin = 2; circularProgressBar1.InnerWidth = -1; circularProgressBar1.Location = new System.Drawing.Point(42, 59); circularProgressBar1.MarqueeAnimationSpeed = 2000; circularProgressBar1.Name = "circularProgressBar1"; circularProgressBar1.OuterColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); circularProgressBar1.OuterMargin = -25; circularProgressBar1.OuterWidth = 26; circularProgressBar1.ProgressColor = System.Drawing.Color.DeepSkyBlue; circularProgressBar1.ProgressWidth = 25; circularProgressBar1.SecondaryFont = new System.Drawing.Font("Microsoft Sans Serif", 36F); circularProgressBar1.Size = new System.Drawing.Size(175, 167); circularProgressBar1.StartAngle = 270; circularProgressBar1.Style = System.Windows.Forms.ProgressBarStyle.Continuous; circularProgressBar1.SubscriptColor = System.Drawing.Color.FromArgb(((int)(((byte)(166)))), ((int)(((byte)(166)))), ((int)(((byte)(166))))); circularProgressBar1.SubscriptMargin = new System.Windows.Forms.Padding(10, -35, 0, 0); circularProgressBar1.SubscriptText = ".23"; circularProgressBar1.SuperscriptColor = System.Drawing.Color.FromArgb(((int)(((byte)(166)))), ((int)(((byte)(166)))), ((int)(((byte)(166))))); circularProgressBar1.SuperscriptMargin = new System.Windows.Forms.Padding(10, 35, 0, 0); circularProgressBar1.SuperscriptText = "°C"; circularProgressBar1.TabIndex = 3; circularProgressBar1.TextMargin = new System.Windows.Forms.Padding(8, 8, 0, 0); circularProgressBar1.Value = 68; // // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(34)))), ((int)(((byte)(31)))), ((int)(((byte)(52))))); this.panel1.Controls.Add(this.btnSettings); this.panel1.Controls.Add(this.btnContactUs); this.panel1.Controls.Add(this.btnCalender); this.panel1.Controls.Add(this.btnAnalytics); this.panel1.Controls.Add(this.btnDashboard); this.panel1.Controls.Add(this.panel2); this.panel1.Dock = System.Windows.Forms.DockStyle.Left; this.panel1.Location = new System.Drawing.Point(0, 0); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(200, 577); this.panel1.TabIndex = 0; this.panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.panel1_Paint); // // btnSettings // this.btnSettings.FlatAppearance.BorderSize = 0; this.btnSettings.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnSettings.Font = new System.Drawing.Font("Nirmala UI", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnSettings.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(124)))), ((int)(((byte)(181))))); this.btnSettings.Image = global::ui.Properties.Resources.settings; this.btnSettings.Location = new System.Drawing.Point(0, 532); this.btnSettings.Name = "btnSettings"; this.btnSettings.Size = new System.Drawing.Size(200, 45); this.btnSettings.TabIndex = 1; this.btnSettings.Text = "Settings"; this.btnSettings.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage; this.btnSettings.UseMnemonic = false; this.btnSettings.UseVisualStyleBackColor = true; this.btnSettings.Click += new System.EventHandler(this.btnSettings_Click); this.btnSettings.Leave += new System.EventHandler(this.btnSettings_Leave); // // btnContactUs // this.btnContactUs.FlatAppearance.BorderSize = 0; this.btnContactUs.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnContactUs.Font = new System.Drawing.Font("Nirmala UI", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnContactUs.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(124)))), ((int)(((byte)(181))))); this.btnContactUs.Image = global::ui.Properties.Resources.Conact; this.btnContactUs.Location = new System.Drawing.Point(0, 270); this.btnContactUs.Name = "btnContactUs"; this.btnContactUs.Size = new System.Drawing.Size(200, 42); this.btnContactUs.TabIndex = 1; this.btnContactUs.Text = "Contact Us"; this.btnContactUs.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage; this.btnContactUs.UseMnemonic = false; this.btnContactUs.UseVisualStyleBackColor = true; this.btnContactUs.Click += new System.EventHandler(this.btnContactUs_Click); this.btnContactUs.Leave += new System.EventHandler(this.btnContactUs_Leave); // // btnCalender // this.btnCalender.Dock = System.Windows.Forms.DockStyle.Top; this.btnCalender.FlatAppearance.BorderSize = 0; this.btnCalender.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnCalender.Font = new System.Drawing.Font("Nirmala UI", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnCalender.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(124)))), ((int)(((byte)(181))))); this.btnCalender.Image = global::ui.Properties.Resources.calendar; this.btnCalender.Location = new System.Drawing.Point(0, 228); this.btnCalender.Name = "btnCalender"; this.btnCalender.Size = new System.Drawing.Size(200, 42); this.btnCalender.TabIndex = 1; this.btnCalender.Text = "Calender"; this.btnCalender.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage; this.btnCalender.UseMnemonic = false; this.btnCalender.UseVisualStyleBackColor = true; this.btnCalender.Click += new System.EventHandler(this.btnCalender_Click); this.btnCalender.Leave += new System.EventHandler(this.btnCalender_Leave); // // btnAnalytics // this.btnAnalytics.Dock = System.Windows.Forms.DockStyle.Top; this.btnAnalytics.FlatAppearance.BorderSize = 0; this.btnAnalytics.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnAnalytics.Font = new System.Drawing.Font("Nirmala UI", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnAnalytics.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(124)))), ((int)(((byte)(181))))); this.btnAnalytics.Image = global::ui.Properties.Resources.diagram; this.btnAnalytics.Location = new System.Drawing.Point(0, 186); this.btnAnalytics.Name = "btnAnalytics"; this.btnAnalytics.Size = new System.Drawing.Size(200, 42); this.btnAnalytics.TabIndex = 1; this.btnAnalytics.Text = "Analytics"; this.btnAnalytics.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage; this.btnAnalytics.UseMnemonic = false; this.btnAnalytics.UseVisualStyleBackColor = true; this.btnAnalytics.Click += new System.EventHandler(this.btnAnalytics_Click); this.btnAnalytics.Leave += new System.EventHandler(this.btnAnalytics_Leave); // // btnDashboard // this.btnDashboard.Dock = System.Windows.Forms.DockStyle.Top; this.btnDashboard.FlatAppearance.BorderSize = 0; this.btnDashboard.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnDashboard.Font = new System.Drawing.Font("Nirmala UI", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnDashboard.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(124)))), ((int)(((byte)(181))))); this.btnDashboard.Image = global::ui.Properties.Resources.home; this.btnDashboard.Location = new System.Drawing.Point(0, 144); this.btnDashboard.Name = "btnDashboard"; this.btnDashboard.Size = new System.Drawing.Size(200, 42); this.btnDashboard.TabIndex = 1; this.btnDashboard.Text = "Dashboard"; this.btnDashboard.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage; this.btnDashboard.UseMnemonic = false; this.btnDashboard.UseVisualStyleBackColor = true; this.btnDashboard.Click += new System.EventHandler(this.btnDashboard_Click); this.btnDashboard.Leave += new System.EventHandler(this.btnDashboard_Leave); // // panel2 // this.panel2.Controls.Add(this.label2); this.panel2.Controls.Add(this.label1); this.panel2.Controls.Add(this.pictureBox1); this.panel2.Dock = System.Windows.Forms.DockStyle.Top; this.panel2.Location = new System.Drawing.Point(0, 0); this.panel2.Name = "panel2"; this.panel2.Size = new System.Drawing.Size(200, 144); this.panel2.TabIndex = 0; // // label2 // this.label2.AutoSize = true; this.label2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(34)))), ((int)(((byte)(31)))), ((int)(((byte)(52))))); this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label2.ForeColor = System.Drawing.SystemColors.AppWorkspace; this.label2.ImageAlign = System.Drawing.ContentAlignment.TopLeft; this.label2.Location = new System.Drawing.Point(12, 120); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(169, 12); this.label2.TabIndex = 1; this.label2.Text = "Online Time: 3 hours 22 minutes "; this.label2.Click += new System.EventHandler(this.label2_Click); // // label1 // this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(124)))), ((int)(((byte)(181))))); this.label1.Location = new System.Drawing.Point(52, 88); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(86, 16); this.label1.TabIndex = 1; this.label1.Text = "User Name"; // // pictureBox1 // this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); this.pictureBox1.Location = new System.Drawing.Point(65, 22); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(63, 63); this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; this.pictureBox1.TabIndex = 0; this.pictureBox1.TabStop = false; // // pnlNav // this.pnlNav.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(52)))), ((int)(((byte)(186)))), ((int)(((byte)(235))))); this.pnlNav.Location = new System.Drawing.Point(0, 193); this.pnlNav.Name = "pnlNav"; this.pnlNav.Size = new System.Drawing.Size(3, 100); this.pnlNav.TabIndex = 1; // // Dashboard // this.Dashboard.AutoSize = true; this.Dashboard.Font = new System.Drawing.Font("Microsoft Sans Serif", 21F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Dashboard.ForeColor = System.Drawing.Color.DarkGray; this.Dashboard.Location = new System.Drawing.Point(227, 12); this.Dashboard.Name = "Dashboard"; this.Dashboard.Size = new System.Drawing.Size(163, 32); this.Dashboard.TabIndex = 2; this.Dashboard.Text = "Dashboard"; // // textBox1 // this.textBox1.BackColor = System.Drawing.Color.DimGray; this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.None; this.textBox1.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.textBox1.ForeColor = System.Drawing.Color.White; this.textBox1.Location = new System.Drawing.Point(588, 22); this.textBox1.Multiline = true; this.textBox1.Name = "textBox1"; this.textBox1.Size = new System.Drawing.Size(258, 22); this.textBox1.TabIndex = 3; this.textBox1.Text = "Search for some thing..."; // // button1 // this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.button1.ForeColor = System.Drawing.Color.White; this.button1.Location = new System.Drawing.Point(901, 22); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(25, 22); this.button1.TabIndex = 4; this.button1.Text = "X"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.Form1_Leave); // // panel3 // this.panel3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(68)))), ((int)(((byte)(62)))), ((int)(((byte)(112))))); this.panel3.Controls.Add(this.pictureBox2); this.panel3.Controls.Add(this.label4); this.panel3.Controls.Add(this.label5); this.panel3.Controls.Add(this.label3); this.panel3.Location = new System.Drawing.Point(223, 88); this.panel3.Name = "panel3"; this.panel3.Size = new System.Drawing.Size(258, 130); this.panel3.TabIndex = 5; // // pictureBox2 // this.pictureBox2.Image = global::ui.Properties.Resources.money_bag; this.pictureBox2.Location = new System.Drawing.Point(118, 32); this.pictureBox2.Name = "pictureBox2"; this.pictureBox2.Size = new System.Drawing.Size(137, 74); this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; this.pictureBox2.TabIndex = 2; this.pictureBox2.TabStop = false; // // label4 // this.label4.AutoSize = true; this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label4.ForeColor = System.Drawing.Color.DeepSkyBlue; this.label4.Location = new System.Drawing.Point(15, 56); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(83, 33); this.label4.TabIndex = 1; this.label4.Text = "$599"; // // label5 // this.label5.AutoSize = true; this.label5.Font = new System.Drawing.Font("Nirmala UI", 9.75F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label5.ForeColor = System.Drawing.Color.Silver; this.label5.Location = new System.Drawing.Point(15, 105); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(97, 17); this.label5.TabIndex = 0; this.label5.Text = "Last of 28 Days"; // // label3 // this.label3.AutoSize = true; this.label3.Font = new System.Drawing.Font("Nirmala UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label3.ForeColor = System.Drawing.Color.White; this.label3.Location = new System.Drawing.Point(13, 19); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(85, 25); this.label3.TabIndex = 0; this.label3.Text = "Earnings"; // // panel4 // this.panel4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(68)))), ((int)(((byte)(62)))), ((int)(((byte)(112))))); this.panel4.Controls.Add(this.pictureBox3); this.panel4.Controls.Add(this.label6); this.panel4.Controls.Add(this.label7); this.panel4.Controls.Add(this.label8); this.panel4.Location = new System.Drawing.Point(507, 88); this.panel4.Name = "panel4"; this.panel4.Size = new System.Drawing.Size(204, 130); this.panel4.TabIndex = 5; this.panel4.Paint += new System.Windows.Forms.PaintEventHandler(this.panel4_Paint); // // pictureBox3 // this.pictureBox3.Image = global::ui.Properties.Resources.downloads; this.pictureBox3.Location = new System.Drawing.Point(118, 47); this.pictureBox3.Name = "pictureBox3"; this.pictureBox3.Size = new System.Drawing.Size(67, 59); this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; this.pictureBox3.TabIndex = 2; this.pictureBox3.TabStop = false; // // label6 // this.label6.AutoSize = true; this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label6.ForeColor = System.Drawing.Color.LightGreen; this.label6.Location = new System.Drawing.Point(15, 56); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(87, 33); this.label6.TabIndex = 1; this.label6.Text = "12K+"; // // label7 // this.label7.AutoSize = true; this.label7.Font = new System.Drawing.Font("Nirmala UI", 9.75F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label7.ForeColor = System.Drawing.Color.Silver; this.label7.Location = new System.Drawing.Point(15, 105); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(97, 17); this.label7.TabIndex = 0; this.label7.Text = "Last of 28 Days"; // // label8 // this.label8.AutoSize = true; this.label8.Font = new System.Drawing.Font("Nirmala UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label8.ForeColor = System.Drawing.Color.White; this.label8.Location = new System.Drawing.Point(13, 19); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(116, 25); this.label8.TabIndex = 0; this.label8.Text = "Marketplace"; // // panel5 // this.panel5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(68)))), ((int)(((byte)(62)))), ((int)(((byte)(112))))); this.panel5.Controls.Add(circularProgressBar1); this.panel5.Controls.Add(this.label11); this.panel5.Controls.Add(this.label9); this.panel5.Location = new System.Drawing.Point(223, 240); this.panel5.Name = "panel5"; this.panel5.Size = new System.Drawing.Size(258, 298); this.panel5.TabIndex = 5; // // label11 // this.label11.AutoSize = true; this.label11.Font = new System.Drawing.Font("Nirmala UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label11.ForeColor = System.Drawing.Color.White; this.label11.Location = new System.Drawing.Point(13, 19); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(85, 25); this.label11.TabIndex = 0; this.label11.Text = "Progress"; // // label9 // this.label9.AutoSize = true; this.label9.Font = new System.Drawing.Font("Nirmala UI", 9.75F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label9.ForeColor = System.Drawing.Color.Silver; this.label9.Location = new System.Drawing.Point(15, 237); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(97, 17); this.label9.TabIndex = 0; this.label9.Text = "Last of 28 Days"; // // panel6 // this.panel6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(68)))), ((int)(((byte)(62)))), ((int)(((byte)(112))))); this.panel6.Controls.Add(this.pictureBox5); this.panel6.Controls.Add(this.label14); this.panel6.Location = new System.Drawing.Point(507, 240); this.panel6.Name = "panel6"; this.panel6.Size = new System.Drawing.Size(402, 214); this.panel6.TabIndex = 5; // // pictureBox5 // this.pictureBox5.Image = global::ui.Properties.Resources.chart_diagram; this.pictureBox5.Location = new System.Drawing.Point(18, 47); this.pictureBox5.Name = "pictureBox5"; this.pictureBox5.Size = new System.Drawing.Size(346, 155); this.pictureBox5.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; this.pictureBox5.TabIndex = 2; this.pictureBox5.TabStop = false; // // label14 // this.label14.AutoSize = true; this.label14.Font = new System.Drawing.Font("Nirmala UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label14.ForeColor = System.Drawing.Color.White; this.label14.Location = new System.Drawing.Point(13, 19); this.label14.Name = "label14"; this.label14.Size = new System.Drawing.Size(85, 25); this.label14.TabIndex = 0; this.label14.Text = "Earnings"; // // panel7 // this.panel7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(68)))), ((int)(((byte)(62)))), ((int)(((byte)(112))))); this.panel7.Controls.Add(this.label13); this.panel7.Controls.Add(this.label10); this.panel7.Location = new System.Drawing.Point(507, 477); this.panel7.Name = "panel7"; this.panel7.Size = new System.Drawing.Size(402, 61); this.panel7.TabIndex = 5; this.panel7.Paint += new System.Windows.Forms.PaintEventHandler(this.panel4_Paint); // // label13 // this.label13.AutoSize = true; this.label13.Font = new System.Drawing.Font("Nirmala UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label13.ForeColor = System.Drawing.Color.White; this.label13.Location = new System.Drawing.Point(13, 9); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(106, 25); this.label13.TabIndex = 0; this.label13.Text = "Downloads"; // // label10 // this.label10.AutoSize = true; this.label10.Font = new System.Drawing.Font("Nirmala UI", 9.75F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label10.ForeColor = System.Drawing.Color.Silver; this.label10.Location = new System.Drawing.Point(18, 34); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(97, 17); this.label10.TabIndex = 0; this.label10.Text = "Last of 28 Days"; // // panel8 // this.panel8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(68)))), ((int)(((byte)(62)))), ((int)(((byte)(112))))); this.panel8.Controls.Add(this.label15); this.panel8.Controls.Add(this.label16); this.panel8.Location = new System.Drawing.Point(743, 88); this.panel8.Name = "panel8"; this.panel8.Size = new System.Drawing.Size(166, 130); this.panel8.TabIndex = 5; this.panel8.Paint += new System.Windows.Forms.PaintEventHandler(this.panel4_Paint); // // label15 // this.label15.AutoSize = true; this.label15.Font = new System.Drawing.Font("Nirmala UI", 9.75F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label15.ForeColor = System.Drawing.Color.Silver; this.label15.Location = new System.Drawing.Point(15, 105); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(97, 17); this.label15.TabIndex = 0; this.label15.Text = "Last of 28 Days"; // // label16 // this.label16.AutoSize = true; this.label16.Font = new System.Drawing.Font("Nirmala UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label16.ForeColor = System.Drawing.Color.White; this.label16.Location = new System.Drawing.Point(13, 19); this.label16.Name = "label16"; this.label16.Size = new System.Drawing.Size(106, 25); this.label16.TabIndex = 0; this.label16.Text = "Downloads"; // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(72)))), ((int)(((byte)(68)))), ((int)(((byte)(97))))); this.ClientSize = new System.Drawing.Size(951, 577); this.Controls.Add(this.panel6); this.Controls.Add(this.panel5); this.Controls.Add(this.panel7); this.Controls.Add(this.panel8); this.Controls.Add(this.panel4); this.Controls.Add(this.panel3); this.Controls.Add(this.button1); this.Controls.Add(this.textBox1); this.Controls.Add(this.Dashboard); this.Controls.Add(this.pnlNav); this.Controls.Add(this.panel1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Name = "Form1"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Form1"; this.Load += new System.EventHandler(this.Form1_Load); this.panel1.ResumeLayout(false); this.panel2.ResumeLayout(false); this.panel2.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.panel3.ResumeLayout(false); this.panel3.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); this.panel4.ResumeLayout(false); this.panel4.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit(); this.panel5.ResumeLayout(false); this.panel5.PerformLayout(); this.panel6.ResumeLayout(false); this.panel6.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).EndInit(); this.panel7.ResumeLayout(false); this.panel7.PerformLayout(); this.panel8.ResumeLayout(false); this.panel8.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); }
public async Task Update(double replayPlaybackLength, double totalLength, Form owner, ProgressBar progressBar, Label associatedLabel, CancellationToken cancellationToken) { double playbackRatio = Math.Round(replayPlaybackLength / totalLength * 100 / replayPlaybackLength, 2); owner.Invoke(new Action(() => { progressBar.Visible = false; progressBar.Value = 0; progressBar.Minimum = 0; progressBar.Maximum = (int)replayPlaybackLength; progressBar.Visible = true; })); do { if (cancellationToken.IsCancellationRequested) { await Task.Run(() => owner.Invoke(new Action(() => associatedLabel.Text = "Cancelled!"))); cancellationToken.ThrowIfCancellationRequested(); } await Task.Delay(1000); owner.Invoke(new Action(() => { ++progressBar.Value; double textProgress = double.Parse(progressBar.Text); progressBar.Text = $"{textProgress + playbackRatio}"; })); } while (progressBar.Value < progressBar.Maximum); }
public void GetExpenditureOverview(CircularProgressBar.CircularProgressBar bar1, Label rule1, Label current1, Label limit1, CircularProgressBar.CircularProgressBar bar2, Label rule2, Label current2, Label limit2, CircularProgressBar.CircularProgressBar bar3, Label rule3, Label current3, Label limit3) { var expenditureOverview = _expenditureService.GetExpenditureOverview(); if (expenditureOverview.Count != 0) { var debitExpense = expenditureOverview.FirstOrDefault(eo => eo.ExpenditureDesc == "Debit Expense"); bar1.Maximum = (int)debitExpense.ExpenditureLimit; rule1.Text = debitExpense.ExpenditureDesc; current1.Text = "Current: " + debitExpense.ExpenditureTotal.ToString(); limit1.Text = "Limit: " + debitExpense.ExpenditureLimit.ToString(); if (debitExpense.ExpenditureTotal <= debitExpense.ExpenditureLimit) { bar1.Value = (int)debitExpense.ExpenditureTotal; } else { bar1.Value = (int)debitExpense.ExpenditureLimit; bar1.ProgressColor = SystemRed; } var livingExpense = expenditureOverview.FirstOrDefault(eo => eo.ExpenditureDesc == "Living Expense"); bar2.Maximum = (int)livingExpense.ExpenditureLimit; rule2.Text = livingExpense.ExpenditureDesc; current2.Text = "Current: " + livingExpense.ExpenditureTotal.ToString(); limit2.Text = "Limit: " + livingExpense.ExpenditureLimit.ToString(); if (livingExpense.ExpenditureTotal <= livingExpense.ExpenditureLimit) { bar2.Value = (int)livingExpense.ExpenditureTotal; } else { bar2.Value = (int)livingExpense.ExpenditureLimit; bar2.ProgressColor = SystemRed; } var otherExpense = expenditureOverview.FirstOrDefault(eo => eo.ExpenditureDesc == "Other Expense"); bar3.Maximum = (int)otherExpense.ExpenditureLimit; rule3.Text = otherExpense.ExpenditureDesc; current3.Text = "Current: " + otherExpense.ExpenditureTotal.ToString(); limit3.Text = "Limit: " + otherExpense.ExpenditureLimit.ToString(); if (otherExpense.ExpenditureTotal <= otherExpense.ExpenditureLimit) { bar3.Value = (int)otherExpense.ExpenditureTotal; } else { bar3.Value = (int)otherExpense.ExpenditureLimit; bar3.ProgressColor = SystemRed; } } }
private void InitializeComponent() { System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend(); System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series(); System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series(); System.Windows.Forms.DataVisualization.Charting.Title title1 = new System.Windows.Forms.DataVisualization.Charting.Title(); System.Windows.Forms.DataVisualization.Charting.Title title2 = new System.Windows.Forms.DataVisualization.Charting.Title(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Features)); this.lastWeekDataChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.label2 = new System.Windows.Forms.Label(); this.circularProgressBar = new CircularProgressBar.CircularProgressBar(); this.label1 = new System.Windows.Forms.Label(); this.myPanel1 = new AlertsProject.MyPanel(); this.numberOfComponentsLabel = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.avgNumOfAffectedComponentsLabel = new System.Windows.Forms.Label(); this.averageNumOfFaultsLabel = new System.Windows.Forms.Label(); this.numberOfFaultsLabel = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.lastWeekDataChart)).BeginInit(); this.myPanel1.SuspendLayout(); this.SuspendLayout(); // // lastWeekDataChart // this.lastWeekDataChart.BackColor = System.Drawing.Color.Transparent; this.lastWeekDataChart.BackSecondaryColor = System.Drawing.Color.Transparent; chartArea1.Area3DStyle.LightStyle = System.Windows.Forms.DataVisualization.Charting.LightStyle.Realistic; chartArea1.AxisX.LabelAutoFitStyle = ((System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles)((((System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.IncreaseFont | System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.StaggeredLabels) | System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.LabelsAngleStep30) | System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.WordWrap))); chartArea1.AxisX.TitleFont = new System.Drawing.Font("Century Gothic", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); chartArea1.AxisX.TitleForeColor = System.Drawing.Color.White; chartArea1.BackColor = System.Drawing.Color.Transparent; chartArea1.BorderColor = System.Drawing.Color.Transparent; chartArea1.Name = "ChartArea1"; this.lastWeekDataChart.ChartAreas.Add(chartArea1); legend1.Name = "Legend1"; legend1.TitleAlignment = System.Drawing.StringAlignment.Near; this.lastWeekDataChart.Legends.Add(legend1); this.lastWeekDataChart.Location = new System.Drawing.Point(96, 123); this.lastWeekDataChart.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.lastWeekDataChart.Name = "lastWeekDataChart"; this.lastWeekDataChart.Palette = System.Windows.Forms.DataVisualization.Charting.ChartColorPalette.Bright; this.lastWeekDataChart.RightToLeft = System.Windows.Forms.RightToLeft.Yes; series1.ChartArea = "ChartArea1"; series1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(64))))); series1.Font = new System.Drawing.Font("Century Gothic", 24F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); series1.LabelBackColor = System.Drawing.Color.Transparent; series1.Legend = "Legend1"; series1.MarkerBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192))))); series1.Name = "מספר הרכיבים"; series2.ChartArea = "ChartArea1"; series2.Color = System.Drawing.Color.Teal; series2.Font = new System.Drawing.Font("Century Gothic", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); series2.Legend = "Legend1"; series2.Name = "מספר התקלות "; this.lastWeekDataChart.Series.Add(series1); this.lastWeekDataChart.Series.Add(series2); this.lastWeekDataChart.Size = new System.Drawing.Size(840, 483); this.lastWeekDataChart.TabIndex = 50; this.lastWeekDataChart.Text = "fgfgdgg"; title1.Alignment = System.Drawing.ContentAlignment.TopCenter; title1.BackColor = System.Drawing.Color.Transparent; title1.Font = new System.Drawing.Font("Century Gothic", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); title1.Name = "כמות"; title1.Text = "כמות הרכיבים והתקלות הרשומים במערכת"; title2.Name = "תאריך"; this.lastWeekDataChart.Titles.Add(title1); this.lastWeekDataChart.Titles.Add(title2); this.lastWeekDataChart.Click += new System.EventHandler(this.lastWeekDataChart_Click); // // label2 // this.label2.AutoSize = true; this.label2.BackColor = System.Drawing.Color.Transparent; this.label2.Font = new System.Drawing.Font("Century Gothic", 39.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label2.ForeColor = System.Drawing.Color.Black; this.label2.Location = new System.Drawing.Point(1184, 14); this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label2.Name = "label2"; this.label2.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.label2.Size = new System.Drawing.Size(450, 93); this.label2.TabIndex = 51; this.label2.Text = "סטטיסטיקות"; // // circularProgressBar // this.circularProgressBar.AnimationFunction = WinFormAnimation.KnownAnimationFunctions.Liner; this.circularProgressBar.AnimationSpeed = 500; this.circularProgressBar.BackColor = System.Drawing.Color.Transparent; this.circularProgressBar.Font = new System.Drawing.Font("Century Gothic", 39.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.circularProgressBar.ForeColor = System.Drawing.Color.White; this.circularProgressBar.InnerColor = System.Drawing.SystemColors.MenuHighlight; this.circularProgressBar.InnerMargin = 2; this.circularProgressBar.InnerWidth = -1; this.circularProgressBar.Location = new System.Drawing.Point(639, 609); this.circularProgressBar.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.circularProgressBar.MarqueeAnimationSpeed = 2000; this.circularProgressBar.Name = "circularProgressBar"; this.circularProgressBar.OuterColor = System.Drawing.Color.DimGray; this.circularProgressBar.OuterMargin = -25; this.circularProgressBar.OuterWidth = 26; this.circularProgressBar.ProgressColor = System.Drawing.Color.FloralWhite; this.circularProgressBar.ProgressWidth = 25; this.circularProgressBar.SecondaryFont = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.circularProgressBar.Size = new System.Drawing.Size(297, 306); this.circularProgressBar.StartAngle = 270; this.circularProgressBar.Style = System.Windows.Forms.ProgressBarStyle.Marquee; this.circularProgressBar.SubscriptColor = System.Drawing.Color.FromArgb(((int)(((byte)(166)))), ((int)(((byte)(166)))), ((int)(((byte)(166))))); this.circularProgressBar.SubscriptMargin = new System.Windows.Forms.Padding(10, -35, 0, 0); this.circularProgressBar.SubscriptText = ""; this.circularProgressBar.SuperscriptColor = System.Drawing.Color.FromArgb(((int)(((byte)(166)))), ((int)(((byte)(166)))), ((int)(((byte)(166))))); this.circularProgressBar.SuperscriptMargin = new System.Windows.Forms.Padding(10, 35, 0, 0); this.circularProgressBar.SuperscriptText = ""; this.circularProgressBar.TabIndex = 52; this.circularProgressBar.Text = "10%"; this.circularProgressBar.TextMargin = new System.Windows.Forms.Padding(8, 8, 0, 0); this.circularProgressBar.Value = 80; this.circularProgressBar.Click += new System.EventHandler(this.circularProgressBar2_Click); // // label1 // this.label1.BackColor = System.Drawing.Color.Transparent; this.label1.Font = new System.Drawing.Font("Century Gothic", 24F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label1.ForeColor = System.Drawing.Color.Black; this.label1.Location = new System.Drawing.Point(987, 615); this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label1.Name = "label1"; this.label1.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.label1.Size = new System.Drawing.Size(348, 300); this.label1.TabIndex = 53; this.label1.Text = "אחוז הרכיבים במערכת שעבורם רשומות תקלות:"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // myPanel1 // this.myPanel1.BackColor = System.Drawing.Color.Transparent; this.myPanel1.Controls.Add(this.numberOfComponentsLabel); this.myPanel1.Controls.Add(this.label5); this.myPanel1.Controls.Add(this.label8); this.myPanel1.Controls.Add(this.label4); this.myPanel1.Controls.Add(this.avgNumOfAffectedComponentsLabel); this.myPanel1.Controls.Add(this.averageNumOfFaultsLabel); this.myPanel1.Controls.Add(this.numberOfFaultsLabel); this.myPanel1.Controls.Add(this.label3); this.myPanel1.Location = new System.Drawing.Point(960, 146); this.myPanel1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.myPanel1.Name = "myPanel1"; this.myPanel1.Size = new System.Drawing.Size(648, 460); this.myPanel1.TabIndex = 62; // // numberOfComponentsLabel // this.numberOfComponentsLabel.AutoSize = true; this.numberOfComponentsLabel.BackColor = System.Drawing.Color.Transparent; this.numberOfComponentsLabel.Font = new System.Drawing.Font("Century Gothic", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.numberOfComponentsLabel.ForeColor = System.Drawing.Color.Black; this.numberOfComponentsLabel.Location = new System.Drawing.Point(436, 34); this.numberOfComponentsLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.numberOfComponentsLabel.Name = "numberOfComponentsLabel"; this.numberOfComponentsLabel.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.numberOfComponentsLabel.Size = new System.Drawing.Size(90, 66); this.numberOfComponentsLabel.TabIndex = 58; this.numberOfComponentsLabel.Text = "20"; this.numberOfComponentsLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // label5 // this.label5.AutoSize = true; this.label5.BackColor = System.Drawing.Color.Transparent; this.label5.Font = new System.Drawing.Font("Century Gothic", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label5.ForeColor = System.Drawing.Color.Black; this.label5.Location = new System.Drawing.Point(351, 283); this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label5.Name = "label5"; this.label5.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.label5.Size = new System.Drawing.Size(264, 39); this.label5.TabIndex = 56; this.label5.Text = "מספר התקלות במערכת"; this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // label8 // this.label8.BackColor = System.Drawing.Color.Transparent; this.label8.Font = new System.Drawing.Font("Century Gothic", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label8.ForeColor = System.Drawing.Color.Black; this.label8.Location = new System.Drawing.Point(27, 283); this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label8.Name = "label8"; this.label8.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.label8.Size = new System.Drawing.Size(294, 85); this.label8.TabIndex = 57; this.label8.Text = "מספר הרכיבים המושפעים בממוצע לתקלה"; this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // label4 // this.label4.AutoSize = true; this.label4.BackColor = System.Drawing.Color.Transparent; this.label4.Font = new System.Drawing.Font("Century Gothic", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label4.ForeColor = System.Drawing.Color.Black; this.label4.Location = new System.Drawing.Point(4, 102); this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label4.Name = "label4"; this.label4.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.label4.Size = new System.Drawing.Size(302, 39); this.label4.TabIndex = 55; this.label4.Text = "כמות תקלות ממוצעת לרכיב\r\n"; this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.label4.Click += new System.EventHandler(this.label4_Click); // // avgNumOfAffectedComponentsLabel // this.avgNumOfAffectedComponentsLabel.AutoSize = true; this.avgNumOfAffectedComponentsLabel.BackColor = System.Drawing.Color.Transparent; this.avgNumOfAffectedComponentsLabel.Font = new System.Drawing.Font("Century Gothic", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.avgNumOfAffectedComponentsLabel.ForeColor = System.Drawing.Color.Black; this.avgNumOfAffectedComponentsLabel.Location = new System.Drawing.Point(102, 215); this.avgNumOfAffectedComponentsLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.avgNumOfAffectedComponentsLabel.Name = "avgNumOfAffectedComponentsLabel"; this.avgNumOfAffectedComponentsLabel.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.avgNumOfAffectedComponentsLabel.Size = new System.Drawing.Size(106, 66); this.avgNumOfAffectedComponentsLabel.TabIndex = 60; this.avgNumOfAffectedComponentsLabel.Text = "1.5"; this.avgNumOfAffectedComponentsLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // averageNumOfFaultsLabel // this.averageNumOfFaultsLabel.AutoSize = true; this.averageNumOfFaultsLabel.BackColor = System.Drawing.Color.Transparent; this.averageNumOfFaultsLabel.Font = new System.Drawing.Font("Century Gothic", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.averageNumOfFaultsLabel.ForeColor = System.Drawing.Color.Black; this.averageNumOfFaultsLabel.Location = new System.Drawing.Point(102, 34); this.averageNumOfFaultsLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.averageNumOfFaultsLabel.Name = "averageNumOfFaultsLabel"; this.averageNumOfFaultsLabel.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.averageNumOfFaultsLabel.Size = new System.Drawing.Size(106, 66); this.averageNumOfFaultsLabel.TabIndex = 61; this.averageNumOfFaultsLabel.Text = "2.0"; this.averageNumOfFaultsLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // numberOfFaultsLabel // this.numberOfFaultsLabel.AutoSize = true; this.numberOfFaultsLabel.BackColor = System.Drawing.Color.Transparent; this.numberOfFaultsLabel.Font = new System.Drawing.Font("Century Gothic", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.numberOfFaultsLabel.ForeColor = System.Drawing.Color.Black; this.numberOfFaultsLabel.Location = new System.Drawing.Point(436, 215); this.numberOfFaultsLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.numberOfFaultsLabel.Name = "numberOfFaultsLabel"; this.numberOfFaultsLabel.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.numberOfFaultsLabel.Size = new System.Drawing.Size(90, 66); this.numberOfFaultsLabel.TabIndex = 59; this.numberOfFaultsLabel.Text = "40"; this.numberOfFaultsLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // label3 // this.label3.AutoSize = true; this.label3.BackColor = System.Drawing.Color.Transparent; this.label3.Font = new System.Drawing.Font("Century Gothic", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label3.ForeColor = System.Drawing.Color.Black; this.label3.Location = new System.Drawing.Point(351, 102); this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label3.Name = "label3"; this.label3.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.label3.Size = new System.Drawing.Size(264, 39); this.label3.TabIndex = 54; this.label3.Text = "מספר הרכיבים במערכת"; this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // Features // this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoSize = true; this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage"))); this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.ClientSize = new System.Drawing.Size(1626, 940); this.Controls.Add(this.myPanel1); this.Controls.Add(this.label1); this.Controls.Add(this.circularProgressBar); this.Controls.Add(this.label2); this.Controls.Add(this.lastWeekDataChart); this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.Name = "Features"; this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Features_FormClosed); this.Load += new System.EventHandler(this.Features_Load); ((System.ComponentModel.ISupportInitialize)(this.lastWeekDataChart)).EndInit(); this.myPanel1.ResumeLayout(false); this.myPanel1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); }
public void CheckShouldEnableSubmitButton(Form view) { if (ChosenAnswers.Count == 15) { ReachedPercentage = ChosenAnswers.Values.Where(answer => answer.Richtig).Select(answer => answer).Count(); ReachedPercentage = Math.Round((ReachedPercentage / 15 * 100), 2); if (ReachedPercentage >= 75) { var winLabel = new Label { Text = string.Format(CultureInfo.InvariantCulture, Resources.WinningTextPercent, ReachedPercentage.ToString(CultureInfo.InvariantCulture)), Size = new Size(400, 400) }; view.Controls.Add(winLabel); } else { var loseLabel = new Label { Text = string.Format(CultureInfo.InvariantCulture, Resources.LosingTextPercent, ReachedPercentage.ToString(CultureInfo.InvariantCulture)), Size = new Size(400, 400), Left = view.ClientSize.Width / 2, Top = view.ClientSize.Height / 2 }; var restartButton = new CxFlatButton { Text = Resources.Restart, Font = new Font("arial", 10), Size = new Size(200, 50), Left = 400, Top = 400 }; restartButton.Click += this.TriggerRestart; var reachedPercentageSplit = ReachedPercentage.ToString(CultureInfo.InvariantCulture).Split('.'); var circularBar = new CircularProgressBar.CircularProgressBar { AnimationFunction = KnownAnimationFunctions.Liner, Anchor = AnchorStyles.None, AnimationSpeed = 500, BackColor = Color.Transparent, Font = new Font("Microsoft Sans Serif", 27.75F, FontStyle.Bold), ForeColor = Color.FromArgb(240, 240, 240), InnerColor = Color.FromArgb(52, 73, 94), InnerMargin = 0, InnerWidth = -1, Left = (int)(view.ClientSize.Width / 1.5), Top = view.ClientSize.Height / 3, MarqueeAnimationSpeed = 2000, OuterColor = Color.White, OuterMargin = 0, OuterWidth = 0, ProgressColor = Color.FromArgb(52, 151, 218), ProgressWidth = 17, RightToLeft = RightToLeft.No, SecondaryFont = new Font("Microsoft Sans Serif", 15.75F), Size = new Size(180, 180), StartAngle = 270, SubscriptColor = Color.FromArgb(200, 200, 200), SubscriptMargin = new Padding(5, -20, 0, 0), SubscriptText = $".{ (reachedPercentageSplit.Length > 1 ? reachedPercentageSplit[1] : "00")}", SuperscriptColor = Color.FromArgb(200, 200, 200), SuperscriptMargin = new Padding(8, 25, 0, 0), SuperscriptText = "%", Text = reachedPercentageSplit[0], TextMargin = new Padding(0, 5, 0, 0), Value = 75 }; view.Controls.Add(circularBar); view.Controls.Add(loseLabel); view.Controls.Add(restartButton); } } }
public static void Deserialize_Condensed(string file, CircularProgressBar.CircularProgressBar cpb = null) { // Load the document XmlDocument Config = new XmlDocument(); Config.Load(file); if (ManagerData.Stores != null) { ManagerData.Stores.Clear(); } else { ManagerData.Stores = new Dictionary <string, StoreCell>(); } string currStoreLocation = string.Empty; string currRepoName = string.Empty; RepoCell.Status.Type currRepoStatus = RepoCell.Status.Type.NONE; string currNoteTitle = string.Empty; string currNoteMessage = string.Empty; StoreCell newStore = null; RepoCell newRepo = null; // Under the root the layers will be Stores => Repos => Notes foreach (XmlNode storeNode in Config.DocumentElement.ChildNodes) { foreach (XmlAttribute storeAttr in storeNode.Attributes) { switch (File.String_ToATTRIBUTE_T(storeAttr.Name)) { case File.ATTRIBUTE_T.LOCATION: currStoreLocation = storeAttr.Value; break; } } newStore = new StoreCell(currStoreLocation) { _Repos = new Dictionary <string, RepoCell>() }; foreach (XmlNode repoNode in storeNode.ChildNodes) { foreach (XmlAttribute repoAttr in repoNode.Attributes) { switch (File.String_ToATTRIBUTE_T(repoAttr.Name)) { case File.ATTRIBUTE_T.NAME: currRepoName = repoAttr.Value; break; case File.ATTRIBUTE_T.STATUS: currRepoStatus = RepoCell.Status.ToType(repoAttr.Value); break; } } newRepo = new RepoCell() { Name = currRepoName, Current_Status = currRepoStatus, Path = currStoreLocation + @"\" + currRepoName, Notes = new Dictionary <string, string>() }; foreach (XmlNode noteNode in repoNode.ChildNodes) { foreach (XmlAttribute noteAttr in noteNode.Attributes) { switch (File.String_ToATTRIBUTE_T(noteAttr.Name)) { case File.ATTRIBUTE_T.TITLE: currNoteTitle = noteAttr.Value; break; } } currNoteMessage = noteNode.InnerText; newRepo.Notes.Add(currNoteTitle, currNoteMessage); currNoteMessage = string.Empty; currNoteTitle = string.Empty; } newRepo.Logs_Parsed = false; newStore._Repos.Add(currRepoName, newRepo); currRepoStatus = RepoCell.Status.Type.NONE; } if (currStoreLocation != "") { DirectoryInfo dirInfo = new DirectoryInfo(currStoreLocation); ManagerData.Stores.Add(dirInfo.Name, newStore); } } }
public ProgressBox(System.Drawing.Point location) { this.Location = location; this.Size = new System.Drawing.Size(546, 100); this.TabStop = false; this.SuspendLayout(); this.progress_iis_build = new CircularProgressBar.CircularProgressBar(); this.progress_iis_package = new CircularProgressBar.CircularProgressBar(); this.progress_iis_upload = new CircularProgressBar.CircularProgressBar(); this.progress_iis_deploy = new CircularProgressBar.CircularProgressBar(); this.b_build_end = new System.Windows.Forms.Button(); this.b_package_end = new System.Windows.Forms.Button(); this.b_upload_end = new System.Windows.Forms.Button(); // // progress_iis_build // this.progress_iis_build.Anchor = System.Windows.Forms.AnchorStyles.None; this.progress_iis_build.AnimationFunction = WinFormAnimation.KnownAnimationFunctions.Liner; this.progress_iis_build.AnimationSpeed = 500; this.progress_iis_build.BackColor = System.Drawing.Color.Transparent; this.progress_iis_build.Font = new System.Drawing.Font("Arial", 13F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(178))); this.progress_iis_build.ForeColor = System.Drawing.Color.Red; this.progress_iis_build.InnerColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.progress_iis_build.InnerMargin = 0; this.progress_iis_build.InnerWidth = -1; this.progress_iis_build.Location = new System.Drawing.Point(42, 16); this.progress_iis_build.MarqueeAnimationSpeed = 2000; this.progress_iis_build.OuterColor = System.Drawing.Color.Gray; this.progress_iis_build.OuterMargin = -25; this.progress_iis_build.OuterWidth = 22; this.progress_iis_build.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_build.ProgressWidth = 15; this.progress_iis_build.SecondaryFont = new System.Drawing.Font("Microsoft Sans Serif", 10F); this.progress_iis_build.Size = new System.Drawing.Size(84, 77); this.progress_iis_build.StartAngle = 270; this.progress_iis_build.SubscriptColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_build.SubscriptMargin = new System.Windows.Forms.Padding(0); this.progress_iis_build.SubscriptText = ""; this.progress_iis_build.SuperscriptColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_build.SuperscriptMargin = new System.Windows.Forms.Padding(-23, 0, 0, 0); this.progress_iis_build.SuperscriptText = "Wait"; this.progress_iis_build.TabIndex = 9; this.progress_iis_build.Text = "Build"; this.progress_iis_build.TextMargin = new System.Windows.Forms.Padding(10, 8, 0, 0); this.progress_iis_build.Style = System.Windows.Forms.ProgressBarStyle.Marquee; this.progress_iis_build.Value = 0; // // progress_iis_package // this.progress_iis_package.Anchor = System.Windows.Forms.AnchorStyles.None; this.progress_iis_package.AnimationFunction = WinFormAnimation.KnownAnimationFunctions.Liner; this.progress_iis_package.AnimationSpeed = 500; this.progress_iis_package.BackColor = System.Drawing.Color.Transparent; this.progress_iis_package.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(178))); this.progress_iis_package.ForeColor = System.Drawing.Color.Red; this.progress_iis_package.InnerColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.progress_iis_package.InnerMargin = 0; this.progress_iis_package.InnerWidth = -1; this.progress_iis_package.Location = new System.Drawing.Point(162, 16); this.progress_iis_package.MarqueeAnimationSpeed = 2000; this.progress_iis_package.OuterColor = System.Drawing.Color.Gray; this.progress_iis_package.OuterMargin = -25; this.progress_iis_package.OuterWidth = 22; this.progress_iis_package.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_package.ProgressWidth = 15; this.progress_iis_package.SecondaryFont = new System.Drawing.Font("Microsoft Sans Serif", 10F); this.progress_iis_package.Size = new System.Drawing.Size(84, 77); this.progress_iis_package.StartAngle = 270; this.progress_iis_package.SubscriptColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_package.SubscriptMargin = new System.Windows.Forms.Padding(0); this.progress_iis_package.SubscriptText = ""; this.progress_iis_package.SuperscriptColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_package.SuperscriptMargin = new System.Windows.Forms.Padding(-26, 0, 0, 0); this.progress_iis_package.SuperscriptText = "0%"; this.progress_iis_package.TabIndex = 10; this.progress_iis_package.Text = "Package"; this.progress_iis_package.TextMargin = new System.Windows.Forms.Padding(10, 8, 0, 0); this.progress_iis_package.Style = System.Windows.Forms.ProgressBarStyle.Marquee; this.progress_iis_package.Value = 0; // // progress_iis_upload // this.progress_iis_upload.Anchor = System.Windows.Forms.AnchorStyles.None; this.progress_iis_upload.AnimationFunction = WinFormAnimation.KnownAnimationFunctions.Liner; this.progress_iis_upload.AnimationSpeed = 500; this.progress_iis_upload.BackColor = System.Drawing.Color.Transparent; this.progress_iis_upload.Font = new System.Drawing.Font("Arial", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(178))); this.progress_iis_upload.ForeColor = System.Drawing.Color.Red; this.progress_iis_upload.InnerColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.progress_iis_upload.InnerMargin = 0; this.progress_iis_upload.InnerWidth = -1; this.progress_iis_upload.Location = new System.Drawing.Point(282, 16); this.progress_iis_upload.MarqueeAnimationSpeed = 2000; this.progress_iis_upload.OuterColor = System.Drawing.Color.Gray; this.progress_iis_upload.OuterMargin = -25; this.progress_iis_upload.OuterWidth = 22; this.progress_iis_upload.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_upload.ProgressWidth = 15; this.progress_iis_upload.SecondaryFont = new System.Drawing.Font("Microsoft Sans Serif", 10F); this.progress_iis_upload.Size = new System.Drawing.Size(84, 77); this.progress_iis_upload.StartAngle = 270; this.progress_iis_upload.SubscriptColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_upload.SubscriptMargin = new System.Windows.Forms.Padding(0); this.progress_iis_upload.SubscriptText = ""; this.progress_iis_upload.SuperscriptColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_upload.SuperscriptMargin = new System.Windows.Forms.Padding(-26, 0, 0, 0); this.progress_iis_upload.SuperscriptText = "0%"; this.progress_iis_upload.TabIndex = 11; this.progress_iis_upload.Text = "Upload"; this.progress_iis_upload.TextMargin = new System.Windows.Forms.Padding(10, 8, 0, 0); this.progress_iis_upload.Style = System.Windows.Forms.ProgressBarStyle.Marquee; this.progress_iis_upload.Value = 0; // // progress_iis_deploy // this.progress_iis_deploy.Anchor = System.Windows.Forms.AnchorStyles.None; this.progress_iis_deploy.AnimationFunction = WinFormAnimation.KnownAnimationFunctions.Liner; this.progress_iis_deploy.AnimationSpeed = 500; this.progress_iis_deploy.BackColor = System.Drawing.Color.Transparent; this.progress_iis_deploy.Font = new System.Drawing.Font("Arial", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(178))); this.progress_iis_deploy.ForeColor = System.Drawing.Color.Red; this.progress_iis_deploy.InnerColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.progress_iis_deploy.InnerMargin = 0; this.progress_iis_deploy.InnerWidth = -1; this.progress_iis_deploy.Location = new System.Drawing.Point(402, 16); this.progress_iis_deploy.MarqueeAnimationSpeed = 2000; this.progress_iis_deploy.OuterColor = System.Drawing.Color.Gray; this.progress_iis_deploy.OuterMargin = -25; this.progress_iis_deploy.OuterWidth = 22; this.progress_iis_deploy.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_deploy.ProgressWidth = 15; this.progress_iis_deploy.SecondaryFont = new System.Drawing.Font("Microsoft Sans Serif", 10F); this.progress_iis_deploy.Size = new System.Drawing.Size(92, 77); this.progress_iis_deploy.StartAngle = 270; this.progress_iis_deploy.SubscriptColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_deploy.SubscriptMargin = new System.Windows.Forms.Padding(0); this.progress_iis_deploy.SubscriptText = ""; this.progress_iis_deploy.SuperscriptColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_deploy.SuperscriptMargin = new System.Windows.Forms.Padding(-28, 0, 0, 0); this.progress_iis_deploy.SuperscriptText = "Wait"; this.progress_iis_deploy.TabIndex = 12; this.progress_iis_deploy.Text = "Deploy"; this.progress_iis_deploy.TextMargin = new System.Windows.Forms.Padding(12, 8, 0, 0); this.progress_iis_deploy.Style = System.Windows.Forms.ProgressBarStyle.Marquee; this.progress_iis_deploy.Value = 0; // // b_build_end // this.b_build_end.Location = new System.Drawing.Point(113, 47); this.b_build_end.BackColor = System.Drawing.Color.LightGray; this.b_build_end.Size = new System.Drawing.Size(76, 19); this.b_build_end.TabIndex = 17; this.b_build_end.UseVisualStyleBackColor = true; // // b_package_end // this.b_package_end.Location = new System.Drawing.Point(234, 47); this.b_package_end.BackColor = System.Drawing.Color.LightGray; this.b_package_end.Size = new System.Drawing.Size(76, 19); this.b_package_end.TabIndex = 18; this.b_package_end.UseVisualStyleBackColor = true; // // b_upload_end // this.b_upload_end.Location = new System.Drawing.Point(358, 47); this.b_upload_end.BackColor = System.Drawing.Color.LightGray; this.b_upload_end.Size = new System.Drawing.Size(76, 19); this.b_upload_end.TabIndex = 19; this.b_upload_end.UseVisualStyleBackColor = true; // // groupBox_iis_progress // this.Controls.Add(this.progress_iis_build); this.Controls.Add(this.b_build_end); this.Controls.Add(this.progress_iis_package); this.Controls.Add(this.b_package_end); this.Controls.Add(this.progress_iis_upload); this.Controls.Add(this.b_upload_end); this.Controls.Add(this.progress_iis_deploy); this.b_build_end.SendToBack(); this.b_package_end.SendToBack(); this.b_upload_end.SendToBack(); }
public ProgressBox(System.Drawing.Point location, BaseServer server, ServerType serverType, Action <ServerType, BaseServer> LoadHistoryAction) { this.ServerType = serverType; this.Server = server; this.Location = location; var Progressheight = 36; var buttonHeight = Progressheight + 31; this.Size = new System.Drawing.Size(546, 130); this.TabStop = false; this.SuspendLayout(); this.label29 = new System.Windows.Forms.Label(); this.progress_iis_build = new CircularProgressBar.CircularProgressBar(); this.progress_iis_package = new CircularProgressBar.CircularProgressBar(); this.progress_iis_upload = new CircularProgressBar.CircularProgressBar(); this.progress_iis_deploy = new CircularProgressBar.CircularProgressBar(); this.b_build_end = new System.Windows.Forms.Button(); this.b_package_end = new System.Windows.Forms.Button(); this.b_upload_end = new System.Windows.Forms.Button(); this.FireUrlText = new System.Windows.Forms.TextBox(); HostoryButton = new AltoButton(); // // label29 // this.label29.AutoSize = true; this.label29.Location = new System.Drawing.Point(42, Progressheight - 15); this.label29.Size = new System.Drawing.Size(107, 12); this.label29.Text = "Fire Url:"; // // txt_iis_website_url // this.FireUrlText.Location = new System.Drawing.Point(120, Progressheight - 20); this.FireUrlText.Size = new System.Drawing.Size(322, 21); if (serverType.Equals(ServerType.IIS)) { this.FireUrlText.Text = server.IIsFireUrl; } if (serverType.Equals(ServerType.DOCKER)) { this.FireUrlText.Text = server.DockerFireUrl; } if (serverType.Equals(ServerType.WINSERVICE)) { this.FireUrlText.Text = server.WindowsServiceFireUrl; } // // progress_iis_build // this.progress_iis_build.Anchor = System.Windows.Forms.AnchorStyles.None; this.progress_iis_build.AnimationFunction = WinFormAnimation.KnownAnimationFunctions.Liner; this.progress_iis_build.AnimationSpeed = 500; this.progress_iis_build.BackColor = System.Drawing.Color.Transparent; this.progress_iis_build.Font = new System.Drawing.Font("Arial", 13F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(178))); this.progress_iis_build.ForeColor = System.Drawing.Color.Red; this.progress_iis_build.InnerColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.progress_iis_build.InnerMargin = 0; this.progress_iis_build.InnerWidth = -1; this.progress_iis_build.Location = new System.Drawing.Point(42, Progressheight); this.progress_iis_build.MarqueeAnimationSpeed = 2000; this.progress_iis_build.OuterColor = System.Drawing.Color.Gray; this.progress_iis_build.OuterMargin = -25; this.progress_iis_build.OuterWidth = 22; this.progress_iis_build.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_build.ProgressWidth = 15; this.progress_iis_build.SecondaryFont = new System.Drawing.Font("Microsoft Sans Serif", 10F); this.progress_iis_build.Size = new System.Drawing.Size(84, 77); this.progress_iis_build.StartAngle = 270; this.progress_iis_build.SubscriptColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_build.SubscriptMargin = new System.Windows.Forms.Padding(0); this.progress_iis_build.SubscriptText = ""; this.progress_iis_build.SuperscriptColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_build.SuperscriptMargin = new System.Windows.Forms.Padding(-23, 0, 0, 0); this.progress_iis_build.SuperscriptText = "Wait"; this.progress_iis_build.TabIndex = 9; this.progress_iis_build.Text = "Build"; this.progress_iis_build.TextMargin = new System.Windows.Forms.Padding(10, 8, 0, 0); this.progress_iis_build.Style = System.Windows.Forms.ProgressBarStyle.Marquee; this.progress_iis_build.Value = 0; // // progress_iis_package // this.progress_iis_package.Anchor = System.Windows.Forms.AnchorStyles.None; this.progress_iis_package.AnimationFunction = WinFormAnimation.KnownAnimationFunctions.Liner; this.progress_iis_package.AnimationSpeed = 500; this.progress_iis_package.BackColor = System.Drawing.Color.Transparent; this.progress_iis_package.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(178))); this.progress_iis_package.ForeColor = System.Drawing.Color.Red; this.progress_iis_package.InnerColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.progress_iis_package.InnerMargin = 0; this.progress_iis_package.InnerWidth = -1; this.progress_iis_package.Location = new System.Drawing.Point(162, Progressheight); this.progress_iis_package.MarqueeAnimationSpeed = 2000; this.progress_iis_package.OuterColor = System.Drawing.Color.Gray; this.progress_iis_package.OuterMargin = -25; this.progress_iis_package.OuterWidth = 22; this.progress_iis_package.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_package.ProgressWidth = 15; this.progress_iis_package.SecondaryFont = new System.Drawing.Font("Microsoft Sans Serif", 10F); this.progress_iis_package.Size = new System.Drawing.Size(84, 77); this.progress_iis_package.StartAngle = 270; this.progress_iis_package.SubscriptColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_package.SubscriptMargin = new System.Windows.Forms.Padding(0); this.progress_iis_package.SubscriptText = ""; this.progress_iis_package.SuperscriptColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_package.SuperscriptMargin = new System.Windows.Forms.Padding(-26, 0, 0, 0); this.progress_iis_package.SuperscriptText = "0%"; this.progress_iis_package.TabIndex = 10; this.progress_iis_package.Text = "Package"; this.progress_iis_package.TextMargin = new System.Windows.Forms.Padding(10, 8, 0, 0); this.progress_iis_package.Style = System.Windows.Forms.ProgressBarStyle.Marquee; this.progress_iis_package.Value = 0; // // progress_iis_upload // this.progress_iis_upload.Anchor = System.Windows.Forms.AnchorStyles.None; this.progress_iis_upload.AnimationFunction = WinFormAnimation.KnownAnimationFunctions.Liner; this.progress_iis_upload.AnimationSpeed = 500; this.progress_iis_upload.BackColor = System.Drawing.Color.Transparent; this.progress_iis_upload.Font = new System.Drawing.Font("Arial", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(178))); this.progress_iis_upload.ForeColor = System.Drawing.Color.Red; this.progress_iis_upload.InnerColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.progress_iis_upload.InnerMargin = 0; this.progress_iis_upload.InnerWidth = -1; this.progress_iis_upload.Location = new System.Drawing.Point(282, Progressheight); this.progress_iis_upload.MarqueeAnimationSpeed = 2000; this.progress_iis_upload.OuterColor = System.Drawing.Color.Gray; this.progress_iis_upload.OuterMargin = -25; this.progress_iis_upload.OuterWidth = 22; this.progress_iis_upload.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_upload.ProgressWidth = 15; this.progress_iis_upload.SecondaryFont = new System.Drawing.Font("Microsoft Sans Serif", 10F); this.progress_iis_upload.Size = new System.Drawing.Size(84, 77); this.progress_iis_upload.StartAngle = 270; this.progress_iis_upload.SubscriptColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_upload.SubscriptMargin = new System.Windows.Forms.Padding(0); this.progress_iis_upload.SubscriptText = ""; this.progress_iis_upload.SuperscriptColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_upload.SuperscriptMargin = new System.Windows.Forms.Padding(-26, 0, 0, 0); this.progress_iis_upload.SuperscriptText = "0%"; this.progress_iis_upload.TabIndex = 11; this.progress_iis_upload.Text = "Upload"; this.progress_iis_upload.TextMargin = new System.Windows.Forms.Padding(10, 8, 0, 0); this.progress_iis_upload.Style = System.Windows.Forms.ProgressBarStyle.Marquee; this.progress_iis_upload.Value = 0; // // progress_iis_deploy // this.progress_iis_deploy.Anchor = System.Windows.Forms.AnchorStyles.None; this.progress_iis_deploy.AnimationFunction = WinFormAnimation.KnownAnimationFunctions.Liner; this.progress_iis_deploy.AnimationSpeed = 500; this.progress_iis_deploy.BackColor = System.Drawing.Color.Transparent; this.progress_iis_deploy.Font = new System.Drawing.Font("Arial", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(178))); this.progress_iis_deploy.ForeColor = System.Drawing.Color.Red; this.progress_iis_deploy.InnerColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.progress_iis_deploy.InnerMargin = 0; this.progress_iis_deploy.InnerWidth = -1; this.progress_iis_deploy.Location = new System.Drawing.Point(402, Progressheight); this.progress_iis_deploy.MarqueeAnimationSpeed = 2000; this.progress_iis_deploy.OuterColor = System.Drawing.Color.Gray; this.progress_iis_deploy.OuterMargin = -25; this.progress_iis_deploy.OuterWidth = 22; this.progress_iis_deploy.ProgressColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_deploy.ProgressWidth = 15; this.progress_iis_deploy.SecondaryFont = new System.Drawing.Font("Microsoft Sans Serif", 10F); this.progress_iis_deploy.Size = new System.Drawing.Size(92, 77); this.progress_iis_deploy.StartAngle = 270; this.progress_iis_deploy.SubscriptColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_deploy.SubscriptMargin = new System.Windows.Forms.Padding(0); this.progress_iis_deploy.SubscriptText = ""; this.progress_iis_deploy.SuperscriptColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(99)))), ((int)(((byte)(180))))); this.progress_iis_deploy.SuperscriptMargin = new System.Windows.Forms.Padding(-28, 0, 0, 0); this.progress_iis_deploy.SuperscriptText = "Wait"; this.progress_iis_deploy.TabIndex = 12; this.progress_iis_deploy.Text = "Deploy"; this.progress_iis_deploy.TextMargin = new System.Windows.Forms.Padding(12, 8, 0, 0); this.progress_iis_deploy.Style = System.Windows.Forms.ProgressBarStyle.Marquee; this.progress_iis_deploy.Value = 0; // // b_build_end // this.b_build_end.Location = new System.Drawing.Point(113, buttonHeight); this.b_build_end.BackColor = System.Drawing.Color.LightGray; this.b_build_end.Size = new System.Drawing.Size(76, 19); this.b_build_end.TabIndex = 17; this.b_build_end.UseVisualStyleBackColor = true; // // b_package_end // this.b_package_end.Location = new System.Drawing.Point(234, buttonHeight); this.b_package_end.BackColor = System.Drawing.Color.LightGray; this.b_package_end.Size = new System.Drawing.Size(76, 19); this.b_package_end.TabIndex = 18; this.b_package_end.UseVisualStyleBackColor = true; // // b_upload_end // this.b_upload_end.Location = new System.Drawing.Point(358, buttonHeight); this.b_upload_end.BackColor = System.Drawing.Color.LightGray; this.b_upload_end.Size = new System.Drawing.Size(76, 19); this.b_upload_end.TabIndex = 19; this.b_upload_end.UseVisualStyleBackColor = true; this.HostoryButton.Location = new System.Drawing.Point(this.FireUrlText.Location.X + this.FireUrlText.Width + 20, Progressheight - 20); this.HostoryButton.Size = new System.Drawing.Size(60, 20); this.HostoryButton.Text = "Histroy"; this.HostoryButton.Active1 = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(168)))), ((int)(((byte)(183))))); this.HostoryButton.Active2 = System.Drawing.Color.FromArgb(((int)(((byte)(36)))), ((int)(((byte)(164)))), ((int)(((byte)(183))))); this.HostoryButton.BackColor = System.Drawing.Color.Transparent; this.HostoryButton.DialogResult = System.Windows.Forms.DialogResult.OK; this.HostoryButton.ForeColor = System.Drawing.Color.Black; this.HostoryButton.Inactive1 = System.Drawing.Color.LightGray; this.HostoryButton.Inactive2 = System.Drawing.Color.LightGray; this.HostoryButton.Name = "b_windows_service_rollback"; this.HostoryButton.Radius = 10; this.HostoryButton.Stroke = false; this.HostoryButton.StrokeColor = System.Drawing.Color.Gray; this.HostoryButton.Transparency = false; this.HostoryButton.Click += (sender, args) => { LoadHistoryAction(this.ServerType, this.Server); }; // // groupBox_iis_progress // this.Controls.Add(this.label29); this.Controls.Add(this.FireUrlText); this.Controls.Add(this.HostoryButton); this.Controls.Add(this.progress_iis_build); this.Controls.Add(this.b_build_end); this.Controls.Add(this.progress_iis_package); this.Controls.Add(this.b_package_end); this.Controls.Add(this.progress_iis_upload); this.Controls.Add(this.b_upload_end); this.Controls.Add(this.progress_iis_deploy); this.b_build_end.SendToBack(); this.b_package_end.SendToBack(); this.b_upload_end.SendToBack(); }
public uc_accelerator() { InitializeComponent(); mem.Retrieve(); controller.Retrieve(); sensor.Update(); prbar_ram_used.Maximum = (int)(mem.TotalMemory / bytesInMegabyte); for (int i = 0; i < controller.LogicalDisks.Count(); i++) { Hardware.LogicalDisk currentDisk = controller.LogicalDisks[i]; TabPage myTabPage = new TabPage(currentDisk.Name) { Size = new Size(380, 200), }; tab_storage.TabPages.Add(myTabPage); CircularProgressBar.CircularProgressBar prbar_usedSpace = new CircularProgressBar.CircularProgressBar { Location = new Point(5, 25), Size = new Size(125, 125), OuterColor = Color.Gainsboro, ProgressColor = Color.SteelBlue, OuterMargin = -30, OuterWidth = 30, ProgressWidth = 30, Maximum = 100, Value = 0, InnerColor = SystemColors.Control }; CircularProgressBar.CircularProgressBar prbar_freeSpace = new CircularProgressBar.CircularProgressBar { Location = new Point(220, 25), Size = new Size(125, 125), OuterColor = Color.Gainsboro, ProgressColor = Color.SteelBlue, OuterMargin = -30, OuterWidth = 30, ProgressWidth = 30, Maximum = 100, Value = 0, InnerColor = SystemColors.Control }; Label lb_space_used = new Label { AutoSize = true, Text = "Used:", Location = new Point(5, 5) }; Label lb_space_free = new Label { AutoSize = true, Text = "Free:", Location = new Point(215, 5) }; Label lb_space_usedValue = new Label { AutoSize = true, Text = "", Location = new Point(5, 155), Font = new Font("Century Gothic", 22, FontStyle.Regular), ForeColor = Color.Gray }; Label lb_space_freeValue = new Label { AutoSize = true, Text = "", Location = new Point(220, 155), Font = new Font("Century Gothic", 22, FontStyle.Regular), ForeColor = Color.Gray }; myTabPage.Controls.Add(prbar_usedSpace); myTabPage.Controls.Add(prbar_freeSpace); myTabPage.Controls.Add(lb_space_usedValue); myTabPage.Controls.Add(lb_space_freeValue); myTabPage.Controls.Add(lb_space_used); myTabPage.Controls.Add(lb_space_free); } }
/* * Node for each store, repo, and note * * Attributes * Store: Location - Path to store * Repo: Name - Name of the repository, not path * Status - Current status of the repository i.e New, Development, Production * Note Title - The title of the note * * Other Data * Note body needs to be inner text of the Note node */ public static bool Serialize_Condensed_All(string file, CircularProgressBar.CircularProgressBar cpb = null) { XmlDocument Config = new XmlDocument(); Config.Load(file); try { Config.DocumentElement.RemoveAll(); Config.Save(file); } catch { return(false); } XmlNode storeNode = null; XmlNode repoNode = null; XmlNode noteNode = null; XmlAttribute storeLocationAttr = null; XmlAttribute repoNameAttr = Config.CreateAttribute("Name"); XmlAttribute repoStatusAttr = Config.CreateAttribute("Status"); XmlAttribute noteTitleAttr = Config.CreateAttribute("Title"); if (ManagerData.Stores.Count > 0) { // Cycle through each store cell and create a node. // The only attribute is the location of the store. foreach (StoreCell storeCell in ManagerData.Stores.Values) { storeLocationAttr = Config.CreateAttribute("Location"); storeLocationAttr.Value = storeCell._Path; // Create a store node and add the location attribute storeNode = Config.CreateElement("Store"); storeNode.Attributes.Append(storeLocationAttr); try { if (storeCell._Repos.Count > 0) { // Cycle through each store's repo cells and create nodes // Attributes: Name, Status foreach (RepoCell repoCell in storeCell._Repos.Values) { repoNameAttr = Config.CreateAttribute(File.ATTRIBUTE_T_ToString(File.ATTRIBUTE_T.NAME)); repoNameAttr.Value = repoCell.Name; repoStatusAttr = Config.CreateAttribute(File.ATTRIBUTE_T_ToString(File.ATTRIBUTE_T.STATUS)); repoStatusAttr.Value = RepoCell.Status.ToString(repoCell.Current_Status); // Create a repo node and add all it's attributes repoNode = Config.CreateElement("Repo"); repoNode.Attributes.Append(repoNameAttr); repoNode.Attributes.Append(repoStatusAttr); if (repoCell.Notes.Count > 0) { // Cycle through each repo's notes and create nodes // The only attribute is the note's title // The inner text is the note body foreach (KeyValuePair <string, string> note in repoCell.Notes) { noteTitleAttr = Config.CreateAttribute("Title"); noteTitleAttr.Value = note.Key; // Create a note node and add it's attribute as well as body noteNode = Config.CreateElement("Note"); noteNode.Attributes.Append(noteTitleAttr); noteNode.InnerText = note.Value; repoNode.AppendChild(noteNode); } } storeNode.AppendChild(repoNode); } } } catch { } // After all information has been added to the store node add it to the file. Config.DocumentElement.AppendChild(storeNode); } } Config.Save(file); return(true); }
public void ApplyTheme(Control control, Type[] types, MenuStrip menu = null) { control.SuspendLayout(); List <Control> all = new List <Control>(); foreach (Type t in types) { all.AddRange(GetAll(control, t).ToList()); } if (menu != null) { List <ToolStripMenuItem> menuItems = GetMenuItems(menu); foreach (ToolStripMenuItem t in menuItems) { t.BackColor = Background; t.ForeColor = Foreground; t.DisplayStyle = ToolStripItemDisplayStyle.Text; t.MouseLeave += T_MouseLeave; t.MouseEnter += T_MouseEnter; } } foreach (Control c in all) { //if(c.BackColor != Color.Transparent) bool applyTheme = true; if (c.Tag != null && c.Tag.ToString() == "PreventTheme") { applyTheme = false; } if (applyTheme) { if (c.Tag != null && c.Tag.ToString() == "Foreground") { c.BackColor = Foreground; } else { c.BackColor = Background; } if (c.Tag != null && c.Tag.ToString() == "OtherForeground") { c.ForeColor = OtherForeground; } else { c.ForeColor = Foreground; } if (c.GetType() == typeof(CheckBox)) { CheckBox b = (CheckBox)c; b.ForeColor = Foreground; } else if (c.GetType() == typeof(LinkLabel)) { LinkLabel l = (LinkLabel)c; l.LinkColor = Foreground; l.VisitedLinkColor = SelectedForeground; l.ActiveLinkColor = SelectedBackground; } if (c.GetType() == typeof(Button) && (c.Tag == null || c.Tag.ToString() != "NoTheme")) { Button b = (Button)c; b.FlatAppearance.MouseDownBackColor = MouseDown; b.FlatAppearance.MouseOverBackColor = MouseOver; } if (c.GetType() == typeof(CircularProgressBar.CircularProgressBar)) { CircularProgressBar.CircularProgressBar bar = (CircularProgressBar.CircularProgressBar)c; bar.OuterColor = OtherForeground; bar.ProgressColor = Selected; } } } control.BackColor = Background; //control.ForeColor = Invert(Foreground); control.ResumeLayout(); }