86 lines
2.1 KiB
C#
86 lines
2.1 KiB
C#
using Api.Framework;
|
||
using Api.Framework.SDK;
|
||
using ProductClient.Properties;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.Linq;
|
||
using System.Text;
|
||
using System.Threading.Tasks;
|
||
|
||
namespace ProductClient
|
||
{
|
||
public class Class1 : Plugin
|
||
{
|
||
public Class1()
|
||
{
|
||
this.Name = "爆单-代运营";
|
||
this.Note = "专业的运营团队、代运营朋友圈、直播群!";
|
||
this.Logo = Resources.爆单;
|
||
}
|
||
|
||
#region 自定义变量
|
||
public static Config Config;
|
||
private MainForm mainForm = null;
|
||
#endregion
|
||
|
||
public override void Start()
|
||
{
|
||
try
|
||
{
|
||
var session = ApiClient.GetSession();
|
||
#region 判断表是否存在,不存在创建表
|
||
//if (!session.TableExist<>())
|
||
//{
|
||
// session.CreateTable<>();
|
||
// session.AddIndex<>("");
|
||
//}
|
||
#endregion
|
||
|
||
//创建配置文件
|
||
Config = this.ReadConfig<Config>();
|
||
|
||
var thread = TimerTask.NewTimer<MonitorThread>(60) as MonitorThread;
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
this.OnLog(ex.Message);
|
||
}
|
||
}
|
||
|
||
public override void ShowForm()
|
||
{
|
||
try
|
||
{
|
||
if (mainForm == null || mainForm.IsDisposed)
|
||
{
|
||
mainForm = new MainForm();
|
||
mainForm.Show();
|
||
}
|
||
mainForm.Activate();
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
this.OnLog("执行时被" + ex.Message);
|
||
}
|
||
}
|
||
|
||
public override void Stop()
|
||
{
|
||
try
|
||
{
|
||
TimerTask.Close<MonitorThread>();
|
||
if (mainForm != null)
|
||
{
|
||
mainForm.CloseForm();
|
||
mainForm = null;
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
this.OnLog(ex.Message);
|
||
}
|
||
}
|
||
|
||
}
|
||
}
|