77 lines
2.0 KiB
C#
77 lines
2.0 KiB
C#
|
using Api.Framework;
|
|||
|
using Api.Framework.Tools;
|
|||
|
using SqlSugar;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.ComponentModel;
|
|||
|
using System.Data;
|
|||
|
using System.Drawing;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using System.Windows.Forms;
|
|||
|
|
|||
|
namespace NewFans
|
|||
|
{
|
|||
|
public partial class MainForm : Form
|
|||
|
{
|
|||
|
public MainForm()
|
|||
|
{
|
|||
|
InitializeComponent();
|
|||
|
this.Text = "新粉助手";
|
|||
|
}
|
|||
|
|
|||
|
public void CloseForm()
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
if (!this.IsDisposed)
|
|||
|
{
|
|||
|
this.Invoke(new Action(delegate
|
|||
|
{
|
|||
|
this.Close();
|
|||
|
this.Dispose();
|
|||
|
}));
|
|||
|
}
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
MessageBox.Show(ex.Message);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
private void MainForm_Load(object sender, EventArgs e)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
checkBox1.Checked = Class1.Config.isRun;
|
|||
|
textBox0.Text = Class1.Config.mess3;
|
|||
|
textBox1.Text = Class1.Config.mess24;
|
|||
|
textBox2.Text = Class1.Config.mess48;
|
|||
|
textBox3.Text = Class1.Config.mess72;
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
MessageBox.Show(ex.Message);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
Class1.Config.isRun = checkBox1.Checked;
|
|||
|
Class1.Config.mess3 = textBox0.Text;
|
|||
|
Class1.Config.mess24 = textBox1.Text;
|
|||
|
Class1.Config.mess48 = textBox2.Text;
|
|||
|
Class1.Config.mess72 = textBox3.Text;
|
|||
|
Util.Save(Class1.Config);
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
MessageBox.Show(ex.Message);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|