From cbb5315301b1490b57497212256c5255e5eb7eb6 Mon Sep 17 00:00:00 2001
From: cdk <2441919651@qq.com>
Date: 星期六, 01 十一月 2025 17:06:58 +0800
Subject: [PATCH] Merge branch 'master' of http://git.gs-mes.com:8080/r/~tjx/GsMesClient
---
DevApp/Gs.DevApp/UserControl/Toast.cs | 48 +++++++++++++++++++++++++++++++-----------------
1 files changed, 31 insertions(+), 17 deletions(-)
diff --git a/DevApp/Gs.DevApp/UserControl/Toast.cs b/DevApp/Gs.DevApp/UserControl/Toast.cs
index de950d3..ef9e5c4 100644
--- a/DevApp/Gs.DevApp/UserControl/Toast.cs
+++ b/DevApp/Gs.DevApp/UserControl/Toast.cs
@@ -1,12 +1,6 @@
-锘縰sing DevExpress.XtraEditors;
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
+锘縰sing System;
+using System.Configuration;
using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using System.Windows.Forms;
namespace Gs.DevApp
@@ -15,26 +9,46 @@
{
private System.Windows.Forms.Timer tmr;
private System.Windows.Forms.Timer tmr2;
+
+
/// <summary>
- /// Shows a message windows. 3 sec is the suggested time
+ ///
/// </summary>
- /// <param name="messageText">Message</param>
- /// <param name="vanishingSeconds">Showing time</param>
- public Toast(System.Drawing.Color bgColor,string messageText, int vanishingSeconds = 2)
+ /// <param name="it">1鎴愬姛锛�-1澶辫触</param>
+ /// <param name="messageText"></param>
+ /// <param name="vanishingSeconds">鍔ㄧ敾寤堕暱鏃堕棿</param>
+ public Toast(int it, string messageText, int vanishingSeconds = 5)
{
InitializeComponent();
- this.Appearance.BackColor = bgColor;
+ try
+ {
+ string _vanishingSeconds = ConfigurationManager.AppSettings["ToastSeconds"];
+ if (!string.IsNullOrEmpty(_vanishingSeconds))
+ vanishingSeconds = int.Parse(_vanishingSeconds);
+ }
+ catch (Exception)
+ {
+
+ }
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Toast));
+ if (it > 0)
+ {
+ this.panel1.BackgroundImage = global::Gs.DevApp.Properties.Resources.ok10;
+ this.testo.Appearance.BackColor = System.Drawing.Color.SeaGreen;
+ }
+ else
+ {
+ this.panel1.BackgroundImage = global::Gs.DevApp.Properties.Resources.error10;
+ this.testo.Appearance.BackColor = System.Drawing.Color.Firebrick;
+ }
double elapsedTime = 0;
testo.Text = messageText;
double vanishingMilliSeconds = vanishingSeconds * 1000;
-
// message dimensions
//this.Width = testo.Width + 50;
//this.Height = testo.Height + 50;
-
//text position
- // testo.Location = new Point((this.Width / 2) - (testo.Width / 2), (this.Height / 2) - (testo.Height / 2));
-
+ // testo.Location = new Point((this.Width / 2) - (testo.Width / 2), (this.Height / 2) - (testo.Height / 2));
//first timer
tmr = new System.Windows.Forms.Timer();
tmr.Tick += delegate
--
Gitblit v1.9.3