* UITitlePanel: 增加标题文字颜色
This commit is contained in:
parent
ee1fb615a8
commit
4b8ead5322
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -30,12 +30,12 @@ using System.Windows.Forms;
|
|||||||
|
|
||||||
namespace Sunny.UI
|
namespace Sunny.UI
|
||||||
{
|
{
|
||||||
public class UIFlowLayoutPanel : UIPanel,IToolTip
|
public class UIFlowLayoutPanel : UIPanel, IToolTip
|
||||||
{
|
{
|
||||||
private UIVerScrollBarEx VBar;
|
private UIVerScrollBarEx VBar;
|
||||||
private UIHorScrollBarEx HBar;
|
private UIHorScrollBarEx HBar;
|
||||||
private FlowLayoutPanel flowLayoutPanel;
|
private FlowLayoutPanel flowLayoutPanel;
|
||||||
private readonly Timer timer = new Timer();
|
private readonly Timer timer;
|
||||||
|
|
||||||
public UIFlowLayoutPanel()
|
public UIFlowLayoutPanel()
|
||||||
{
|
{
|
||||||
@ -56,6 +56,7 @@ namespace Sunny.UI
|
|||||||
HBar.ValueChanged += HBar_ValueChanged;
|
HBar.ValueChanged += HBar_ValueChanged;
|
||||||
|
|
||||||
SizeChanged += Panel_SizeChanged;
|
SizeChanged += Panel_SizeChanged;
|
||||||
|
timer = new Timer();
|
||||||
timer.Interval = 100;
|
timer.Interval = 100;
|
||||||
timer.Tick += Timer_Tick;
|
timer.Tick += Timer_Tick;
|
||||||
timer.Start();
|
timer.Start();
|
||||||
@ -86,7 +87,8 @@ namespace Sunny.UI
|
|||||||
protected override void Dispose(bool disposing)
|
protected override void Dispose(bool disposing)
|
||||||
{
|
{
|
||||||
base.Dispose(disposing);
|
base.Dispose(disposing);
|
||||||
timer.Stop();
|
timer?.Stop();
|
||||||
|
timer?.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
[DefaultValue(System.Windows.Forms.FlowDirection.LeftToRight)]
|
[DefaultValue(System.Windows.Forms.FlowDirection.LeftToRight)]
|
||||||
|
@ -36,6 +36,7 @@ namespace Sunny.UI
|
|||||||
SetStyleFlags(true, false);
|
SetStyleFlags(true, false);
|
||||||
Maximum = 100;
|
Maximum = 100;
|
||||||
left_state = value_state = right_state = DrawItemState.None;
|
left_state = value_state = right_state = DrawItemState.None;
|
||||||
|
timer = new Timer();
|
||||||
timer.Interval = 150;
|
timer.Interval = 150;
|
||||||
timer.Tick += TimerTick;
|
timer.Tick += TimerTick;
|
||||||
Width = 300;
|
Width = 300;
|
||||||
@ -48,10 +49,11 @@ namespace Sunny.UI
|
|||||||
fillPressColor = Color.FromArgb(74, 131, 229);
|
fillPressColor = Color.FromArgb(74, 131, 229);
|
||||||
}
|
}
|
||||||
|
|
||||||
~UIHorScrollBar()
|
protected override void Dispose(bool disposing)
|
||||||
{
|
{
|
||||||
timer.Stop();
|
base.Dispose(disposing);
|
||||||
timer.Dispose();
|
timer?.Stop();
|
||||||
|
timer?.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
private int scrollValue;
|
private int scrollValue;
|
||||||
@ -64,7 +66,7 @@ namespace Sunny.UI
|
|||||||
private int dragOffset;
|
private int dragOffset;
|
||||||
private int barWidth;
|
private int barWidth;
|
||||||
private double percentValue;
|
private double percentValue;
|
||||||
private readonly Timer timer = new Timer();
|
private readonly Timer timer;
|
||||||
private bool isScrollUp = true;
|
private bool isScrollUp = true;
|
||||||
private bool largeChange = true;
|
private bool largeChange = true;
|
||||||
|
|
||||||
|
@ -42,12 +42,13 @@ namespace Sunny.UI
|
|||||||
private bool _on = true;
|
private bool _on = true;
|
||||||
private readonly Color _reflectionColor = Color.FromArgb(180, 255, 255, 255);
|
private readonly Color _reflectionColor = Color.FromArgb(180, 255, 255, 255);
|
||||||
private readonly Color[] _surroundColor = new Color[] { Color.FromArgb(0, 255, 255, 255) };
|
private readonly Color[] _surroundColor = new Color[] { Color.FromArgb(0, 255, 255, 255) };
|
||||||
private readonly Timer _timer = new Timer();
|
private readonly Timer timer;
|
||||||
|
|
||||||
~UILedBulb()
|
protected override void Dispose(bool disposing)
|
||||||
{
|
{
|
||||||
_timer.Stop();
|
base.Dispose(disposing);
|
||||||
_timer.Dispose();
|
timer?.Stop();
|
||||||
|
timer?.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -106,7 +107,8 @@ namespace Sunny.UI
|
|||||||
|
|
||||||
Width = Height = 32;
|
Width = Height = 32;
|
||||||
Color = Color.FromArgb(192, 255, 192);
|
Color = Color.FromArgb(192, 255, 192);
|
||||||
_timer.Tick += (sender, e) => { On = !On; };
|
timer = new Timer();
|
||||||
|
timer.Tick += (sender, e) => { On = !On; };
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Constructor
|
#endregion Constructor
|
||||||
@ -199,22 +201,22 @@ namespace Sunny.UI
|
|||||||
{
|
{
|
||||||
blinkInterval = Math.Max(100, value);
|
blinkInterval = Math.Max(100, value);
|
||||||
bool isBlink = Blink;
|
bool isBlink = Blink;
|
||||||
if (isBlink) _timer.Stop();
|
if (isBlink) timer.Stop();
|
||||||
_timer.Interval = blinkInterval;
|
timer.Interval = blinkInterval;
|
||||||
_timer.Enabled = isBlink;
|
timer.Enabled = isBlink;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[DefaultValue(false)]
|
[DefaultValue(false)]
|
||||||
public bool Blink
|
public bool Blink
|
||||||
{
|
{
|
||||||
get => _timer.Enabled;
|
get => timer.Enabled;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
On = true;
|
On = true;
|
||||||
_timer.Stop();
|
timer.Stop();
|
||||||
_timer.Interval = BlinkInterval;
|
timer.Interval = BlinkInterval;
|
||||||
_timer.Enabled = value;
|
timer.Enabled = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
37
SunnyUI/Controls/UIListBox.Designer.cs
generated
37
SunnyUI/Controls/UIListBox.Designer.cs
generated
@ -1,37 +0,0 @@
|
|||||||
namespace Sunny.UI
|
|
||||||
{
|
|
||||||
partial class UIListBox
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 必需的设计器变量。
|
|
||||||
/// </summary>
|
|
||||||
private System.ComponentModel.IContainer components = null;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 清理所有正在使用的资源。
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
|
|
||||||
protected override void Dispose(bool disposing)
|
|
||||||
{
|
|
||||||
if (disposing && (components != null))
|
|
||||||
{
|
|
||||||
components.Dispose();
|
|
||||||
}
|
|
||||||
base.Dispose(disposing);
|
|
||||||
}
|
|
||||||
|
|
||||||
#region 组件设计器生成的代码
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 设计器支持所需的方法 - 不要修改
|
|
||||||
/// 使用代码编辑器修改此方法的内容。
|
|
||||||
/// </summary>
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
components = new System.ComponentModel.Container();
|
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
}
|
|
@ -41,11 +41,10 @@ namespace Sunny.UI
|
|||||||
{
|
{
|
||||||
private readonly ListBoxEx listbox = new ListBoxEx();
|
private readonly ListBoxEx listbox = new ListBoxEx();
|
||||||
private readonly UIScrollBar bar = new UIScrollBar();
|
private readonly UIScrollBar bar = new UIScrollBar();
|
||||||
private readonly Timer timer = new Timer();
|
private readonly Timer timer;
|
||||||
|
|
||||||
public UIListBox()
|
public UIListBox()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
|
||||||
SetStyleFlags(true, false);
|
SetStyleFlags(true, false);
|
||||||
ShowText = false;
|
ShowText = false;
|
||||||
Padding = new Padding(2);
|
Padding = new Padding(2);
|
||||||
@ -84,10 +83,18 @@ namespace Sunny.UI
|
|||||||
listbox.MouseEnter += Listbox_MouseEnter;
|
listbox.MouseEnter += Listbox_MouseEnter;
|
||||||
listbox.MouseLeave += Listbox_MouseLeave;
|
listbox.MouseLeave += Listbox_MouseLeave;
|
||||||
|
|
||||||
|
timer = new Timer();
|
||||||
timer.Tick += Timer_Tick;
|
timer.Tick += Timer_Tick;
|
||||||
timer.Start();
|
timer.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
base.Dispose(disposing);
|
||||||
|
timer?.Stop();
|
||||||
|
timer?.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
public new EventHandler MouseLeave;
|
public new EventHandler MouseLeave;
|
||||||
public new EventHandler MouseEnter;
|
public new EventHandler MouseEnter;
|
||||||
public new event KeyPressEventHandler KeyPress;
|
public new event KeyPressEventHandler KeyPress;
|
||||||
@ -293,12 +300,6 @@ namespace Sunny.UI
|
|||||||
public new event MouseEventHandler MouseUp;
|
public new event MouseEventHandler MouseUp;
|
||||||
public new event MouseEventHandler MouseMove;
|
public new event MouseEventHandler MouseMove;
|
||||||
|
|
||||||
~UIListBox()
|
|
||||||
{
|
|
||||||
timer.Stop();
|
|
||||||
timer.Dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Timer_Tick(object sender, EventArgs e)
|
private void Timer_Tick(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (Items.Count == 0 && LastCount != 0)
|
if (Items.Count == 0 && LastCount != 0)
|
||||||
|
@ -31,13 +31,14 @@ namespace Sunny.UI
|
|||||||
[ToolboxItem(true)]
|
[ToolboxItem(true)]
|
||||||
public sealed class UIProgressIndicator : UIControl
|
public sealed class UIProgressIndicator : UIControl
|
||||||
{
|
{
|
||||||
private readonly Timer timer = new Timer();
|
private readonly Timer timer;
|
||||||
|
|
||||||
public UIProgressIndicator()
|
public UIProgressIndicator()
|
||||||
{
|
{
|
||||||
SetStyleFlags(true, false);
|
SetStyleFlags(true, false);
|
||||||
Width = Height = 100;
|
Width = Height = 100;
|
||||||
|
|
||||||
|
timer = new Timer();
|
||||||
timer.Interval = 200;
|
timer.Interval = 200;
|
||||||
timer.Tick += timer_Tick;
|
timer.Tick += timer_Tick;
|
||||||
timer.Start();
|
timer.Start();
|
||||||
@ -48,10 +49,21 @@ namespace Sunny.UI
|
|||||||
foreColor = UIColor.Blue;
|
foreColor = UIColor.Blue;
|
||||||
}
|
}
|
||||||
|
|
||||||
~UIProgressIndicator()
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
base.Dispose(disposing);
|
||||||
|
timer?.Stop();
|
||||||
|
timer?.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Start()
|
||||||
|
{
|
||||||
|
timer.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Stop()
|
||||||
{
|
{
|
||||||
timer.Stop();
|
timer.Stop();
|
||||||
timer.Dispose();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SetStyleColor(UIBaseStyle uiColor)
|
public override void SetStyleColor(UIBaseStyle uiColor)
|
||||||
|
@ -37,6 +37,7 @@ namespace Sunny.UI
|
|||||||
SetStyleFlags(true, false);
|
SetStyleFlags(true, false);
|
||||||
Maximum = 100;
|
Maximum = 100;
|
||||||
up_state = value_state = down_state = DrawItemState.None;
|
up_state = value_state = down_state = DrawItemState.None;
|
||||||
|
timer = new Timer();
|
||||||
timer.Interval = 150;
|
timer.Interval = 150;
|
||||||
timer.Tick += TimerTick;
|
timer.Tick += TimerTick;
|
||||||
Width = SystemInformation.VerticalScrollBarWidth + 2;
|
Width = SystemInformation.VerticalScrollBarWidth + 2;
|
||||||
@ -59,16 +60,17 @@ namespace Sunny.UI
|
|||||||
private int dragOffset;
|
private int dragOffset;
|
||||||
private int barHeight;
|
private int barHeight;
|
||||||
private double percentValue;
|
private double percentValue;
|
||||||
private readonly Timer timer = new Timer();
|
private readonly Timer timer;
|
||||||
private bool isScrollUp = true;
|
private bool isScrollUp = true;
|
||||||
private bool largeChange = true;
|
private bool largeChange = true;
|
||||||
|
|
||||||
public event EventHandler ValueChanged;
|
public event EventHandler ValueChanged;
|
||||||
|
|
||||||
~UIScrollBar()
|
protected override void Dispose(bool disposing)
|
||||||
{
|
{
|
||||||
timer.Stop();
|
base.Dispose(disposing);
|
||||||
timer.Dispose();
|
timer?.Stop();
|
||||||
|
timer?.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
[DefaultValue(0)]
|
[DefaultValue(0)]
|
||||||
|
@ -31,7 +31,7 @@ namespace Sunny.UI
|
|||||||
[ToolboxItem(true)]
|
[ToolboxItem(true)]
|
||||||
public class UIScrollingText : UIControl
|
public class UIScrollingText : UIControl
|
||||||
{
|
{
|
||||||
private readonly Timer timer = new Timer();
|
private readonly Timer timer;
|
||||||
private int XPos = int.MinValue;
|
private int XPos = int.MinValue;
|
||||||
private int XPos1 = int.MaxValue;
|
private int XPos1 = int.MaxValue;
|
||||||
private int interval = 200;
|
private int interval = 200;
|
||||||
@ -44,6 +44,7 @@ namespace Sunny.UI
|
|||||||
foreColor = UIStyles.GetStyleColor(UIStyle.Blue).RectColor;
|
foreColor = UIStyles.GetStyleColor(UIStyle.Blue).RectColor;
|
||||||
Reset();
|
Reset();
|
||||||
|
|
||||||
|
timer = new Timer();
|
||||||
timer.Interval = interval;
|
timer.Interval = interval;
|
||||||
timer.Tick += Timer_Tick;
|
timer.Tick += Timer_Tick;
|
||||||
}
|
}
|
||||||
@ -75,10 +76,21 @@ namespace Sunny.UI
|
|||||||
Invalidate();
|
Invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
~UIScrollingText()
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
base.Dispose(disposing);
|
||||||
|
timer?.Stop();
|
||||||
|
timer?.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Start()
|
||||||
|
{
|
||||||
|
timer.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Stop()
|
||||||
{
|
{
|
||||||
timer.Stop();
|
timer.Stop();
|
||||||
timer.Dispose();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[DefaultValue(200), Description("刷新间隔"), Category("SunnyUI")]
|
[DefaultValue(200), Description("刷新间隔"), Category("SunnyUI")]
|
||||||
|
@ -39,7 +39,7 @@ namespace Sunny.UI
|
|||||||
{
|
{
|
||||||
private readonly UITabControlHelper Helper;
|
private readonly UITabControlHelper Helper;
|
||||||
private int DrawedIndex = -1;
|
private int DrawedIndex = -1;
|
||||||
private readonly Timer timer = new Timer();
|
private readonly Timer timer;
|
||||||
|
|
||||||
public UITabControl()
|
public UITabControl()
|
||||||
{
|
{
|
||||||
@ -57,14 +57,16 @@ namespace Sunny.UI
|
|||||||
Version = UIGlobal.Version;
|
Version = UIGlobal.Version;
|
||||||
|
|
||||||
Helper = new UITabControlHelper(this);
|
Helper = new UITabControlHelper(this);
|
||||||
|
timer = new Timer();
|
||||||
timer.Interval = 500;
|
timer.Interval = 500;
|
||||||
timer.Tick += Timer_Tick;
|
timer.Tick += Timer_Tick;
|
||||||
}
|
}
|
||||||
|
|
||||||
~UITabControl()
|
protected override void Dispose(bool disposing)
|
||||||
{
|
{
|
||||||
timer.Stop();
|
base.Dispose(disposing);
|
||||||
timer.Dispose();
|
timer?.Stop();
|
||||||
|
timer?.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
private string mainPage = "";
|
private string mainPage = "";
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
* 2020-01-01: V2.2.0 增加文件说明
|
* 2020-01-01: V2.2.0 增加文件说明
|
||||||
* 2020-04-25: V2.2.4 更新主题配置类
|
* 2020-04-25: V2.2.4 更新主题配置类
|
||||||
* 2020-07-30: V2.2.6 增加可收缩选项
|
* 2020-07-30: V2.2.6 增加可收缩选项
|
||||||
|
* 2020-09-03: V3.0.6 增加标题文字颜色
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
@ -63,7 +64,6 @@ namespace Sunny.UI
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
SetStyleFlags(true, false);
|
SetStyleFlags(true, false);
|
||||||
ShowText = false;
|
ShowText = false;
|
||||||
foreColor = Color.White;
|
|
||||||
CalcSystemBoxPos();
|
CalcSystemBoxPos();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ namespace Sunny.UI
|
|||||||
{
|
{
|
||||||
base.SetStyleColor(uiColor);
|
base.SetStyleColor(uiColor);
|
||||||
titleColor = uiColor.TitleColor;
|
titleColor = uiColor.TitleColor;
|
||||||
foreColor = uiColor.TitleForeColor;
|
titleForeColor = uiColor.TitleForeColor;
|
||||||
Invalidate();
|
Invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,6 +92,21 @@ namespace Sunny.UI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Color titleForeColor = Color.White;
|
||||||
|
|
||||||
|
[DefaultValue(typeof(Color), "White")]
|
||||||
|
[Description("标题文字颜色"), Category("SunnyUI")]
|
||||||
|
public Color TitleForeColor
|
||||||
|
{
|
||||||
|
get => titleForeColor;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
titleForeColor = value;
|
||||||
|
_style = UIStyle.Custom;
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private Color titleColor = UIColor.Blue;
|
private Color titleColor = UIColor.Blue;
|
||||||
|
|
||||||
[DefaultValue(typeof(Color), "80, 160, 255")]
|
[DefaultValue(typeof(Color), "80, 160, 255")]
|
||||||
@ -119,7 +134,7 @@ namespace Sunny.UI
|
|||||||
Color color = Enabled ? TitleColor : UIDisableColor.Fill;
|
Color color = Enabled ? TitleColor : UIDisableColor.Fill;
|
||||||
g.FillPath(color, path);
|
g.FillPath(color, path);
|
||||||
|
|
||||||
color = Enabled ? ForeColor : UIFontColor.Regular;
|
color = Enabled ? TitleForeColor : UIFontColor.Regular;
|
||||||
SizeF sf = g.MeasureString(Text, Font);
|
SizeF sf = g.MeasureString(Text, Font);
|
||||||
switch (TextAlign)
|
switch (TextAlign)
|
||||||
{
|
{
|
||||||
|
@ -29,7 +29,7 @@ namespace Sunny.UI
|
|||||||
[ToolboxItem(true)]
|
[ToolboxItem(true)]
|
||||||
public sealed class UIWaitingBar : UIControl
|
public sealed class UIWaitingBar : UIControl
|
||||||
{
|
{
|
||||||
private readonly Timer timer = new Timer();
|
private readonly Timer timer;
|
||||||
|
|
||||||
public UIWaitingBar()
|
public UIWaitingBar()
|
||||||
{
|
{
|
||||||
@ -40,15 +40,27 @@ namespace Sunny.UI
|
|||||||
|
|
||||||
fillColor = UIColor.LightBlue;
|
fillColor = UIColor.LightBlue;
|
||||||
foreColor = UIColor.Blue;
|
foreColor = UIColor.Blue;
|
||||||
|
timer = new Timer();
|
||||||
timer.Interval = 200;
|
timer.Interval = 200;
|
||||||
timer.Tick += Timer_Tick;
|
timer.Tick += Timer_Tick;
|
||||||
timer.Start();
|
timer.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
~UIWaitingBar()
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
base.Dispose(disposing);
|
||||||
|
timer?.Stop();
|
||||||
|
timer?.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Start()
|
||||||
|
{
|
||||||
|
timer.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Stop()
|
||||||
{
|
{
|
||||||
timer.Stop();
|
timer.Stop();
|
||||||
timer.Dispose();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnPaint(PaintEventArgs e)
|
protected override void OnPaint(PaintEventArgs e)
|
||||||
|
@ -68,7 +68,8 @@ namespace Sunny.UI
|
|||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
Active = false;
|
Active = false;
|
||||||
timer.Stop();
|
timer?.Stop();
|
||||||
|
timer?.Dispose();
|
||||||
Image?.Dispose();
|
Image?.Dispose();
|
||||||
Image = null;
|
Image = null;
|
||||||
ShowImage?.Dispose();
|
ShowImage?.Dispose();
|
||||||
|
@ -32,7 +32,7 @@ namespace Sunny.UI
|
|||||||
{
|
{
|
||||||
public class Thunder : IDisposable
|
public class Thunder : IDisposable
|
||||||
{
|
{
|
||||||
private readonly Timer timer = new Timer();
|
private readonly Timer timer;
|
||||||
private bool Exit;
|
private bool Exit;
|
||||||
|
|
||||||
public delegate void OnTaskInfoChange(object sender, ThunderTask task);
|
public delegate void OnTaskInfoChange(object sender, ThunderTask task);
|
||||||
@ -52,7 +52,7 @@ namespace Sunny.UI
|
|||||||
public Thunder()
|
public Thunder()
|
||||||
{
|
{
|
||||||
InitSuccess = ThunderDll.Init();
|
InitSuccess = ThunderDll.Init();
|
||||||
|
timer = new Timer();
|
||||||
timer.Interval = 1000;
|
timer.Interval = 1000;
|
||||||
timer.Tick += Timer_Tick;
|
timer.Tick += Timer_Tick;
|
||||||
timer.Start();
|
timer.Start();
|
||||||
@ -60,8 +60,8 @@ namespace Sunny.UI
|
|||||||
|
|
||||||
~Thunder()
|
~Thunder()
|
||||||
{
|
{
|
||||||
timer.Stop();
|
timer?.Stop();
|
||||||
timer.Dispose();
|
timer?.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Timer_Tick(object sender, EventArgs e)
|
private void Timer_Tick(object sender, EventArgs e)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user