old_flsystem/应用/CleaningTools/Class1.cs

73 lines
1.7 KiB
C#
Raw Permalink Normal View History

2022-09-20 03:10:29 +00:00
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);
}
}
}
}