### DyLine V2.0.2509.1101 - *.[改进]消息发送机制采用Unicode。 ### VSoft V2.0.2509.1101 - *.[新增]支持对启动软件设置是否开机启动。 - *.[改进]防止快速点击分类时激活拖放功能。 - *.[改进]主窗体软件版本号改为默认从VSoft.dll获取。 - *.[改进]针对调用流程软件的功能,直接通过主程序实现,提升打开速度。 - *.[修复]修复添加内置功能后不能直接打开,需要二次启动后才能打开的BUG。 - *.[修复]修复拖放文件到列表,图标可能无法正常显示的BUG。 - *.[修复]修复从桌面拖放到列表,图标无法马上显示的BUG。 - *.[修复]修改软件后缓存图标不会更新的BUG。
89 lines
3.1 KiB
C#
89 lines
3.1 KiB
C#
using ryCommon;
|
|
using ryCommonDb;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
using VSoft.Prams;
|
|
using VSoft.Skins;
|
|
|
|
namespace VSoft
|
|
{
|
|
public partial class FrmWinStartView : SKinForm
|
|
{
|
|
public FrmWinStartView()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
private void LoadDb()
|
|
{
|
|
IconViewEx1.Items.Clear();
|
|
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
|
|
if (db.ConnDb(Itrycn_Db.SQLConnStr) == 1)
|
|
{
|
|
var sql = "select * from Softs where WinStartRun=1";
|
|
DataSet ds = db.ReadData(sql + " order by sortindex asc,AddTime desc");
|
|
IconViewEx1.BeginUpdate();
|
|
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
|
|
{
|
|
DataRow row = ds.Tables[0].Rows[i];
|
|
SoftInfo info = new SoftInfo
|
|
{
|
|
Id = row["id"].ToInt(),
|
|
SoftType = row["SoftType"].ToInt(),
|
|
ColumnId = row["ColumnId"].ToInt(),
|
|
Name = row["Name"].ToString(),
|
|
Path = row["Path"].ToString(),
|
|
RunPram = row["RunPram"].ToString(),
|
|
SetJson = row["SetJson"].ToString(),
|
|
StartPath = row["StartPath"].ToString(),
|
|
WinStartRun = row["WinStartRun"].ToInt() == 1,
|
|
IconPath = row["IconPath"].ToString()
|
|
};
|
|
string img_path;
|
|
if (info.IconPath.Length == 0)
|
|
{
|
|
img_path = info.TruePath;
|
|
}
|
|
else
|
|
{
|
|
img_path = RyFiles.GetRealPath(info.IconPath);
|
|
}
|
|
info.Image = API.GetImg(img_path, 128);
|
|
Application.DoEvents();
|
|
IconViewEx1.Items.Add(info.Name).Tag = info;
|
|
}
|
|
IconViewEx1.EndUpdate();
|
|
db.Free();
|
|
}
|
|
db.Free();
|
|
}
|
|
private void FrmWinStartView_Load(object sender, EventArgs e)
|
|
{
|
|
LoadDb();
|
|
}
|
|
/// <summary>
|
|
/// 移除开机启动的ID列表
|
|
/// </summary>
|
|
public List<int> RemovesList = new List<int>();
|
|
private void 移除开机启动ToolStripMenuItem_Click(object sender, EventArgs e)
|
|
{
|
|
if (IconViewEx1.SelectedItems.Count == 0) { return; }
|
|
var info = (SoftInfo)IconViewEx1.SelectedItems[0].Tag;
|
|
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
|
|
if (db.ConnDb(Itrycn_Db.SQLConnStr) == 1)
|
|
{
|
|
db.ExecuteNonQuery("update Softs set WinStartRun=0 where id=" + info.Id);
|
|
RemovesList.Add(info.Id);
|
|
IconViewEx1.SelectedItems[0].Remove();
|
|
}
|
|
db.Free();
|
|
}
|
|
}
|
|
}
|