77 lines
1.8 KiB
C#
77 lines
1.8 KiB
C#
|
using Api.Framework;
|
|||
|
using Api.Framework.SDK;
|
|||
|
using BackupAndImport.Properties;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
|
|||
|
namespace DataDocking
|
|||
|
{
|
|||
|
public class Class1 : Plugin
|
|||
|
{
|
|||
|
|
|||
|
public Class1()
|
|||
|
{
|
|||
|
this.Logo = Resources.备份与导入;
|
|||
|
this.Name = Resources.PluginName;
|
|||
|
this.Note = Resources.PluginNote;
|
|||
|
}
|
|||
|
|
|||
|
#region 自定义变量
|
|||
|
public static Config Config = null;
|
|||
|
private MainForm mainForm = null;
|
|||
|
#endregion
|
|||
|
|
|||
|
public override void Start()
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
Config = this.ReadConfig<Config>();
|
|||
|
//创建线程
|
|||
|
TimerTask.NewTimer<AutoBakThread>(60); //创建线程 - 自动备份的线程 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
|
|||
|
{
|
|||
|
if (mainForm != null)
|
|||
|
{
|
|||
|
mainForm.CloseForm();
|
|||
|
mainForm = null;
|
|||
|
}
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
this.OnLog(ex.Message);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
}
|