📄 systeminfonotify.cs
字号:
namespace Imps.Client.Pc
{
using Imps.Client.Pc.BizControls.NotifyWindows;
using Imps.Client.Pc.BizControls.NotifyWindows.Templates;
using Imps.Client.Resource;
using Imps.Client.Utils;
using System;
using System.Drawing;
public class SystemInfoNotify : NotifyWindowTemplateBase
{
private Imps.Client.Pc.SystemMessage _msg;
protected NotifyWindowLabel contentLabel;
protected NotifyWindowLabel linkLabel;
protected NotifyWindowLabel titleLabel;
public SystemInfoNotify(string title, Imps.Client.Pc.SystemMessage msg)
{
base.title = title;
base.iconImage = ImpsTrayIcons.SysMsg.ToBitmap();
this._msg = msg;
base.InitContent();
}
public SystemInfoNotify(string title, string content) : this(string.Empty, new Imps.Client.Pc.SystemMessage(string.Empty, content, string.Empty, string.Empty))
{
}
private void contentLabel_Click(object sender, NotifyWindowEventArgs e)
{
if (!string.IsNullOrEmpty(this._msg._link))
{
ShellHelper.StartUrl(this._msg._link);
base.Close();
}
}
protected override void CreateContent(NotifyWindowContent content)
{
if (!string.IsNullOrEmpty(this._msg._link))
{
Rectangle rectangle = new Rectangle(12, 30, 180, 60);
this.contentLabel = new NotifyWindowLabel(this._msg._content, rectangle);
content.Elements.Add(this.contentLabel);
Rectangle rectangle2 = new Rectangle(110, 0x62, 180, 20);
this.linkLabel = new NotifyWindowLabel("更多详细信息", rectangle2);
this.linkLabel.TextFont = new Font(new FontFamily("宋体"), 12f, FontStyle.Underline, GraphicsUnit.Pixel);
this.linkLabel.TextColor = Color.Blue;
this.linkLabel.Clickable = true;
this.linkLabel.Click += new NotifyWindowEventHandler(this.contentLabel_Click);
content.Elements.Add(this.linkLabel);
}
else
{
Rectangle rectangle3 = new Rectangle(12, 30, 180, 80);
this.contentLabel = new NotifyWindowLabel(this._msg._content, rectangle3);
content.Elements.Add(this.contentLabel);
}
Rectangle textRectangle = new Rectangle(0x42, 4, 100, 20);
this.titleLabel = new NotifyWindowLabel(base.title, textRectangle);
this.titleLabel.TextFont = new Font(new FontFamily("宋体"), 12f, FontStyle.Bold, GraphicsUnit.Pixel);
this.titleLabel.TextColor = Color.FromArgb(0x71, 0x7d, 0xab);
this.titleLabel.HoverTextFont = new Font(new FontFamily("宋体"), 12f, FontStyle.Bold, GraphicsUnit.Pixel);
this.titleLabel.HoverTextColor = Color.FromArgb(0x71, 0x7d, 0xab);
content.Elements.Add(this.titleLabel);
}
public Imps.Client.Pc.SystemMessage SystemMessage
{
get
{
return this._msg;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -