FormSystemEvent.cs
(开头部分) 6KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using AppManager.Config;
using AppManager.Utils;
using System;
using System.Drawing;
using System.Windows.Forms;
namespace AppManager {
/// <summary>
/// 当前类是主窗口相关的事件
/// </summary>
partial class Form1 {
/// <summary>
/// 初始化主窗口尺寸和位置
/// </summary>
private void InitMainForm() {
DeleteParamButton.Click += DeleteParamButton_Click;
FormParamFlowLayoutPanel.ClientSizeChanged += FormParamFlowLayoutPanel_ClientSizeChanged;
#region 窗口大小加载
var locationX = IniUtils.IniReadValue(Configs.SystemIniPath, Configs.IniSectionSystem, Configs.IniKeyFormLocationX);
var locationY = IniUtils.IniReadValue(Configs.SystemIniPath, Configs.IniSectionSystem, Configs.IniKeyFormLocationY);
var heightStr = IniUtils.IniReadValue(Configs.SystemIniPath, Configs.IniSectionSystem, Configs.IniKeyFormHeight);
var widthStr = IniUtils.IniReadValue(Configs.SystemIniPath, Configs.IniSectionSystem, Configs.IniKeyFormWidth);
if (!string.IsNullOrEmpty(heightStr)) {
var height = int.Parse(heightStr);
Size = new Size(Size.Width, height);
}
// 宽度设置
if (!string.IsNullOrEmpty(widthStr)) {
var width = int.Parse(widthStr);
Size = new Size(width, Size.Height);
}
var x = Location.X;
var y = Location.Y;
if (!string.IsNullOrEmpty(locationX)) {
x = Convert.ToInt32(locationX);
}
if (!string.IsNullOrEmpty(locationY)) {
y = Convert.ToInt32(locationY);
}
Location = new Point(x, y);
#endregion
#region 通知栏右键菜单初始化
var notifyIconRightMenu = new ContextMenuStrip();
notifyIconRightMenu.AddToolStripMenu(null, Configs.RightButtonNotifyIconShowForm, "显示窗口", null, FormShow);
notifyIconRightMenu.AddToolStripMenu(null, Configs.RightButtonNotifyIconCloseForm, "退出", null, FormClose);
AppManagerNotifyIcon.ContextMenuStrip = notifyIconRightMenu;
#endregion
#region 状态栏初始化
AuthorToolStripStatusLabel.Alignment = ToolStripItemAlignment.Right;
AuthorToolStripStatusLabel.Text = $"作者:{Configs.AuthorEmail}";
IpToolStripStatusLabel.Alignment = ToolStripItemAlignment.Right;
IpToolStripStatusLabel.Text = $"IP:{IpUtils.GetLocalIp()}";
#endregion
}
#region 通知栏图标事件
private void AppManagerNotifyIcon_MouseDown(object sender, MouseEventArgs e) {
if (MouseButtons.Left == e.Button) {
后面还有 93 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。