73 lines
1.7 KiB
C#
73 lines
1.7 KiB
C#
using Api.Framework.SDK;
|
|
using CleaningTools.Properties;
|
|
using System;
|
|
|
|
namespace CleaningTools
|
|
{
|
|
public class Class1 : Plugin
|
|
{
|
|
public Class1()
|
|
{
|
|
this.Name = Resources.PluginName;
|
|
this.Note = Resources.PluginNote;
|
|
this.Logo = Resources.清理专家;
|
|
}
|
|
|
|
#region 自定义变量
|
|
public static Config Config = null;
|
|
private MainForm mainForm = null;
|
|
#endregion
|
|
|
|
public override void Start()
|
|
{
|
|
try
|
|
{
|
|
//创建配置文件
|
|
Config = this.ReadConfig<Config>();
|
|
TimerTask.NewTimer<CleaningThread>(60);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
this.OnLog(ex.Message);
|
|
}
|
|
|
|
}
|
|
|
|
public override void ShowForm()
|
|
{
|
|
try
|
|
{
|
|
if (mainForm == null || mainForm.IsDisposed)
|
|
{
|
|
mainForm = new MainForm();
|
|
mainForm.Show();
|
|
}
|
|
mainForm.TopMost = true;
|
|
mainForm.TopMost = false;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
this.OnLog(ex.Message);
|
|
}
|
|
}
|
|
|
|
public override void Stop()
|
|
{
|
|
try
|
|
{
|
|
TimerTask.Close<CleaningThread>();
|
|
if (mainForm != null)
|
|
{
|
|
mainForm.CloseForm();
|
|
mainForm = null;
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
this.OnLog(ex.Message);
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|