79 lines
2.2 KiB
C#
79 lines
2.2 KiB
C#
|
||
using Api.Framework;
|
||
using Api.Framework.SDK;
|
||
using PDDGroupAD.Properties;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.Linq;
|
||
using System.Text;
|
||
using System.Threading.Tasks;
|
||
|
||
namespace PDDGroupAD
|
||
{
|
||
public class Class1 : Plugin
|
||
{
|
||
public Class1()
|
||
{
|
||
this.Logo = Resources.拼多多发单;
|
||
this.Name = Resources.PluginName;
|
||
this.Note = Resources.PluginNote;
|
||
}
|
||
|
||
#region 自定义变量
|
||
public static Config Config;
|
||
private MainForm mainForm = null;
|
||
#endregion
|
||
|
||
/// <summary>
|
||
/// 重写显示设置窗口
|
||
/// </summary>
|
||
public override void ShowForm()
|
||
{
|
||
//创建窗体并打开
|
||
if (mainForm == null || mainForm.IsDisposed)
|
||
{
|
||
mainForm = new MainForm();
|
||
mainForm.Show();
|
||
}
|
||
mainForm.TopMost = true;
|
||
mainForm.TopMost = false;
|
||
}
|
||
|
||
public override void Start()
|
||
{
|
||
var session = ApiClient.GetSession();
|
||
#region 判断表是否存在,不存在创建表
|
||
//if (!session.TableExist<fl_plugin_pddcirclefriends_goodinfos>()) session.CreateTable<fl_plugin_pddcirclefriends_goodinfos>();
|
||
//if (!session.TableExist<fl_plugin_pddcirclefriends_pddtgw>())
|
||
//{
|
||
// session.CreateTable<fl_plugin_pddcirclefriends_pddtgw>();
|
||
// session.AddIndex<fl_plugin_pddcirclefriends_pddtgw>("robot_id");
|
||
//}
|
||
#endregion
|
||
|
||
//创建配置文件
|
||
Config = this.ReadConfig<Config>();
|
||
//TimerTask.NewTimer<SendCircleFriendThread>(60); //创建线程 - 发送群的线程 60秒
|
||
}
|
||
|
||
public override void Stop()
|
||
{
|
||
try
|
||
{
|
||
//TimerTask.Close<SendCircleFriendThread>(); //关闭线程
|
||
//关闭窗体
|
||
if (mainForm != null)
|
||
{
|
||
mainForm.CloseForm();
|
||
mainForm = null;
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
this.OnLog(ex.Message);
|
||
}
|
||
}
|
||
|
||
}
|
||
}
|