public void showAlert(string msg, enmType type) { this.Opacity = 0.0; this.StartPosition = FormStartPosition.Manual; string fname; for (int i = 1; i < 10; i++) { fname = "alert" + i.ToString(); Auth_alert frm = (Auth_alert)Application.OpenForms[fname]; if (frm == null) { this.Name = fname; this.x = Screen.PrimaryScreen.WorkingArea.Width - this.Width + 15; this.y = Screen.PrimaryScreen.WorkingArea.Height - this.Height * i - 5 * i; this.Location = new Point(this.x, this.y); break; } } this.x = Screen.PrimaryScreen.WorkingArea.Width - base.Width - 5; switch (type) { case enmType.Success: this.BackColor = Color.YellowGreen; //this.iconPictureBox1.BackColor = Color.YellowGreen; this.iconPictureBox1.IconChar = IconChar.CheckCircle; // this.iconButton1.BackColor = Color.YellowGreen; // this.iconButton1.ForeColor = Color.YellowGreen; break; case enmType.Warning: this.BackColor = Color.FromArgb(203, 57, 42); //this.iconPictureBox1.BackColor = Color.DarkOrange; break; case enmType.Send: this.BackColor = Color.FromArgb(12, 133, 205); // this.iconPictureBox1.BackColor = Color.FromArgb(12, 133, 205); this.iconPictureBox1.IconChar = IconChar.Clock; // this.iconButton1.BackColor = Color.FromArgb(12, 133, 205); // this.iconButton1.ForeColor = Color.FromArgb(12, 133, 205); //this.iconPictureBox1.BackColor = Color.DarkOrange; break; } this.label1.Text = msg; this.Show(); this.action = enmAction.start; this.timer1.Interval = 1; timer1.Start(); }
public void ShowAlert(string msg, enmType type) { try { this.Opacity = 0.0; this.StartPosition = FormStartPosition.Manual; string fname; for (int i = 1; i < 10; i++) { fname = "alert" + i.ToString(); FrmAlert frm = (FrmAlert)Application.OpenForms[fname]; if (frm == null) { this.Name = fname; this.x = Screen.PrimaryScreen.WorkingArea.Width - this.Width + 15; this.y = Screen.PrimaryScreen.WorkingArea.Height - this.Height * i - 5 * i; this.Location = new Point(this.x, this.y); break; } } this.x = Screen.PrimaryScreen.WorkingArea.Width - base.Width - 5; switch (type) { case enmType.Success: this.pictureBox1.Image = Resources.success; this.BackColor = Color.SeaGreen; break; case enmType.Warning: this.pictureBox1.Image = Resources.warning; this.BackColor = Color.DarkOrange; break; case enmType.Error: this.pictureBox1.Image = Resources.error; this.BackColor = Color.DarkRed; break; case enmType.Info: this.pictureBox1.Image = Resources.info; this.BackColor = Color.RoyalBlue; break; } this.lblMsg.Text = msg; this.Show(); this.action = enmAction.start; this.timer1.Interval = 1; timer1.Start(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void showAlert(string msg, enmType type) { this.Opacity = 0.0; this.StartPosition = FormStartPosition.Manual; string fname; for (int i = 1; i < 10; i++) { fname = "alert" + i.ToString(); //Message forma = (Message)Application.OpenForms[fname]; Messages forma = (Messages)Application.OpenForms[fname]; if (forma == null) { this.Name = fname; //od lewej this.x = Screen.PrimaryScreen.WorkingArea.Width - this.Width + 15; //margines od dołu this.y = Screen.PrimaryScreen.WorkingArea.Height - this.Height * i - 5 * i; this.Location = new Point(this.x, this.y); break; } } //margines od prawej this.x = Screen.PrimaryScreen.WorkingArea.Width - base.Width - 5; switch (type) { case enmType.Success: this.pictureBox1.Image = Resources.succes_32px; this.BackColor = Color.SeaGreen; break; case enmType.Error: this.pictureBox1.Image = Resources.cancel_32px; this.BackColor = Color.DarkRed; break; case enmType.Warning: this.pictureBox1.Image = Resources.warning_shield_32px; this.BackColor = Color.DarkOrange; break; case enmType.Info: this.pictureBox1.Image = Resources.information_32px; this.BackColor = Color.RoyalBlue; break; } //przypisanie tekstu z konstruktora this.label1.Text = msg; this.Show(); this.action = enmAction.start; this.timer1.Interval = 1; timer1.Start(); }
public void showAlert(string msg, enmType type) { this.Opacity = 0.0; this.StartPosition = FormStartPosition.Manual; string fname; for (int i = 1; i < 10; i++) { fname = "alert" + i.ToString(); AlertForm frm = (AlertForm)Application.OpenForms[fname]; if (frm == null) { this.Name = fname; this.x = Screen.PrimaryScreen.WorkingArea.Width - this.Width + 15; this.y = Screen.PrimaryScreen.WorkingArea.Height - this.Height * i - 5 * i; this.Location = new Point(this.x, this.y); break; } } this.x = Screen.PrimaryScreen.WorkingArea.Width - base.Width - 5; switch (type) { case enmType.Success: this.pbIcon.IconChar = IconChar.Check; this.BackColor = Color.SeaGreen; break; case enmType.Error: this.pbIcon.IconChar = IconChar.Times; this.BackColor = Color.DarkRed; break; case enmType.Info: this.pbIcon.IconChar = IconChar.Info; this.BackColor = Color.RoyalBlue; break; case enmType.Warning: this.pbIcon.IconChar = IconChar.Exclamation; this.BackColor = Color.DarkOrange; break; } this.lblMessage.Text = msg; this.Show(); this.action = enmAction.start; this.timer1.Interval = 1; this.timer1.Start(); }
public void showAlert(string msg, enmType type) { this.Opacity = 0.0; this.StartPosition = FormStartPosition.Manual; string fname; for (int i = 1; i < 10; i++) { fname = "alert" + i.ToString(); NotifyUI frm = (NotifyUI)Application.OpenForms[fname]; if (frm == null) { this.Name = fname; this.x = Screen.PrimaryScreen.WorkingArea.Width - this.Width + 15; this.y = Screen.PrimaryScreen.WorkingArea.Height - this.Height * i - 5 * i; this.Location = new Point(this.x, this.y); break; } } this.x = Screen.PrimaryScreen.WorkingArea.Width - base.Width - 5; switch (type) { case enmType.Success: this.pictureBox1.Image = Resources.success; this.BackColor = Color.FromArgb(255, 142, 102); break; case enmType.Error: this.pictureBox1.Image = Resources.error; this.BackColor = Color.FromArgb(255, 142, 102); break; case enmType.Info: this.pictureBox1.Image = Resources.info; this.BackColor = Color.FromArgb(255, 142, 102); break; case enmType.Warning: this.pictureBox1.Image = Resources.warning; this.BackColor = Color.FromArgb(255, 142, 102); break; } this.lblMsg.Text = msg; this.Show(); this.action = enmAction.start; this.timer1.Interval = 1; this.timer1.Start(); }
public void showAlert(string msg, enmType type) { this.Opacity = 0.0; this.StartPosition = FormStartPosition.Manual; string fname; for (int i = 1; i < 10; i++) { fname = "alert" + i.ToString(); AlertForm frm = (AlertForm)Application.OpenForms[fname]; if (frm == null) { this.Name = fname; this.x = Screen.PrimaryScreen.WorkingArea.Width - this.Width + 15; this.y = Screen.PrimaryScreen.WorkingArea.Height - this.Height * i - 5 * i; this.Location = new Point(this.x, this.y); break; } } this.x = Screen.PrimaryScreen.WorkingArea.Width - base.Width - 5; switch (type) { case enmType.Success: this.pictureBox2.Image = Resources.ok; this.BackColor = Color.SeaGreen; break; case enmType.Error: this.pictureBox2.Image = Resources.ok; this.BackColor = Color.OrangeRed; break; case enmType.Info: this.pictureBox2.Image = Resources.ok; this.BackColor = Color.SeaGreen; break; case enmType.Warning: this.pictureBox2.Image = Resources.ok; this.BackColor = Color.SeaGreen; break; } thongBaoTxt.Text = msg; this.Show(); this.action = enmAction.start; this.timer1.Interval = 1; this.timer1.Start(); }
public void showAlert(string msg, string msg2, string msg3, enmType type) { this.Opacity = 0.0; this.StartPosition = FormStartPosition.Manual; string fname; for (int i = 1; i < 10; i++) { fname = "alert" + i.ToString(); Form_Info frm = (Form_Info)Application.OpenForms[fname]; if (frm == null) { this.Name = fname; this.x = Screen.PrimaryScreen.WorkingArea.Width - this.Width + 15; this.y = Screen.PrimaryScreen.WorkingArea.Height - this.Height * i - 5 * i; this.Location = new Point(this.x, this.y); break; } } this.x = Screen.PrimaryScreen.WorkingArea.Width - base.Width - 5; switch (type) { // Info notification(like Update is availble, etc.) case enmType.Info: this.pictureBox1.Image = Properties.Resources.icons8_info_96px; this.BackColor = Color.RoyalBlue; break; // Minimized notification case enmType.minimized: this.pictureBox1.Image = Properties.Resources._345launcher; this.BackColor = Color.DimGray; break; // Error notification case enmType.Error: this.pictureBox1.Image = Properties.Resources.icons8_error_64px; this.BackColor = Color.Red; break; } this.label1.Text = msg; this.label2.Text = msg2; this.label3.Text = msg3; this.Show(); this.action = enmAction.start; this.timer1.Interval = 1; this.timer1.Start(); }
public void showAlert(string msg, enmType type) { this.Opacity = 0.0; this.StartPosition = FormStartPosition.Manual; string fname; for (int i = 1; i < 10; i++) { fname = "alert" + i.ToString(); Form_Alert frm = (Form_Alert)Application.OpenForms[fname]; if (frm == null) { this.Name = fname; this.x = Screen.PrimaryScreen.WorkingArea.Width - this.Width + 15; this.y = Screen.PrimaryScreen.WorkingArea.Height - this.Height * i - 5 * i; this.Location = new Point(this.x, this.y); break; } } this.x = Screen.PrimaryScreen.WorkingArea.Width - base.Width - 5; switch (type) { // See list of ui symbol at https://docs.microsoft.com/en-us/windows/uwp/design/style/segoe-ui-symbol-font case enmType.Success: labelIcon.Text = "\xEB68"; labelIcon.ForeColor = ColorTranslator.FromHtml("#3ddc84"); //this.BackColor = ColorTranslator.FromHtml("#3ddc84"); break; case enmType.Error: labelIcon.Text = "\xEB5E"; labelIcon.ForeColor = ColorTranslator.FromHtml("#f86734"); //this.BackColor = ColorTranslator.FromHtml("#f86734"); break; case enmType.Rung: labelIcon.Text = "\xEB8C"; labelIcon.ForeColor = ColorTranslator.FromHtml("#f1cc81"); SystemSounds.Beep.Play(); //this.BackColor = ColorTranslator.FromHtml("#f1cc81"); break; } this.alertMsg.Text = msg; this.Show(); this.action = enmAction.start; this.timer1.Interval = 1; this.timer1.Start(); }
public void showAlert(string msg, enmType type) { this.Opacity = 0.0; this.StartPosition = FormStartPosition.Manual; string fname; for (int i = 1; i < 10; i++) { fname = "alert" + i.ToString(); AlertForm frm = (AlertForm)Application.OpenForms[fname]; if (frm == null) { this.Name = fname; this.x = Screen.PrimaryScreen.WorkingArea.Width - this.Width + 15; this.y = Screen.PrimaryScreen.WorkingArea.Height - this.Height * i - 5 * i; this.Location = new Point(this.x, this.y); break; } } this.x = Screen.PrimaryScreen.WorkingArea.Width - base.Width - 5; switch (type) { case enmType.TransactionCompleted: this.pictureBoxAlert.Image = Properties.Resources.transaction_completed; this.labelAlert.ForeColor = Color.SeaGreen; break; case enmType.NotEnoughMoney: this.pictureBoxAlert.Image = Properties.Resources.not_enough_money; this.labelAlert.ForeColor = Color.Red; break; case enmType.NotEnoughTokens: this.pictureBoxAlert.Image = Properties.Resources.not_enough_tokens; this.labelAlert.ForeColor = Color.Red; break; } this.labelAlert.Text = msg; this.Show(); this.action = enmAction.start; this.timer1.Interval = 1; this.timer1.Start(); }
public void showAlert(string msg, enmType type) { this.Opacity = 0.0; this.StartPosition = FormStartPosition.Manual; string fname; for (int i = 1; i < 10; i++) { fname = "alert" + i.ToString(); Form_Alerts frm = (Form_Alerts)Application.OpenForms[fname]; if (frm == null) { this.Name = fname; this.x = Screen.PrimaryScreen.WorkingArea.Width - this.Width + 15; this.y = Screen.PrimaryScreen.WorkingArea.Height - this.Height * i - 5 * i; this.Location = new Point(this.x, this.y); break; } } this.x = Screen.PrimaryScreen.WorkingArea.Width - base.Width - 5; switch (type) { case enmType.Success: this.pictureBox1.Image = Resources.Succes; this.BackColor = Color.SeaGreen; this.circularButtonClose.FlatAppearance.BorderColor = Color.SeaGreen; break; case enmType.Error: this.pictureBox1.Image = Resources.Error; this.BackColor = Color.DarkRed; this.circularButtonClose.FlatAppearance.BorderColor = Color.SeaGreen; break; } this.labelMessage.Text = msg; this.Show(); this.action = enmAction.start; this.timer1.Interval = 1; this.timer1.Start(); }
public ENMap(XmlNode enmNode, SlaveTypes sType) { slaveType = sType; SetSupportedAttributes();//IMP: Call only after slave types are set... SetSupportedDataTypes(); SetSupportedCommandTypes(); SetSupportedEventClass(); SetSupportedEventVariation(); SetSupportedVariation(); //Parse n store values... Utils.WriteLine(VerboseLevel.DEBUG, "enmNode name: '{0}'", enmNode.Name); if (enmNode.Attributes != null) { //First set the root element value... try { enmnType = (enmType)Enum.Parse(typeof(enmType), enmNode.Name); } catch (System.ArgumentException) { Utils.WriteLine(VerboseLevel.WARNING, "Enum argument {0} not supported!!!", enmNode.Name); } foreach (XmlAttribute item in enmNode.Attributes) { Utils.Write(VerboseLevel.DEBUG, "{0} {1} ", item.Name, item.Value); try { if (this.GetType().GetProperty(item.Name) != null) //Ajay: 03/07/2018 { this.GetType().GetProperty(item.Name).SetValue(this, item.Value); } } catch (System.NullReferenceException) { Utils.WriteLine(VerboseLevel.WARNING, "Field doesn't exist. XML and class fields mismatch!!! key: {0} value: {1}", item.Name, item.Value); } } Utils.Write(VerboseLevel.DEBUG, "\n"); } else if (enmNode.NodeType == XmlNodeType.Comment) { isNodeComment = true; comment = enmNode.Value; } }
public void showAlert(string msg, enmType type) { this.Opacity = 0.0; this.StartPosition = FormStartPosition.Manual; this.Location = new Point(1600, 200); /* string fname; * * for (int i = 0; i < 10; i++) * { * fname = "alert" + i.ToString(); * frm_Alert frm = (frm_Alert)Application.OpenForms[fname]; * * if (frm == null) * { * this.x = Screen.PrimaryScreen.WorkingArea.Width - this.Width + 15; * this.x = Screen.PrimaryScreen.WorkingArea.Height - this.Height * i; * this.Location = new Point(this.x, this.y); * break; * } * } */ this.x = Screen.PrimaryScreen.WorkingArea.Width - base.Width - 5; switch (type) { case enmType.Success: this.gunaPictureBox1.Image = Resources.succesicon; this.BackColor = Color.LimeGreen; break; case enmType.Error: this.gunaPictureBox1.Image = Resources.erroricon; this.BackColor = Color.Red; break; } this.lblMsg.Text = msg; this.Show(); this.action = enmAction.start; this.timer1.Interval = 1; timer1.Start(); }
public void showAlert(string msg, enmType type) { this.Opacity = 0.0; this.StartPosition = FormStartPosition.Manual; string fname; for (int i = 1; i < 10; i++) { fname = "alert" + i.ToString(); Notice frm = (Notice)Application.OpenForms[fname]; if (frm == null) { this.Name = fname; this.x = Screen.PrimaryScreen.WorkingArea.Width - this.Width + 15; this.y = Screen.PrimaryScreen.WorkingArea.Height - this.Height * i - 5 * i; this.Location = new Point(this.x, this.y); break; } } this.x = Screen.PrimaryScreen.WorkingArea.Width - base.Width - 5; switch (type) { case enmType.Success: this.pictureBox1.Image = Image.FromFile("C:\\Users\\Admin\\Desktop\\SFCS_NEW-master\\Image\\checklist.png"); this.BackColor = Color.CadetBlue; break; case enmType.Waiting: this.pictureBox1.Image = Image.FromFile("C:\\Users\\Admin\\Desktop\\SFCS_NEW-master\\Image\\clock.png"); this.BackColor = Color.LightYellow; break; } this.lblMsg.Text = msg; this.Show(); this.action = enmAction.start; this.timer1.Interval = 1; this.timer1.Start(); }
public void showAlert(string msg, string subtitle, enmType type) { this.Opacity = 0.0; this.StartPosition = FormStartPosition.Manual; string fname; for (int i = 1; i < 10; i++) { fname = "alert" + i.ToString(); Alert frm = (Alert)Application.OpenForms[fname]; if (frm == null) { this.Name = fname; this.x = Screen.PrimaryScreen.WorkingArea.Width - this.Width + 15; this.y = Screen.PrimaryScreen.WorkingArea.Height - this.Height * i - 5 * i; this.Location = new Point(this.x, this.y); break; } } this.x = Screen.PrimaryScreen.WorkingArea.Width - base.Width - 5; switch (type) { case enmType.BreakFinished: this.BackColor = Color.Crimson; break; case enmType.TaskFinished: this.BackColor = Color.DarkSeaGreen; break; } this.lblMsg.Text = msg; this.lblSubtitle.Text = subtitle; this.Show(); this.action = enmAction.start; this.timer1.Interval = 1; this.timer1.Start(); }
public void showAlert(string msg, int totalCount, enmType type) { this.Opacity = 0.0; this.StartPosition = FormStartPosition.Manual; string fname; for (int i = 1; i < 10; i++) { fname = "alert" + i.ToString(); Form_Alert frm = (Form_Alert)Application.OpenForms[fname]; if (frm == null) { this.Name = fname; this.x = Screen.PrimaryScreen.WorkingArea.Width - this.Width + 15; this.y = Screen.PrimaryScreen.WorkingArea.Height - this.Height * i - 5 * i; this.Location = new Point(this.x, this.y); break; } } switch (type) { case enmType.Success: this.pictureBox1.Image = Resources.success; break; case enmType.Warning: this.pictureBox1.Image = Resources.warning; break; } this.x = Screen.PrimaryScreen.WorkingArea.Width - base.Width - 5; this.textBox1.Text = msg; this.label3.Text = totalCount.ToString(); this.Show(); this.action = enumAction.start; this.timerAlert1.Interval = 1; this.timerAlert1.Start(); }
public ENMap(string enmName, List <KeyValuePair <string, string> > enmData, SlaveTypes sType) { slaveType = sType; SetSupportedAttributes();//IMP: Call only after slave types are set... SetSupportedDataTypes(); SetSupportedCommandTypes(); SetSupportedEventClass(); SetSupportedEventVariation(); SetSupportedVariation(); //First set the root element value... try { enmnType = (enmType)Enum.Parse(typeof(enmType), enmName); } catch (System.ArgumentException) { Utils.WriteLine(VerboseLevel.WARNING, "Enum argument {0} not supported!!!", enmName); } //Parse n store values... if (enmData != null && enmData.Count > 0) { foreach (KeyValuePair <string, string> enmkp in enmData) { Utils.Write(VerboseLevel.DEBUG, "{0} {1} ", enmkp.Key, enmkp.Value); try { if (this.GetType().GetProperty(enmkp.Key) != null) //Ajay: 03/07/2018 { this.GetType().GetProperty(enmkp.Key).SetValue(this, enmkp.Value); } } catch (System.NullReferenceException) { Utils.WriteLine(VerboseLevel.WARNING, "Field doesn't exist. XML and class fields mismatch!!! key: {0} value: {1}", enmkp.Key, enmkp.Value); } } Utils.Write(VerboseLevel.DEBUG, "\n"); } }
public void showAlert(string title, string msg, enmType type) { this.Opacity = 0.0; this.StartPosition = FormStartPosition.Manual; string fname; for (int i = 1; i < 10; i++) { fname = "alert" + i.ToString(); Form_Alert frm = (Form_Alert)Application.OpenForms[fname]; if (frm == null) { this.Name = fname; this.x = Screen.PrimaryScreen.WorkingArea.Width - this.Width + 15; this.y = Screen.PrimaryScreen.WorkingArea.Height - this.Height * i - 5 * i; this.Location = new Point(this.x, this.y); break; } } this.x = Screen.PrimaryScreen.WorkingArea.Width - base.Width - 5; Color backgroundColor = Color.FromArgb(0, 88, 153); // Blue Color borderColor = Color.White; switch (type) { case enmType.Success: this.BackColor = backgroundColor; this.btnUpdate.BackColor = backgroundColor; this.btnUpdate.FlatAppearance.BorderColor = borderColor; this.btnUpdate.FlatAppearance.BorderSize = 2; this.btnPostpone.BackColor = backgroundColor; this.btnPostpone.FlatAppearance.BorderColor = borderColor; this.btnPostpone.FlatAppearance.BorderSize = 2; break; case enmType.Error: //this.pictureBox1.Image = Resources.error; this.BackColor = Color.DarkRed; break; case enmType.Info: //this.pictureBox1.Image = Resources.info; this.BackColor = Color.RoyalBlue; break; case enmType.Warning: //this.pictureBox1.Image = Resources.warning; this.BackColor = Color.DarkOrange; break; } this.lblTitle.Text = title; this.lblMsg.Text = msg; this.Show(); this.action = enmAction.start; this.timer1.Interval = 1; this.timer1.Start(); }