### 2024-12-10更新

------
#### VSoft    V2.0.2412.1001
- *.[新增]拖放文件到主界面,支持直接插入到拖放的位置。
- *.[新增]新增支持设置运行次数的功能,可以快速进行多开。
- *.[新增]支持保存大小和选中的栏目和分类位置。
- *.[改进]切换栏目会记录列表滚动条位置和选中的分类。
- *.[改进]编辑添加的内置功能,将不允许修改路径。
- *.[改进]读取快捷方式时,支持自动获取图标信息。
- *.[改进]新增软件完成后,不再刷新列表,而是直接添加到列表末尾。
- *.[改进]新增软件或拖放软件后,界面直接定位到添加的列表位置。
- *.[改进]点击显示主界面时,如果存在模式窗体,则将模式窗体显示在前面。
- *.[改进]当百度翻译出错时自动重试翻译。
- *.[修复]栏目和分类进行拖放操作时,拖放出控件会残留拖放标志的BUG。
This commit is contained in:
紫林软件 2024-12-10 16:55:25 +08:00
parent 6380c8b609
commit 6f72e8e105
93 changed files with 86154 additions and 403 deletions

Binary file not shown.

72230
Bin/Debug/VSoft/RaUI.xml Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -1,7 +1,9 @@
[VSoft] [VSoft]
hwnd=25831240 hwnd=7350280
width=745 width=802
height=543 height=626
ColumnId=1
TypeId=2
[VSoft_Test] [VSoft_Test]
hwnd=657946 hwnd=657946
width=733 width=733

Binary file not shown.

Binary file not shown.

View File

@ -1,4 +1,22 @@
### 2023-12-04更新 ### 2024-12-10更新
------
#### VSoft V2.0.2412.1001
- *.[新增]拖放文件到主界面,支持直接插入到拖放的位置。
- *.[新增]新增支持设置运行次数的功能,可以快速进行多开。
- *.[新增]支持保存大小和选中的栏目和分类位置。
- *.[改进]切换栏目会记录列表滚动条位置和选中的分类。
- *.[改进]编辑添加的内置功能,将不允许修改路径。
- *.[改进]读取快捷方式时,支持自动获取图标信息。
- *.[改进]新增软件完成后,不再刷新列表,而是直接添加到列表末尾。
- *.[改进]新增软件或拖放软件后,界面直接定位到添加的列表位置。
- *.[改进]点击显示主界面时,如果存在模式窗体,则将模式窗体显示在前面。
- *.[改进]当百度翻译出错时自动重试翻译。
- *.[修复]栏目和分类进行拖放操作时,拖放出控件会残留拖放标志的BUG。
### 2023-12-04更新
------ ------

View File

@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("VSoftBox")] [assembly: AssemblyProduct("VSoftBox")]
[assembly: AssemblyCopyright("Copyright © 2020")] [assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示: //通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.2312.0401")] [assembly: AssemblyVersion("2.0.2412.1001")]
[assembly: AssemblyFileVersion("1.0.2312.0401")] [assembly: AssemblyFileVersion("2.0.2412.1001")]

File diff suppressed because one or more lines are too long

View File

@ -36,6 +36,7 @@
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.of_File = new System.Windows.Forms.OpenFileDialog(); this.of_File = new System.Windows.Forms.OpenFileDialog();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.NumRunCount = new System.Windows.Forms.NumericUpDown();
this.TxtCmdId = new ryControls.TextBoxEx2(); this.TxtCmdId = new ryControls.TextBoxEx2();
this.label6 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label();
this.LblCustomImg = new System.Windows.Forms.Label(); this.LblCustomImg = new System.Windows.Forms.Label();
@ -43,6 +44,9 @@
this.label4 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label();
this.chromeTabControl1 = new ryControls.ChromeTabControl(); this.chromeTabControl1 = new ryControls.ChromeTabControl();
this.tabPage1 = new System.Windows.Forms.TabPage(); this.tabPage1 = new System.Windows.Forms.TabPage();
this.label9 = new System.Windows.Forms.Label();
this.CbbRunMode = new System.Windows.Forms.ComboBox();
this.label8 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label();
this.hotkeyTextBox1 = new ryControls.HotkeyTextBox(); this.hotkeyTextBox1 = new ryControls.HotkeyTextBox();
this.ChkRunAsAdmin = new System.Windows.Forms.CheckBox(); this.ChkRunAsAdmin = new System.Windows.Forms.CheckBox();
@ -59,6 +63,7 @@
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.TxtName = new ryControls.TextBoxEx2(); this.TxtName = new ryControls.TextBoxEx2();
this.contextMenuStrip1.SuspendLayout(); this.contextMenuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.NumRunCount)).BeginInit();
this.chromeTabControl1.SuspendLayout(); this.chromeTabControl1.SuspendLayout();
this.tabPage1.SuspendLayout(); this.tabPage1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.PicImg)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.PicImg)).BeginInit();
@ -94,12 +99,39 @@
// //
this.of_File.Filter = "所有文件|*.*"; this.of_File.Filter = "所有文件|*.*";
// //
// NumRunCount
//
this.NumRunCount.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.NumRunCount.Location = new System.Drawing.Point(258, 168);
this.NumRunCount.Maximum = new decimal(new int[] {
10,
0,
0,
0});
this.NumRunCount.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.NumRunCount.Name = "NumRunCount";
this.NumRunCount.Size = new System.Drawing.Size(74, 26);
this.NumRunCount.TabIndex = 15;
this.NumRunCount.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.toolTip1.SetToolTip(this.NumRunCount, "设置执行次数,可用于多开微信。\r\n本功能对翻译和清空回收站功能无效。");
this.NumRunCount.Value = new decimal(new int[] {
1,
0,
0,
0});
//
// TxtCmdId // TxtCmdId
// //
this.TxtCmdId.BackColor = System.Drawing.Color.White; this.TxtCmdId.BackColor = System.Drawing.Color.White;
this.TxtCmdId.EmptyText = "默认为空"; this.TxtCmdId.EmptyText = "默认为空";
this.TxtCmdId.Location = new System.Drawing.Point(310, 35); this.TxtCmdId.Location = new System.Drawing.Point(310, 35);
this.TxtCmdId.LongTime = 2000;
this.TxtCmdId.MaxLength = 999999999; this.TxtCmdId.MaxLength = 999999999;
this.TxtCmdId.MaxUndoRedoSteps = 50;
this.TxtCmdId.Multiline = false; this.TxtCmdId.Multiline = false;
this.TxtCmdId.Name = "TxtCmdId"; this.TxtCmdId.Name = "TxtCmdId";
this.TxtCmdId.OnlyNumeric = false; this.TxtCmdId.OnlyNumeric = false;
@ -143,8 +175,10 @@
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.TxtDes.BackColor = System.Drawing.Color.White; this.TxtDes.BackColor = System.Drawing.Color.White;
this.TxtDes.EmptyText = ""; this.TxtDes.EmptyText = "";
this.TxtDes.Location = new System.Drawing.Point(57, 65); this.TxtDes.Location = new System.Drawing.Point(57, 62);
this.TxtDes.LongTime = 2000;
this.TxtDes.MaxLength = 999999999; this.TxtDes.MaxLength = 999999999;
this.TxtDes.MaxUndoRedoSteps = 50;
this.TxtDes.Multiline = true; this.TxtDes.Multiline = true;
this.TxtDes.Name = "TxtDes"; this.TxtDes.Name = "TxtDes";
this.TxtDes.OnlyNumeric = false; this.TxtDes.OnlyNumeric = false;
@ -153,7 +187,7 @@
this.TxtDes.SelectedText = ""; this.TxtDes.SelectedText = "";
this.TxtDes.SelectionLength = 0; this.TxtDes.SelectionLength = 0;
this.TxtDes.SelectionStart = 0; this.TxtDes.SelectionStart = 0;
this.TxtDes.Size = new System.Drawing.Size(513, 80); this.TxtDes.Size = new System.Drawing.Size(513, 87);
this.TxtDes.TabIndex = 11; this.TxtDes.TabIndex = 11;
this.TxtDes.TextAlign = System.Windows.Forms.HorizontalAlignment.Left; this.TxtDes.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
this.TxtDes.ToolTip = ""; this.TxtDes.ToolTip = "";
@ -191,6 +225,10 @@
// //
// tabPage1 // tabPage1
// //
this.tabPage1.Controls.Add(this.NumRunCount);
this.tabPage1.Controls.Add(this.label9);
this.tabPage1.Controls.Add(this.CbbRunMode);
this.tabPage1.Controls.Add(this.label8);
this.tabPage1.Controls.Add(this.label7); this.tabPage1.Controls.Add(this.label7);
this.tabPage1.Controls.Add(this.hotkeyTextBox1); this.tabPage1.Controls.Add(this.hotkeyTextBox1);
this.tabPage1.Controls.Add(this.ChkRunAsAdmin); this.tabPage1.Controls.Add(this.ChkRunAsAdmin);
@ -209,6 +247,39 @@
this.tabPage1.Text = "运行"; this.tabPage1.Text = "运行";
this.tabPage1.UseVisualStyleBackColor = true; this.tabPage1.UseVisualStyleBackColor = true;
// //
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(258, 153);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(53, 12);
this.label9.TabIndex = 14;
this.label9.Text = "执行次数";
//
// CbbRunMode
//
this.CbbRunMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CbbRunMode.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.CbbRunMode.FormattingEnabled = true;
this.CbbRunMode.Items.AddRange(new object[] {
"普通模式",
"隐藏",
"最小化",
"最大化"});
this.CbbRunMode.Location = new System.Drawing.Point(506, 23);
this.CbbRunMode.Name = "CbbRunMode";
this.CbbRunMode.Size = new System.Drawing.Size(124, 22);
this.CbbRunMode.TabIndex = 13;
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(504, 8);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(53, 12);
this.label8.TabIndex = 12;
this.label8.Text = "运行方式";
//
// label7 // label7
// //
this.label7.AutoSize = true; this.label7.AutoSize = true;
@ -255,8 +326,10 @@
// //
this.TxtStartPath.BackColor = System.Drawing.Color.White; this.TxtStartPath.BackColor = System.Drawing.Color.White;
this.TxtStartPath.EmptyText = "留空则表示使用默认设置"; this.TxtStartPath.EmptyText = "留空则表示使用默认设置";
this.TxtStartPath.Location = new System.Drawing.Point(8, 103); this.TxtStartPath.Location = new System.Drawing.Point(6, 103);
this.TxtStartPath.LongTime = 2000;
this.TxtStartPath.MaxLength = 999999999; this.TxtStartPath.MaxLength = 999999999;
this.TxtStartPath.MaxUndoRedoSteps = 50;
this.TxtStartPath.Multiline = false; this.TxtStartPath.Multiline = false;
this.TxtStartPath.Name = "TxtStartPath"; this.TxtStartPath.Name = "TxtStartPath";
this.TxtStartPath.OnlyNumeric = false; this.TxtStartPath.OnlyNumeric = false;
@ -265,7 +338,7 @@
this.TxtStartPath.SelectedText = ""; this.TxtStartPath.SelectedText = "";
this.TxtStartPath.SelectionLength = 0; this.TxtStartPath.SelectionLength = 0;
this.TxtStartPath.SelectionStart = 0; this.TxtStartPath.SelectionStart = 0;
this.TxtStartPath.Size = new System.Drawing.Size(449, 22); this.TxtStartPath.Size = new System.Drawing.Size(451, 22);
this.TxtStartPath.TabIndex = 7; this.TxtStartPath.TabIndex = 7;
this.TxtStartPath.TextAlign = System.Windows.Forms.HorizontalAlignment.Left; this.TxtStartPath.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
this.TxtStartPath.ToolTip = ""; this.TxtStartPath.ToolTip = "";
@ -285,7 +358,9 @@
this.TxtPath.BackColor = System.Drawing.Color.White; this.TxtPath.BackColor = System.Drawing.Color.White;
this.TxtPath.EmptyText = ""; this.TxtPath.EmptyText = "";
this.TxtPath.Location = new System.Drawing.Point(6, 23); this.TxtPath.Location = new System.Drawing.Point(6, 23);
this.TxtPath.LongTime = 2000;
this.TxtPath.MaxLength = 999999999; this.TxtPath.MaxLength = 999999999;
this.TxtPath.MaxUndoRedoSteps = 50;
this.TxtPath.Multiline = false; this.TxtPath.Multiline = false;
this.TxtPath.Name = "TxtPath"; this.TxtPath.Name = "TxtPath";
this.TxtPath.OnlyNumeric = false; this.TxtPath.OnlyNumeric = false;
@ -324,7 +399,9 @@
this.TxtRunPram.BackColor = System.Drawing.Color.White; this.TxtRunPram.BackColor = System.Drawing.Color.White;
this.TxtRunPram.EmptyText = ""; this.TxtRunPram.EmptyText = "";
this.TxtRunPram.Location = new System.Drawing.Point(6, 63); this.TxtRunPram.Location = new System.Drawing.Point(6, 63);
this.TxtRunPram.LongTime = 2000;
this.TxtRunPram.MaxLength = 999999999; this.TxtRunPram.MaxLength = 999999999;
this.TxtRunPram.MaxUndoRedoSteps = 50;
this.TxtRunPram.Multiline = false; this.TxtRunPram.Multiline = false;
this.TxtRunPram.Name = "TxtRunPram"; this.TxtRunPram.Name = "TxtRunPram";
this.TxtRunPram.OnlyNumeric = false; this.TxtRunPram.OnlyNumeric = false;
@ -393,7 +470,9 @@
this.TxtName.BackColor = System.Drawing.Color.White; this.TxtName.BackColor = System.Drawing.Color.White;
this.TxtName.EmptyText = ""; this.TxtName.EmptyText = "";
this.TxtName.Location = new System.Drawing.Point(57, 35); this.TxtName.Location = new System.Drawing.Point(57, 35);
this.TxtName.LongTime = 2000;
this.TxtName.MaxLength = 999999999; this.TxtName.MaxLength = 999999999;
this.TxtName.MaxUndoRedoSteps = 50;
this.TxtName.Multiline = false; this.TxtName.Multiline = false;
this.TxtName.Name = "TxtName"; this.TxtName.Name = "TxtName";
this.TxtName.OnlyNumeric = false; this.TxtName.OnlyNumeric = false;
@ -431,6 +510,7 @@
this.Text = "添加软件"; this.Text = "添加软件";
this.Load += new System.EventHandler(this.FrmAddSoft_Load); this.Load += new System.EventHandler(this.FrmAddSoft_Load);
this.contextMenuStrip1.ResumeLayout(false); this.contextMenuStrip1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.NumRunCount)).EndInit();
this.chromeTabControl1.ResumeLayout(false); this.chromeTabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false); this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout(); this.tabPage1.PerformLayout();
@ -470,5 +550,9 @@
private System.Windows.Forms.ToolTip toolTip1; private System.Windows.Forms.ToolTip toolTip1;
private System.Windows.Forms.Label label7; private System.Windows.Forms.Label label7;
public ryControls.HotkeyTextBox hotkeyTextBox1; public ryControls.HotkeyTextBox hotkeyTextBox1;
private System.Windows.Forms.ComboBox CbbRunMode;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.NumericUpDown NumRunCount;
private System.Windows.Forms.Label label9;
} }
} }

View File

@ -1,144 +1,161 @@
using ryCommon; using ryCommon;
using ryCommonDb; using ryCommonDb;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Data; using System.Data;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using VSoft.Prams; using VSoft.Prams;
using VSoft.Skins; using VSoft.Skins;
namespace VSoft namespace VSoft
{ {
public partial class FrmAddSoft : SKinForm public partial class FrmAddSoft : SKinForm
{ {
public string SQLConnStr { get; set; } = Itrycn_Db.SQLConnStr; public string SQLConnStr { get; set; } = Itrycn_Db.SQLConnStr;
public FrmAddSoft() public FrmAddSoft()
{ {
InitializeComponent(); InitializeComponent();
LblCustomImg.Text = "自动获取"; LblCustomImg.Text = "自动获取";
} CbbRunMode.SelectedIndex = 0;
public string tableName = "Softs"; }
private string IconPath { get; set; } = ""; public string tableName = "Softs";
public int IsAdd { get; set; } = 1; private string IconPath { get; set; } = "";
public int SelectId { get; set; } = -1; public int IsAdd { get; set; } = 1;
public int ColumnId { get; set; } = -1; public int SelectId { get; set; } = -1;
public FrmAddSoft(string path) public int ColumnId { get; set; } = -1;
{ public FrmAddSoft(string path)
InitializeComponent(); {
if (System.IO.Path.GetExtension(path).ToLower() == ".lnk") InitializeComponent();
{ if (System.IO.Path.GetExtension(path).ToLower() == ".lnk")
var shortcut = API.ReadShortcut(path); {
TxtPath.Text = shortcut.TargetPath; var shortcut = API.ReadShortcut(path);
TxtRunPram.Text = shortcut.Arguments; TxtPath.Text = shortcut.TargetPath;
TxtStartPath.Text = shortcut.WorkDir; TxtRunPram.Text = shortcut.Arguments;
TxtDes.Text = shortcut.Description; TxtStartPath.Text = shortcut.WorkDir;
//ShellLink cc = new ShellLink(path); TxtDes.Text = shortcut.Description;
//PicImg.Image = cc.LargeIcon.ToBitmap(); //ShellLink cc = new ShellLink(path);
} //PicImg.Image = cc.LargeIcon.ToBitmap();
else }
{ else
TxtPath.Text =RyFiles.GetRelativePath(path); {
} TxtPath.Text =RyFiles.GetRelativePath(path);
TxtName.Text = System.IO.Path.GetFileNameWithoutExtension(path); }
} TxtName.Text = System.IO.Path.GetFileNameWithoutExtension(path);
private string orgion_IconPath = ""; }
public void GetInfo(int id) private int SoftType { get; set; } = -1;
{ private string SoftPath { get; set; } ="";
SelectId = id; private string orgion_IconPath = "";
Text = "修改软件"; public void GetInfo(int id)
DataProvider mydb = new DataProvider(); {
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType); SelectId = id;
if (db.ConnDb(SQLConnStr) == 1) Text = "修改软件";
{ DataProvider mydb = new DataProvider();
DataSet ds = db.ReadData(tableName, id.ToString()); IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (mydb.HaveData(ds)) if (db.ConnDb(SQLConnStr) == 1)
{ {
DataRow reader = ds.Tables[0].Rows[0]; DataSet ds = db.ReadData(tableName, id.ToString());
#region if (mydb.HaveData(ds))
TxtName.Text = reader["Name"].ToString(); {
TxtCmdId.Text = reader["CmdId"].ToString(); DataRow reader = ds.Tables[0].Rows[0];
TxtDes.Text = reader["Des"].ToString(); #region
TxtPath.Text = reader["Path"].ToString(); TxtName.Text = reader["Name"].ToString();
TxtRunPram.Text = reader["RunPram"].ToString(); TxtCmdId.Text = reader["CmdId"].ToString();
TxtStartPath.Text = reader["StartPath"].ToString(); TxtDes.Text = reader["Des"].ToString();
hotkeyTextBox1.HotKey = reader["Hotkey"].ToString(); SoftPath = reader["Path"].ToString();
Json json = new Json(reader["SetJson"].ToString()); SoftType = reader["SoftType"].ToInt();
ChkRunAsAdmin.Checked = json.GetJsonValue("RunAsAdmin", false); if (SoftType == 1)//内置软件
var _IconPath = reader["IconPath"].ToString(); {
orgion_IconPath = _IconPath; TxtPath.ReadOnly = true;
IconPath = _IconPath; TxtPath.Text = "内置启动程序";
if (_IconPath.Length==0) TxtPath.ForeColor = Color.Blue;
{ TxtPath.Font = new Font(TxtPath.Font, FontStyle.Bold);
_IconPath = reader["Path"].ToString(); }
} else
else {
{ TxtPath.Text = SoftPath;
LblCustomImg.Text = "自定义"; }
} TxtRunPram.Text = reader["RunPram"].ToString();
PicImg.Image = API.GetImg(RyFiles.GetRealPath(_IconPath)); TxtStartPath.Text = reader["StartPath"].ToString();
#endregion hotkeyTextBox1.HotKey = reader["Hotkey"].ToString();
} Json json = new Json(reader["SetJson"].ToString());
} ChkRunAsAdmin.Checked = json.GetJsonValue("RunAsAdmin", false);
db.Free(); CbbRunMode.SelectedIndex = json.GetJsonValue("RunMode", 0);
} NumRunCount.Value = json.GetJsonValue("RunCount", 1, NumRunCount.Maximum.ToInt(), 1);
var _IconPath = reader["IconPath"].ToString();
orgion_IconPath = _IconPath;
IconPath = _IconPath;
if (_IconPath.Length==0)
{
_IconPath = reader["Path"].ToString();
}
else
{
LblCustomImg.Text = "自定义";
}
PicImg.Image = API.GetImg(RyFiles.GetRealPath(_IconPath));
#endregion
}
}
db.Free();
}
/// <summary> /// <summary>
/// 当前操作的id /// 当前操作的id
/// </summary> /// </summary>
public int Op_Id { get; set; } = -1; public int Op_Id { get; set; } = -1;
private void BtnOK_Click(object sender, EventArgs e) private void BtnOK_Click(object sender, EventArgs e)
{ {
if (TxtName.Text.Length == 0) if (TxtName.Text.Length == 0)
{ {
Msg.ShowMsg("名称不能为空。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); Msg.ShowMsg("名称不能为空。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return; return;
} }
if (TxtCmdId.Text.Length> 0 && !TxtCmdId.Text.Replace("_","").IsEngOrNum()) if (TxtCmdId.Text.Length> 0 && !TxtCmdId.Text.Replace("_","").IsEngOrNum())
{ {
Msg.ShowMsg("命令ID只支持英文和数字字符。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); Msg.ShowMsg("命令ID只支持英文和数字字符。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return; return;
} }
if (IconPath.Length>0 && IconPath.IndexOfEx("<app>")!=0 && IconPath!=TxtPath.Text) if (IconPath.Length>0 && IconPath.IndexOfEx("<app>")!=0 && IconPath!=TxtPath.Text)
{ {
var _IconPath=RyFiles.AddFileToFolder(RyFiles.GetRealPath(IconPath), Config.Soft_Info.UserDataFolder + "\\SoftLogos", true, out var result); var _IconPath=RyFiles.AddFileToFolder(RyFiles.GetRealPath(IconPath), Config.Soft_Info.UserDataFolder + "\\SoftLogos", true, out var result);
if(result) if(result)
{ {
IconPath = RyFiles.GetRelativePath(_IconPath); IconPath = RyFiles.GetRelativePath(_IconPath);
} }
} }
if (IconPath != orgion_IconPath) if (IconPath != orgion_IconPath)
{ {
if (orgion_IconPath.Length > 0 && orgion_IconPath.StartsWith("<app>\\UserDb\\SoftLogos", StringComparison.OrdinalIgnoreCase)) if (orgion_IconPath.Length > 0 && orgion_IconPath.StartsWith("<app>\\UserDb\\SoftLogos", StringComparison.OrdinalIgnoreCase))
{ {
RyFiles.DeleteFile(RyFiles.GetRealPath(orgion_IconPath)); RyFiles.DeleteFile(RyFiles.GetRealPath(orgion_IconPath));
} }
} }
DataProvider mydb = new DataProvider(); DataProvider mydb = new DataProvider();
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType); IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(SQLConnStr) == 1) if (db.ConnDb(SQLConnStr) == 1)
{ {
if (TxtCmdId.Text.Length > 0) if (TxtCmdId.Text.Length > 0)
{ {
var ds = db.ReadData("select * from " + tableName + " where CmdId='" + TxtCmdId.Text + "' and id<>" + SelectId + " limit 1"); var ds = db.ReadData("select * from " + tableName + " where CmdId='" + TxtCmdId.Text + "' and id<>" + SelectId + " limit 1");
if (mydb.HaveData(ds)) if (mydb.HaveData(ds))
{ {
Msg.ShowMsg("当前命令ID已经存在,请更换命令ID。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); Msg.ShowMsg("当前命令ID已经存在,请更换命令ID。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
ds.Dispose(); return; ds.Dispose(); return;
} }
ds.Dispose(); ds.Dispose();
} }
if (hotkeyTextBox1.HaveHotKey) if (hotkeyTextBox1.HaveHotKey)
{ {
var ds_soft = db.ReadData("select * from " + tableName + " where Hotkey='" + hotkeyTextBox1.HotKey + "' and id<>" + SelectId + " limit 1"); var ds_soft = db.ReadData("select * from " + tableName + " where Hotkey='" + hotkeyTextBox1.HotKey + "' and id<>" + SelectId + " limit 1");
var ds_type = db.ReadData("select * from Columns where Hotkey='" + hotkeyTextBox1.HotKey + "' limit 1"); var ds_type = db.ReadData("select * from Columns where Hotkey='" + hotkeyTextBox1.HotKey + "' limit 1");
if (mydb.HaveData(ds_soft) || ds_type.HaveData()) if (mydb.HaveData(ds_soft) || ds_type.HaveData())
{ {
Msg.ShowMsg("当前热键已经存在,请更换热键。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); Msg.ShowMsg("当前热键已经存在,请更换热键。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
ds_soft.Dispose(); ds_type.Dispose(); return; ds_soft.Dispose(); ds_type.Dispose(); return;
} }
else else
{ {
if(Config.Soft_Config.IsHotKeyExistInList(hotkeyTextBox1.HotKey)>=0) if(Config.Soft_Config.IsHotKeyExistInList(hotkeyTextBox1.HotKey)>=0)
@ -146,105 +163,110 @@ namespace VSoft
Msg.ShowMsg("当前热键已经存在,请更换热键。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); Msg.ShowMsg("当前热键已经存在,请更换热键。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
ds_soft.Dispose(); ds_type.Dispose(); return; ds_soft.Dispose(); ds_type.Dispose(); return;
} }
} }
ds_soft.Dispose(); ds_soft.Dispose();
ds_type.Dispose(); ds_type.Dispose();
} }
RyQuickSQL mySQL = new RyQuickSQL(tableName); RyQuickSQL mySQL = new RyQuickSQL(tableName);
mySQL.AddField("Name", TxtName.Text); mySQL.AddField("Name", TxtName.Text);
mySQL.AddField("CmdId", TxtCmdId.Text); mySQL.AddField("CmdId", TxtCmdId.Text);
mySQL.AddField("Path", TxtPath.Text); if (SoftType == 0 || IsAdd>0)//不是内置软件
mySQL.AddField("RunPram", TxtRunPram.Text); {
mySQL.AddField("StartPath", TxtStartPath.Text);//起始路径 mySQL.AddField("Path", TxtPath.Text);
mySQL.AddField("IconPath", IconPath);//图标路径 }
Json json = new Json(""); mySQL.AddField("RunPram", TxtRunPram.Text);
json.Add("RunAsAdmin", ChkRunAsAdmin.Checked); mySQL.AddField("StartPath", TxtStartPath.Text);//起始路径
mySQL.AddField("SetJson", json.Text);//设置 mySQL.AddField("IconPath", IconPath);//图标路径
Json json = new Json("");
json.Add("RunAsAdmin", ChkRunAsAdmin.Checked);
json.Add("RunMode", CbbRunMode.SelectedIndex);
json.Add("RunCount", NumRunCount.Value.ToInt());
mySQL.AddField("SetJson", json.Text);//设置
mySQL.AddField("Des", TxtDes.Text);//备注 mySQL.AddField("Des", TxtDes.Text);//备注
mySQL.AddField("Hotkey", hotkeyTextBox1.HaveHotKey?hotkeyTextBox1.HotKey:"");//快捷键 mySQL.AddField("Hotkey", hotkeyTextBox1.HaveHotKey?hotkeyTextBox1.HotKey:"");//快捷键
mySQL.AddField("Pinyin", ryCommon.PinYin.Convert(TxtName.Text) + "\r\n" + ryCommon.PinYin.ConvertFirstPY(TxtName.Text)); mySQL.AddField("Pinyin", ryCommon.PinYin.Convert(TxtName.Text) + "\r\n" + ryCommon.PinYin.ConvertFirstPY(TxtName.Text));
mySQL.AddField("editTime", DateTime.Now); mySQL.AddField("editTime", DateTime.Now);
if (IsAdd >= 1) if (IsAdd >= 1)
{ {
mySQL.AddField("SoftType", 0);//0表示运行文件,1表示执行快速命令,2表示执行脚本 mySQL.AddField("SoftType", 0);//0表示运行文件,1表示执行快速命令,2表示执行脚本
mySQL.AddField("ClickCount", 0);//点击量 mySQL.AddField("ClickCount", 0);//点击量
mySQL.AddField("ColumnId",ColumnId); mySQL.AddField("ColumnId",ColumnId);
mySQL.AddField("sortindex",Itrycn_Db.GetSoftCount(db, ColumnId) + 1); mySQL.AddField("sortindex",Itrycn_Db.GetSoftCount(db, ColumnId) + 1);
mySQL.AddField("addTime", DateTime.Now); mySQL.AddField("addTime", DateTime.Now);
var ds= db.ReadData(mySQL.GetInsertSQL()+";select last_insert_rowid();", mySQL); var ds= db.ReadData(mySQL.GetInsertSQL()+";select last_insert_rowid();", mySQL);
if (ds.HaveData()) if (ds.HaveData())
{ {
Op_Id = ds.GetFirstRowCellValue(); Op_Id = ds.GetFirstRowCellValue();
} }
ds.Dispose(); ds.Dispose();
} }
else else
{ {
db.ExecuteNonQuery(mySQL.GetUpdateSQL() + " where id=" + SelectId, mySQL); db.ExecuteNonQuery(mySQL.GetUpdateSQL() + " where id=" + SelectId, mySQL);
Op_Id = SelectId; Op_Id = SelectId;
} }
} }
db.Free(); db.Free();
DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
} }
private void TxtPath_TextChanged2(object sender, EventArgs e) private void TxtPath_TextChanged2(object sender, EventArgs e)
{ {
if (IconPath.Length > 0) if (IconPath.Length > 0)
{ return; } { return; }
var path =RyFiles.GetRealPath(TxtPath.Text); var path =RyFiles.GetRealPath(TxtPath.Text);
if(System.IO.File.Exists(path)) if(System.IO.File.Exists(path))
{ {
PicImg.Image = API.GetImg(path,128); PicImg.Image = API.GetImg(path,128);
} }
else if (System.IO.Directory.Exists(path)) else if (System.IO.Directory.Exists(path))
{ {
PicImg.Image = API.GetImg(path,64); PicImg.Image = API.GetImg(path,64);
} }
else else
{ {
PicImg.Image = null; PicImg.Image = null;
} }
} }
private void BtnCancel_Click(object sender, EventArgs e) private void BtnCancel_Click(object sender, EventArgs e)
{ {
DialogResult = DialogResult.Cancel; DialogResult = DialogResult.Cancel;
} }
private void PicImg_Click(object sender, EventArgs e) private void PicImg_Click(object sender, EventArgs e)
{ {
ToolStripMenuItem.PerformClick(); ToolStripMenuItem.PerformClick();
} }
private void FrmAddSoft_Load(object sender, EventArgs e) private void FrmAddSoft_Load(object sender, EventArgs e)
{ {
} }
private void BtnBrowser_Click(object sender, EventArgs e) private void BtnBrowser_Click(object sender, EventArgs e)
{ {
if (of_File.ShowDialog() == DialogResult.OK) if (of_File.ShowDialog() == DialogResult.OK)
{ {
TxtPath.Text = of_File.FileName; TxtPath.Text = of_File.FileName;
} }
} }
private void ToolStripMenuItem_Click(object sender, EventArgs e) private void ToolStripMenuItem_Click(object sender, EventArgs e)
{ {
if (openFileDialog1.ShowDialog() == DialogResult.OK) if (openFileDialog1.ShowDialog() == DialogResult.OK)
{ {
IconPath =RyFiles.GetRelativePath(openFileDialog1.FileName); IconPath =RyFiles.GetRelativePath(openFileDialog1.FileName);
PicImg.Image = API.GetImg(openFileDialog1.FileName); PicImg.Image = API.GetImg(openFileDialog1.FileName);
LblCustomImg.Text = "自定义"; LblCustomImg.Text = "自定义";
} }
} }
private void 使ToolStripMenuItem_Click(object sender, EventArgs e) private void 使ToolStripMenuItem_Click(object sender, EventArgs e)
{ {
IconPath = ""; IconPath = "";
PicImg.Image = API.GetImg(RyFiles.GetRealPath(TxtPath.Text)); PicImg.Image = API.GetImg(RyFiles.GetRealPath(TxtPath.Text));
LblCustomImg.Text = "自动获取"; LblCustomImg.Text = "自动获取";
} }
} }
} }

View File

@ -7,6 +7,7 @@ using System.Data;
using System.Drawing; using System.Drawing;
using System.Threading; using System.Threading;
using System.Windows.Forms; using System.Windows.Forms;
using VSoft.Config;
using VSoft.Prams; using VSoft.Prams;
namespace VSoft namespace VSoft
@ -22,7 +23,19 @@ namespace VSoft
public FrmInCMD() public FrmInCMD()
{ {
InitializeComponent(); InitializeComponent();
if(ReadOnly) #if DY
var sub_dir = @"\SysDb\Tools\VSoft";
var ProcessPath = Application.StartupPath;
if (Application.StartupPath.EndsWith(sub_dir, StringComparison.OrdinalIgnoreCase))
{
ProcessPath = Application.StartupPath.Substring(0, Application.StartupPath.Length - sub_dir.Length);
}
if (System.IO.File.Exists(ProcessPath + "\\管理员调试.set"))
{
ReadOnly = false;
}
#endif
if (ReadOnly)
{ {
IconViewEx1.ContextMenuStrip = null; IconViewEx1.ContextMenuStrip = null;
TabList_Column.ContextMenuStrip = null; TabList_Column.ContextMenuStrip = null;
@ -252,7 +265,7 @@ namespace VSoft
FrmAddColumn frm = new FrmAddColumn(); FrmAddColumn frm = new FrmAddColumn();
frm.TopMost = TopMost; frm.TopMost = TopMost;
frm.SQLConnStr = SQLConnStr; frm.SQLConnStr = SQLConnStr;
if (frm.ShowDialog() == DialogResult.OK) if (frm.ShowDialog(this) == DialogResult.OK)
{ {
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType); IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(SQLConnStr) == 1) if (db.ConnDb(SQLConnStr) == 1)
@ -285,7 +298,7 @@ namespace VSoft
frm.SQLConnStr = SQLConnStr; frm.SQLConnStr = SQLConnStr;
frm.IsAdd = 0; frm.IsAdd = 0;
frm.GetInfo(info.Id); frm.GetInfo(info.Id);
if (frm.ShowDialog() == DialogResult.OK) if (frm.ShowDialog(this) == DialogResult.OK)
{ {
SetColumnRow(info.Id, TabList_Column.SelectedItems[0].Index); SetColumnRow(info.Id, TabList_Column.SelectedItems[0].Index);
} }
@ -378,7 +391,7 @@ namespace VSoft
SQLConnStr = SQLConnStr, SQLConnStr = SQLConnStr,
TopMost=TopMost TopMost=TopMost
}; };
if (frm.ShowDialog() == DialogResult.OK) if (frm.ShowDialog(this) == DialogResult.OK)
{ {
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType); IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(SQLConnStr) == 1) if (db.ConnDb(SQLConnStr) == 1)
@ -427,7 +440,7 @@ namespace VSoft
TopMost=TopMost TopMost=TopMost
}; };
frm.GetInfo(info.Id); frm.GetInfo(info.Id);
if (frm.ShowDialog() == DialogResult.OK) if (frm.ShowDialog(this) == DialogResult.OK)
{ {
SetTypeRow(info.Id, TabList_Type.SelectedItems[0].Index); SetTypeRow(info.Id, TabList_Type.SelectedItems[0].Index);
} }
@ -531,7 +544,7 @@ namespace VSoft
TopMost=TopMost TopMost=TopMost
}; };
frm.ShowInCenter(this); frm.ShowInCenter(this);
if (frm.ShowDialog() == DialogResult.OK) if (frm.ShowDialog(this) == DialogResult.OK)
{ {
LoadDb(); LoadDb();
} }
@ -550,7 +563,7 @@ namespace VSoft
}; };
frm.GetInfo(info.Id); frm.GetInfo(info.Id);
frm.ShowInCenter(this); frm.ShowInCenter(this);
if (frm.ShowDialog() == DialogResult.OK) if (frm.ShowDialog(this) == DialogResult.OK)
{ {
SetSoftRow(info.Id, IconViewEx1.SelectedItems[0].Index); SetSoftRow(info.Id, IconViewEx1.SelectedItems[0].Index);
} }
@ -724,7 +737,7 @@ namespace VSoft
ColumnId = ColumnId, ColumnId = ColumnId,
SQLConnStr = SQLConnStr SQLConnStr = SQLConnStr
}; };
if (frm.ShowDialog() == DialogResult.OK) if (frm.ShowDialog(this) == DialogResult.OK)
{ {
LoadDb(); LoadDb();
} }
@ -1134,7 +1147,7 @@ namespace VSoft
frm.GetInfo(info.Id); frm.GetInfo(info.Id);
frm.Text = "复制并新增软件"; frm.Text = "复制并新增软件";
frm.SelectId = -1; frm.SelectId = -1;
if (frm.ShowDialog() == DialogResult.OK) if (frm.ShowDialog(this) == DialogResult.OK)
{ {
LoadDb(); LoadDb();
} }

View File

@ -71,6 +71,8 @@
this.IconViewEx1 = new ryControls.IconViewEx(); this.IconViewEx1 = new ryControls.IconViewEx();
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.TabList_Column = new ryControls.TabList(); this.TabList_Column = new ryControls.TabList();
this.BtnLeftColumn = new ryControls.ButtonEx();
this.BtnRightColumn = new ryControls.ButtonEx();
this.MenuList.SuspendLayout(); this.MenuList.SuspendLayout();
this.MenuTabColumn.SuspendLayout(); this.MenuTabColumn.SuspendLayout();
this.MenuTabType.SuspendLayout(); this.MenuTabType.SuspendLayout();
@ -152,7 +154,7 @@
// //
this.BtnAddColumn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.BtnAddColumn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.BtnAddColumn.Image = ((System.Drawing.Image)(resources.GetObject("BtnAddColumn.Image"))); this.BtnAddColumn.Image = ((System.Drawing.Image)(resources.GetObject("BtnAddColumn.Image")));
this.BtnAddColumn.Location = new System.Drawing.Point(681, 36); this.BtnAddColumn.Location = new System.Drawing.Point(714, 36);
this.BtnAddColumn.Name = "BtnAddColumn"; this.BtnAddColumn.Name = "BtnAddColumn";
this.BtnAddColumn.Size = new System.Drawing.Size(27, 28); this.BtnAddColumn.Size = new System.Drawing.Size(27, 28);
this.BtnAddColumn.TabIndex = 3; this.BtnAddColumn.TabIndex = 3;
@ -340,6 +342,7 @@
this.TabList_Type.DragDrop += new System.Windows.Forms.DragEventHandler(this.TabList_Type_DragDrop); this.TabList_Type.DragDrop += new System.Windows.Forms.DragEventHandler(this.TabList_Type_DragDrop);
this.TabList_Type.DragEnter += new System.Windows.Forms.DragEventHandler(this.TabList_Type_DragEnter); this.TabList_Type.DragEnter += new System.Windows.Forms.DragEventHandler(this.TabList_Type_DragEnter);
this.TabList_Type.DragOver += new System.Windows.Forms.DragEventHandler(this.IconViewEx1_DragOver); this.TabList_Type.DragOver += new System.Windows.Forms.DragEventHandler(this.IconViewEx1_DragOver);
this.TabList_Type.DragLeave += new System.EventHandler(this.TabList_Type_DragLeave);
this.TabList_Type.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TabList_Type_KeyDown); this.TabList_Type.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TabList_Type_KeyDown);
// //
// columnHeader2 // columnHeader2
@ -354,9 +357,9 @@
this.rySearch1.ButtonRoundBackColor = System.Drawing.SystemColors.Control; this.rySearch1.ButtonRoundBackColor = System.Drawing.SystemColors.Control;
this.rySearch1.ColorGradient = true; this.rySearch1.ColorGradient = true;
this.rySearch1.EmptyText = "输入名称或拼音搜索"; this.rySearch1.EmptyText = "输入名称或拼音搜索";
this.rySearch1.Location = new System.Drawing.Point(533, 36); this.rySearch1.Location = new System.Drawing.Point(570, 36);
this.rySearch1.Name = "rySearch1"; this.rySearch1.Name = "rySearch1";
this.rySearch1.Size = new System.Drawing.Size(142, 27); this.rySearch1.Size = new System.Drawing.Size(138, 27);
this.rySearch1.TabIndex = 2; this.rySearch1.TabIndex = 2;
this.rySearch1.OnSearch += new System.EventHandler(this.RySearch1_OnSearch); this.rySearch1.OnSearch += new System.EventHandler(this.RySearch1_OnSearch);
this.rySearch1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.RySearch1_KeyDown); this.rySearch1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.RySearch1_KeyDown);
@ -426,6 +429,7 @@
this.IconViewEx1.DragDrop += new System.Windows.Forms.DragEventHandler(this.IconViewEx1_DragDrop); this.IconViewEx1.DragDrop += new System.Windows.Forms.DragEventHandler(this.IconViewEx1_DragDrop);
this.IconViewEx1.DragEnter += new System.Windows.Forms.DragEventHandler(this.IconViewEx1_DragEnter); this.IconViewEx1.DragEnter += new System.Windows.Forms.DragEventHandler(this.IconViewEx1_DragEnter);
this.IconViewEx1.DragOver += new System.Windows.Forms.DragEventHandler(this.IconViewEx1_DragOver); this.IconViewEx1.DragOver += new System.Windows.Forms.DragEventHandler(this.IconViewEx1_DragOver);
this.IconViewEx1.DragLeave += new System.EventHandler(this.IconViewEx1_DragLeave);
this.IconViewEx1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.IconViewEx1_KeyDown); this.IconViewEx1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.IconViewEx1_KeyDown);
this.IconViewEx1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.IconViewEx1_MouseClick); this.IconViewEx1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.IconViewEx1_MouseClick);
this.IconViewEx1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.IconViewEx1_MouseDoubleClick); this.IconViewEx1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.IconViewEx1_MouseDoubleClick);
@ -455,7 +459,7 @@
this.TabList_Column.SelectedEndBackColor = System.Drawing.Color.SkyBlue; this.TabList_Column.SelectedEndBackColor = System.Drawing.Color.SkyBlue;
this.TabList_Column.SelectedForeColor = System.Drawing.Color.Black; this.TabList_Column.SelectedForeColor = System.Drawing.Color.Black;
this.TabList_Column.SelectedStartBackColor = System.Drawing.Color.PowderBlue; this.TabList_Column.SelectedStartBackColor = System.Drawing.Color.PowderBlue;
this.TabList_Column.Size = new System.Drawing.Size(446, 29); this.TabList_Column.Size = new System.Drawing.Size(442, 29);
this.TabList_Column.TabIndex = 1; this.TabList_Column.TabIndex = 1;
this.TabList_Column.TileSize = new System.Drawing.Size(70, 30); this.TabList_Column.TileSize = new System.Drawing.Size(70, 30);
this.TabList_Column.UseCompatibleStateImageBehavior = false; this.TabList_Column.UseCompatibleStateImageBehavior = false;
@ -465,8 +469,35 @@
this.TabList_Column.DragDrop += new System.Windows.Forms.DragEventHandler(this.TabList_Column_DragDrop); this.TabList_Column.DragDrop += new System.Windows.Forms.DragEventHandler(this.TabList_Column_DragDrop);
this.TabList_Column.DragEnter += new System.Windows.Forms.DragEventHandler(this.TabList_Column_DragEnter); this.TabList_Column.DragEnter += new System.Windows.Forms.DragEventHandler(this.TabList_Column_DragEnter);
this.TabList_Column.DragOver += new System.Windows.Forms.DragEventHandler(this.IconViewEx1_DragOver); this.TabList_Column.DragOver += new System.Windows.Forms.DragEventHandler(this.IconViewEx1_DragOver);
this.TabList_Column.DragLeave += new System.EventHandler(this.TabList_Column_DragLeave);
this.TabList_Column.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TabList_Column_KeyDown); this.TabList_Column.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TabList_Column_KeyDown);
// //
// BtnLeftColumn
//
this.BtnLeftColumn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.BtnLeftColumn.BaseColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(150)))), ((int)(((byte)(20)))));
this.BtnLeftColumn.ColorGradient = true;
this.BtnLeftColumn.Location = new System.Drawing.Point(527, 37);
this.BtnLeftColumn.Name = "BtnLeftColumn";
this.BtnLeftColumn.Size = new System.Drawing.Size(20, 23);
this.BtnLeftColumn.TabIndex = 9;
this.BtnLeftColumn.Text = "←";
this.BtnLeftColumn.UseVisualStyleBackColor = true;
this.BtnLeftColumn.Click += new System.EventHandler(this.BtnLeftColumn_Click);
//
// BtnRightColumn
//
this.BtnRightColumn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.BtnRightColumn.BaseColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(150)))), ((int)(((byte)(20)))));
this.BtnRightColumn.ColorGradient = true;
this.BtnRightColumn.Location = new System.Drawing.Point(548, 37);
this.BtnRightColumn.Name = "BtnRightColumn";
this.BtnRightColumn.Size = new System.Drawing.Size(20, 23);
this.BtnRightColumn.TabIndex = 10;
this.BtnRightColumn.Text = "→";
this.BtnRightColumn.UseVisualStyleBackColor = true;
this.BtnRightColumn.Click += new System.EventHandler(this.BtnRightColumn_Click);
//
// FrmVSoft // FrmVSoft
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@ -476,6 +507,8 @@
this.CaptionHeight = 30; this.CaptionHeight = 30;
this.ClientSize = new System.Drawing.Size(745, 543); this.ClientSize = new System.Drawing.Size(745, 543);
this.ControlBoxOffset = new System.Drawing.Point(8, 8); this.ControlBoxOffset = new System.Drawing.Point(8, 8);
this.Controls.Add(this.BtnRightColumn);
this.Controls.Add(this.BtnLeftColumn);
this.Controls.Add(this.rySearch1); this.Controls.Add(this.rySearch1);
this.Controls.Add(this.PnlLeft); this.Controls.Add(this.PnlLeft);
this.Controls.Add(this.LblSetting); this.Controls.Add(this.LblSetting);
@ -667,5 +700,7 @@
private System.Windows.Forms.Label LblSetting; private System.Windows.Forms.Label LblSetting;
private System.Windows.Forms.Panel PnlLeft; private System.Windows.Forms.Panel PnlLeft;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem3; private System.Windows.Forms.ToolStripSeparator toolStripMenuItem3;
private ryControls.ButtonEx BtnLeftColumn;
private ryControls.ButtonEx BtnRightColumn;
} }
} }

View File

@ -1,4 +1,5 @@
using ryCommon; using Newtonsoft.Json.Linq;
using ryCommon;
using ryCommonDb; using ryCommonDb;
using ryControls; using ryControls;
using SysFuns; using SysFuns;
@ -6,17 +7,13 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Data; using System.Data;
using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading; using System.Threading;
using System.Windows.Forms; using System.Windows.Forms;
using VSoft.Config; using VSoft.Config;
using VSoft.Prams; using VSoft.Prams;
using VSoft.Skins; using VSoft.Skins;
using static System.Windows.Forms.VisualStyles.VisualStyleElement; using static System.Windows.Forms.VisualStyles.VisualStyleElement.Tab;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Header;
namespace VSoft namespace VSoft
{ {
@ -176,6 +173,21 @@ namespace VSoft
private void LoadColumn() private void LoadColumn()
{ {
TabList_Column.Items.Clear(); TabList_Column.Items.Clear();
try
{
JArray jarr = JArray.Parse(Itrycn_Db.GetSetting("SelectedCache", ""));
for (int i = 0; i < jarr.Count; i++)
{
var item = jarr[i];
dict_cache_type[item.GetJsonValue("ColumnId", -1)] = new SelectInfo()
{
SelectedTypeId = item.GetJsonValue("SelectedTypeId", -1),
IconVisibleIndex = item.GetJsonValue("IconVisibleIndex", -1),
IconSelectedIndex = item.GetJsonValue("IconSelectedIndex", -1),
};
}
}
catch { }
DataProvider mydb = new DataProvider(); DataProvider mydb = new DataProvider();
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType); IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(SQLConnStr) == 1) if (db.ConnDb(SQLConnStr) == 1)
@ -189,7 +201,7 @@ namespace VSoft
} }
if(ds.Tables[0].Rows.Count==0) if(ds.Tables[0].Rows.Count==0)
{ {
#region , #region ,
RyQuickSQL mySQL = new RyQuickSQL("Columns"); RyQuickSQL mySQL = new RyQuickSQL("Columns");
mySQL.AddField("Name", "默认栏目"); mySQL.AddField("Name", "默认栏目");
mySQL.AddField("editTime", DateTime.Now); mySQL.AddField("editTime", DateTime.Now);
@ -217,7 +229,7 @@ namespace VSoft
TabList_Column.Items.Add(row["Name"].ToString()).Tag = row["id"].ToInt(); TabList_Column.Items.Add(row["Name"].ToString()).Tag = row["id"].ToInt();
} }
ds2.Dispose(); ds2.Dispose();
#endregion #endregion
} }
ds.Dispose(); ds.Dispose();
TabList_Column.EndUpdate(); TabList_Column.EndUpdate();
@ -225,9 +237,31 @@ namespace VSoft
} }
if(TabList_Column.Items.Count>0) if(TabList_Column.Items.Count>0)
{ {
TabList_Column.Items[0].Selected = true; ryCommon.Ini ini = new ryCommon.Ini(Soft_Info.UserDataFolder + "\\Win.dat");
var ColumnId = ini.ReadIni(VSoft.Config.Soft_Info.Soft_Id, "ColumnId", -1);
var TypeId = ini.ReadIni(VSoft.Config.Soft_Info.Soft_Id, "TypeId", -1);
if (!dict_cache_type.ContainsKey(ColumnId))
{
dict_cache_type[ColumnId] = new SelectInfo()
{
SelectedTypeId = TypeId,
};
}
for (int i = 0; i < TabList_Column.Items.Count; i++)
{
if (TabList_Column.Items[i].Tag.ToInt() == ColumnId)
{
TabList_Column.Items[i].Selected = true;
break;
}
}
if (TabList_Column.SelectedItems.Count == 0)
{
TabList_Column.Items[0].Selected = true;
}
} }
} }
Dictionary<int,SelectInfo> dict_cache_type=new Dictionary<int, SelectInfo>();
private void LoadTypeColumn(int id) private void LoadTypeColumn(int id)
{ {
TabList_Type.Items.Clear(); TabList_Type.Items.Clear();
@ -248,7 +282,44 @@ namespace VSoft
} }
if (TabList_Type.Items.Count > 0) if (TabList_Type.Items.Count > 0)
{ {
TabList_Type.Items[0].Selected = true; if(dict_cache_type.ContainsKey(id))
{
var cache_selected=dict_cache_type[id];
if (cache_selected.SelectedTypeId> 0)
{
for (int i = 0; i < TabList_Type.Items.Count; i++)
{
if(TabList_Type.Items[i].Tag.ToInt()== cache_selected.SelectedTypeId)
{
TabList_Type.Items[i].Selected = true;
//IconViewEx1.EnsureVisible(cache_selected.IconVisibleIndex);
if (cache_selected.IconSelectedIndex.IsInRange(0, IconViewEx1.Items.Count - 1))
{
IconViewEx1.Items[cache_selected.IconSelectedIndex].Selected = true;
IconViewEx1.Items[cache_selected.IconSelectedIndex].EnsureVisible();
}
if (cache_selected.IconVisibleIndex.IsInRange(0, IconViewEx1.Items.Count - 1))
{
IconViewEx1.Items[cache_selected.IconVisibleIndex].EnsureVisible();
//IconViewEx1.TopItem = IconViewEx1.Items[cache_selected.IconVisibleIndex];
}
break;
}
}
if(TabList_Type.SelectedItems.Count==0)
{
TabList_Type.Items[0].Selected = true;
}
}
else
{
TabList_Type.Items[0].Selected = true;
}
}
else
{
TabList_Type.Items[0].Selected = true;
}
} }
} }
int hot_index = 0; int hot_index = 0;
@ -320,7 +391,7 @@ namespace VSoft
for (int i = 0; i < ds.Tables[0].Rows.Count; i++) for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{ {
DataRow row = ds.Tables[0].Rows[i]; DataRow row = ds.Tables[0].Rows[i];
#region #region
RyQuickSQL mySQL2 = new RyQuickSQL("Columns"); RyQuickSQL mySQL2 = new RyQuickSQL("Columns");
mySQL2.AddField("Name", "默认分类"); mySQL2.AddField("Name", "默认分类");
mySQL2.AddField("Des", ""); mySQL2.AddField("Des", "");
@ -330,7 +401,7 @@ namespace VSoft
mySQL2.AddField("addTime", DateTime.Now); mySQL2.AddField("addTime", DateTime.Now);
var ds_id = db.ReadData(mySQL2.GetInsertSQL() + ";select last_insert_rowid();", mySQL2); var ds_id = db.ReadData(mySQL2.GetInsertSQL() + ";select last_insert_rowid();", mySQL2);
var type_id = mydb.GetValue(ds_id); var type_id = mydb.GetValue(ds_id);
#endregion #endregion
RyQuickSQL mySQL3 = new RyQuickSQL("Softs"); RyQuickSQL mySQL3 = new RyQuickSQL("Softs");
mySQL3.AddField("ColumnId", type_id);//将直属分类修改为默认分类 mySQL3.AddField("ColumnId", type_id);//将直属分类修改为默认分类
db.ExecuteNonQuery(mySQL3.GetUpdateSQL()+ " where ColumnId="+ row["id"].ToInt(), mySQL3); db.ExecuteNonQuery(mySQL3.GetUpdateSQL()+ " where ColumnId="+ row["id"].ToInt(), mySQL3);
@ -535,11 +606,11 @@ namespace VSoft
{ {
case 17189: //处理消息 case 17189: //处理消息
{ {
#region #region
switch (msg.WParam.ToInt32()) switch (msg.WParam.ToInt32())
{ {
case 100:// case 100://
#region #region
if ((int)msg.LParam.ToInt32() == 100) if ((int)msg.LParam.ToInt32() == 100)
{ {
this.Show(); this.Show();
@ -558,7 +629,7 @@ namespace VSoft
#endregion #endregion
break; break;
} }
#endregion #endregion
} }
break; break;
default: default:
@ -577,7 +648,7 @@ namespace VSoft
} }
LoadDb(true); LoadDb(true);
} }
#region #region
/// <summary> /// <summary>
/// 将栏目列表中的第几个栏目修改 /// 将栏目列表中的第几个栏目修改
/// </summary> /// </summary>
@ -608,7 +679,7 @@ namespace VSoft
TopMost = TopMost TopMost = TopMost
}; };
frm.ShowInCenter(this); frm.ShowInCenter(this);
if (frm.ShowDialog() == DialogResult.OK) if (frm.ShowDialog(this) == DialogResult.OK)
{ {
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType); IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(SQLConnStr) == 1) if (db.ConnDb(SQLConnStr) == 1)
@ -636,7 +707,7 @@ namespace VSoft
}; };
frm.GetInfo(TabList_Column.SelectedItems[0].Tag.ToInt()); frm.GetInfo(TabList_Column.SelectedItems[0].Tag.ToInt());
frm.ShowInCenter(this); frm.ShowInCenter(this);
if (frm.ShowDialog() == DialogResult.OK) if (frm.ShowDialog(this) == DialogResult.OK)
{ {
SetColumnRow(TabList_Column.SelectedItems[0].Tag.ToInt(), TabList_Column.SelectedItems[0].Index); SetColumnRow(TabList_Column.SelectedItems[0].Tag.ToInt(), TabList_Column.SelectedItems[0].Index);
} }
@ -685,8 +756,8 @@ namespace VSoft
} }
db.Free(); db.Free();
} }
#endregion #endregion
#region #region
/// <summary> /// <summary>
///将分类列表中的第几个分类进行修改 ///将分类列表中的第几个分类进行修改
/// </summary> /// </summary>
@ -724,7 +795,7 @@ namespace VSoft
ParentId = id ParentId = id
}; };
frm.ShowInCenter(this); frm.ShowInCenter(this);
if (frm.ShowDialog() == DialogResult.OK) if (frm.ShowDialog(this) == DialogResult.OK)
{ {
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType); IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(SQLConnStr) == 1) if (db.ConnDb(SQLConnStr) == 1)
@ -771,7 +842,7 @@ namespace VSoft
}; };
frm.GetInfo(id); frm.GetInfo(id);
frm.ShowInCenter(this); frm.ShowInCenter(this);
if (frm.ShowDialog() == DialogResult.OK) if (frm.ShowDialog(this) == DialogResult.OK)
{ {
SetTypeRow(id, TabList_Type.SelectedItems[0].Index); SetTypeRow(id, TabList_Type.SelectedItems[0].Index);
HotkeyValue hot = new HotkeyValue(frm.hotkeyTextBox1.HotKey); HotkeyValue hot = new HotkeyValue(frm.hotkeyTextBox1.HotKey);
@ -844,8 +915,8 @@ namespace VSoft
} }
db.Free(); db.Free();
} }
#endregion #endregion
#region #region
private void SetSoftRow(int id, int index) private void SetSoftRow(int id, int index)
{ {
#region #region
@ -915,14 +986,56 @@ namespace VSoft
ColumnId = ColumnId ColumnId = ColumnId
}; };
frm.ShowInCenter(this); frm.ShowInCenter(this);
if (frm.ShowDialog() == DialogResult.OK) if (frm.ShowDialog(this) == DialogResult.OK)
{ {
hot_index++; hot_index++;
HotkeyValue hot = new HotkeyValue(frm.hotkeyTextBox1.HotKey); HotkeyValue hot = new HotkeyValue(frm.hotkeyTextBox1.HotKey);
hotkey.RegHotKey(hot_index, "soft_" + frm.Op_Id, hot.Modifiers_Int, hot.KeyCode); hotkey.RegHotKey(hot_index, "soft_" + frm.Op_Id, hot.Modifiers_Int, hot.KeyCode);
LoadDb(); IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(SQLConnStr) == 1)
{
var ds = db.ReadData("select * from Softs where id="+frm.Op_Id);
if (ds.HaveData())
{
var row=ds.GetRow(0);
SoftInfo info = new SoftInfo
{
Id = frm.Op_Id,
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(),
IconPath = row["IconPath"].ToString()
};
string img_path;
if (info.IconPath.Length == 0)
{
img_path = info.TruePath;
}
else
{
img_path = RyFiles.GetRealPath(info.IconPath);
}
if (dictCacheImg.ContainsKey(img_path))
{
info.Image = dictCacheImg[img_path];
}
else
{
info.Image = API.GetImg(img_path, 128);
dictCacheImg.Add(img_path, info.Image);
}
AddSoft(info);
}
ds?.Dispose();
}
db.Free();
} }
frm.Dispose(); frm.Dispose();
this.Focus();
} }
private void ToolStripMenuItem_Click(object sender, EventArgs e) private void ToolStripMenuItem_Click(object sender, EventArgs e)
{ {
@ -936,7 +1049,7 @@ namespace VSoft
}; };
frm.GetInfo(info.Id); frm.GetInfo(info.Id);
frm.ShowInCenter(this); frm.ShowInCenter(this);
if (frm.ShowDialog() == DialogResult.OK) if (frm.ShowDialog(this) == DialogResult.OK)
{ {
HotkeyValue hot = new HotkeyValue(frm.hotkeyTextBox1.HotKey); HotkeyValue hot = new HotkeyValue(frm.hotkeyTextBox1.HotKey);
var index = hotkey.GetHotId("soft_" + frm.Op_Id); var index = hotkey.GetHotId("soft_" + frm.Op_Id);
@ -1108,9 +1221,9 @@ namespace VSoft
RunByListSelected(false); RunByListSelected(false);
} }
} }
#endregion #endregion
#region #region
private void IconViewEx1_ItemDrag(object sender, ItemDragEventArgs e) private void IconViewEx1_ItemDrag(object sender, ItemDragEventArgs e)
{ {
this.DoDragDrop(e.Item, DragDropEffects.Move); this.DoDragDrop(e.Item, DragDropEffects.Move);
@ -1131,10 +1244,16 @@ namespace VSoft
} }
private void IconViewEx1_DragDrop(object sender, DragEventArgs e) private void IconViewEx1_DragDrop(object sender, DragEventArgs e)
{ {
Point pt;
pt = ((IconViewEx)(sender)).PointToClient(new Point(e.X, e.Y));
var to_item = IconViewEx1.GetItemAt(pt.X, pt.Y);
IconViewEx1.InsertionMark.Index = -1;
TabList_Type.InsertionMark.Index = -1;
TabList_Column.InsertionMark.Index = -1;
var filedrop = e.Data.GetData(DataFormats.FileDrop); var filedrop = e.Data.GetData(DataFormats.FileDrop);
if (filedrop != null) if (filedrop != null)
{ {
#region #region
var ColumnId = 0; var ColumnId = 0;
if (TabList_Type.SelectedItems.Count > 0) if (TabList_Type.SelectedItems.Count > 0)
{ {
@ -1152,7 +1271,7 @@ namespace VSoft
db2.Free(); db2.Free();
} }
} }
if(ColumnId<=0) if (ColumnId <= 0)
{ {
Msg.ShowMsg("当前模式下不支持添加软件。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); Msg.ShowMsg("当前模式下不支持添加软件。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return; return;
@ -1175,7 +1294,11 @@ namespace VSoft
path = shortcut.TargetPath; path = shortcut.TargetPath;
pram = shortcut.Arguments; pram = shortcut.Arguments;
StartPath = shortcut.WorkDir; StartPath = shortcut.WorkDir;
if(shortcut.IconLocation!= path) if(StartPath.Trim('\\')==System.IO.Path.GetDirectoryName(path).Trim('\\'))
{
StartPath = "";
}
if (shortcut.IconLocation != path)
{ {
icon = shortcut.IconLocation; icon = shortcut.IconLocation;
} }
@ -1226,31 +1349,21 @@ namespace VSoft
info.Image = API.GetImg(img_path, 128); info.Image = API.GetImg(img_path, 128);
dictCacheImg.Add(img_path, info.Image); dictCacheImg.Add(img_path, info.Image);
} }
IconViewEx1.Items.Add(info.Name).Tag = info; InsertSoft(to_item==null?-1:to_item.Index, info);
} }
ReSortSoftByList(db3);
} }
db3.Free(); db3.Free();
return; return;
#endregion #endregion
} }
Point pt;
pt = ((IconViewEx)(sender)).PointToClient(new Point(e.X, e.Y));
var to_item = IconViewEx1.GetItemAt(pt.X, pt.Y);
IconViewEx1.InsertionMark.Index = -1;
TabList_Type.InsertionMark.Index = -1;
TabList_Column.InsertionMark.Index = -1;
if (to_item == null) { return; } if (to_item == null) { return; }
//获得拖放中的项 //获得拖放中的项
ListViewItem lvi = (ListViewItem)e.Data.GetData(typeof(ListViewItem)); ListViewItem lvi = (ListViewItem)e.Data.GetData(typeof(ListViewItem));
if (lvi == null) { return; } if (lvi == null) { return; }
if (lvi.ListView!=IconViewEx1) { return; } if (lvi.ListView!=IconViewEx1) { return; }
if (lvi.Index == to_item.Index) { return; } if (lvi.Index == to_item.Index) { return; }
IconViewEx1.BeginUpdate(); InsertSoft(to_item.Index, lvi);
IconViewEx1.View = View.List;
IconViewEx1.Items.RemoveAt(lvi.Index);
IconViewEx1.Items.Insert(to_item.Index, lvi);
IconViewEx1.View = View.Tile;
IconViewEx1.EndUpdate();
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType); IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(SQLConnStr) == 1) if (db.ConnDb(SQLConnStr) == 1)
{ {
@ -1258,23 +1371,79 @@ namespace VSoft
} }
db.Free(); db.Free();
} }
private void AddSoft(SoftInfo soft)
{
IconViewEx1.BeginUpdate();
IconViewEx1.View = View.List;
IconViewEx1.Items.Add(soft.Name).Tag = soft;
IconViewEx1.View = View.Tile;
IconViewEx1.EndUpdate();
var rect = IconViewEx1.GetItemRect(IconViewEx1.Items.Count - 1);
if (!IconViewEx1.Bounds.Contains(rect.Location))
{
IconViewEx1.EnsureVisible(IconViewEx1.Items.Count - 1);
}
}
private void InsertSoft(int index, SoftInfo soft)
{
IconViewEx1.BeginUpdate();
IconViewEx1.View = View.List;
if (index == -1)
{
IconViewEx1.Items.Add(soft.Name).Tag = soft;
}
else
{
IconViewEx1.Items.Insert(index, soft.Name).Tag = soft;
}
IconViewEx1.View = View.Tile;
IconViewEx1.EndUpdate();
if (index == -1)
{
var rect = IconViewEx1.GetItemRect(IconViewEx1.Items.Count - 1);
if (!IconViewEx1.Bounds.Contains(rect.Location))
{
IconViewEx1.EnsureVisible(IconViewEx1.Items.Count - 1);
}
}
else
{
var rect = IconViewEx1.GetItemRect(index);
if (!IconViewEx1.Bounds.Contains(rect.Location))
{
IconViewEx1.EnsureVisible(index);
}
}
}
private void InsertSoft(int index,ListViewItem lvi)
{
IconViewEx1.BeginUpdate();
IconViewEx1.View = View.List;
IconViewEx1.Items.RemoveAt(lvi.Index);
IconViewEx1.Items.Insert(index, lvi);
IconViewEx1.View = View.Tile;
IconViewEx1.EndUpdate();
var rect = IconViewEx1.GetItemRect(index);
if (!IconViewEx1.Bounds.Contains(rect.Location))
{
IconViewEx1.EnsureVisible(index);
}
}
private void IconViewEx1_DragOver(object sender, DragEventArgs e) private void IconViewEx1_DragOver(object sender, DragEventArgs e)
{ {
if (sender is IconViewEx list) if (sender is IconViewEx list)
{ {
var filedrop = e.Data.GetData(DataFormats.FileDrop); var filedrop = e.Data.GetData(DataFormats.FileDrop);
//if (filedrop != null)
//{
// list.InsertionMark.Index = -1;
// return;
//}
var lvi = e.Data.GetData(typeof(ListViewItem));
if (filedrop != null) if (filedrop != null)
{ {
list.InsertionMark.Index = -1;
return;
} }
var lvi = e.Data.GetData(typeof(ListViewItem)); else if(lvi != null)
if (lvi == null)
{
list.InsertionMark.Index = -1;
return;
}
else
{ {
var lvi2 = (ListViewItem)lvi; var lvi2 = (ListViewItem)lvi;
if (lvi2.ListView != IconViewEx1) if (lvi2.ListView != IconViewEx1)
@ -1283,6 +1452,11 @@ namespace VSoft
return; return;
} }
} }
else
{
list.InsertionMark.Index = -1;
return;
}
var pt = list.PointToClient(new Point(e.X, e.Y)); var pt = list.PointToClient(new Point(e.X, e.Y));
int targetIndex = list.InsertionMark.NearestIndex(pt); int targetIndex = list.InsertionMark.NearestIndex(pt);
if (targetIndex > -1) if (targetIndex > -1)
@ -1291,8 +1465,9 @@ namespace VSoft
// the right of the midpoint of the closest item and set // the right of the midpoint of the closest item and set
// the InsertionMark.AppearsAfterItem property accordingly. // the InsertionMark.AppearsAfterItem property accordingly.
Rectangle itemBounds = list.GetItemRect(targetIndex); Rectangle itemBounds = list.GetItemRect(targetIndex);
if (pt.X > itemBounds.Left + (itemBounds.Width / 2)) if (pt.X < list.Left + itemBounds.Width)
{ {
targetIndex--;
list.InsertionMark.AppearsAfterItem = true; list.InsertionMark.AppearsAfterItem = true;
} }
else else
@ -1301,7 +1476,14 @@ namespace VSoft
} }
} }
list.InsertionMark.Index = targetIndex; list.InsertionMark.Index = targetIndex;
list.InsertionMark.Color = Color.Black; ; list.InsertionMark.Color = Color.Black;
//list.InsertionMark.a = ListViewInsertionMarkAppearance.Largest;
//list.InsertionMark.Color = Color.Transparent;
//// 清除旧的插入标记
//list.Invalidate();
//var item = list.GetItemAt(pt.X, pt.Y);
//// 绘制新的插入标记
//DrawInsertionMark(list, list.CreateGraphics(), item, pt);
//item = list.GetItemAt(pt.X, pt.Y); //item = list.GetItemAt(pt.X, pt.Y);
} }
else if (sender is TabList list2) else if (sender is TabList list2)
@ -1317,8 +1499,8 @@ namespace VSoft
list2.InsertionMark.Color = Color.Black; ; list2.InsertionMark.Color = Color.Black; ;
} }
} }
#endregion #endregion
#region #region
private void TabList_Column_DragEnter(object sender, DragEventArgs e) private void TabList_Column_DragEnter(object sender, DragEventArgs e)
{ {
//判定是否现在拖动的数据是LISTVIEW项 //判定是否现在拖动的数据是LISTVIEW项
@ -1404,8 +1586,8 @@ namespace VSoft
{ {
this.DoDragDrop(e.Item, DragDropEffects.Move); this.DoDragDrop(e.Item, DragDropEffects.Move);
} }
#endregion #endregion
#region #region
private void TabList_Type_DragEnter(object sender, DragEventArgs e) private void TabList_Type_DragEnter(object sender, DragEventArgs e)
{ {
//判定是否现在拖动的数据是LISTVIEW项 //判定是否现在拖动的数据是LISTVIEW项
@ -1436,7 +1618,7 @@ namespace VSoft
ListViewItem lvi = (ListViewItem)drag_item; ListViewItem lvi = (ListViewItem)drag_item;
if (lvi.ListView == IconViewEx1) if (lvi.ListView == IconViewEx1)
{ {
#region #region
var info = (SoftInfo)lvi.Tag; var info = (SoftInfo)lvi.Tag;
RyQuickSQL mySQL = new RyQuickSQL("Softs"); RyQuickSQL mySQL = new RyQuickSQL("Softs");
mySQL.AddField("ColumnId", columnid); mySQL.AddField("ColumnId", columnid);
@ -1457,7 +1639,7 @@ namespace VSoft
ReSortSoftByList(db); ReSortSoftByList(db);
} }
db.Free(); db.Free();
#endregion #endregion
} }
else if (lvi.ListView == TabList_Type) else if (lvi.ListView == TabList_Type)
{ {
@ -1488,15 +1670,43 @@ namespace VSoft
{ {
this.DoDragDrop(e.Item, DragDropEffects.Move); this.DoDragDrop(e.Item, DragDropEffects.Move);
} }
#endregion #endregion
private void TabList_Type_SelectedIndexChanged(object sender, EventArgs e) private void TabList_Type_SelectedIndexChanged(object sender, EventArgs e)
{ {
if (IsProcUse) { return; } if (IsProcUse) { return; }
if(TabList_Type.SelectedItems.Count==0) { return; }
if (TabList_Column.SelectedItems.Count == 0) { return; }
LoadDb(); LoadDb();
} }
private int LastSelected = -1;
private void SaveSelected(int column_id,int SelectedTypeId,int IconVisibleIndex,int IconSelectedIndex)
{
if (dict_cache_type.ContainsKey(column_id))
{
var item = dict_cache_type[column_id];
item.SelectedTypeId = SelectedTypeId;
item.IconVisibleIndex = IconVisibleIndex;
item.IconSelectedIndex = IconSelectedIndex;
}
else
{
dict_cache_type[column_id] = new SelectInfo()
{
SelectedTypeId = SelectedTypeId,
IconVisibleIndex = IconVisibleIndex,
IconSelectedIndex = IconSelectedIndex
};
}
}
private void TabList_Column_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e) private void TabList_Column_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
{ {
if (IsProcUse) { return; } if (IsProcUse) { return; }
if(LastSelected>=0)
{
var column_id = TabList_Column.Items[LastSelected].Tag.ToInt();
SaveSelected(column_id, GetCurColumnId(), IconViewEx1.GetFirstVisibleIndex(), IconViewEx1.SelectedItems.Count >= 1 ? IconViewEx1.SelectedItems[0].Index : -1);
}
LastSelected = TabList_Column.SelectedItems[0].Index;
if (TabList_Column.SelectedItems.Count > 0) if (TabList_Column.SelectedItems.Count > 0)
{ {
LoadTypeColumn(TabList_Column.SelectedItems[0].Tag.ToInt()); LoadTypeColumn(TabList_Column.SelectedItems[0].Tag.ToInt());
@ -1532,6 +1742,17 @@ namespace VSoft
this.TopMost = true; this.TopMost = true;
this.Show(); this.Show();
this.TopMost = topmost; this.TopMost = topmost;
var opens = Application.OpenForms;
for (int i = 0; i < opens.Count; i++)
{
if (opens[i].Modal)
{
if(opens[i].Owner==this)
{
opens[i].Show();
}
}
}
} }
private void 退ToolStripMenuItem_Click(object sender, EventArgs e) private void 退ToolStripMenuItem_Click(object sender, EventArgs e)
@ -1573,7 +1794,7 @@ namespace VSoft
{ {
frm.ShowInCenter(this); frm.ShowInCenter(this);
} }
if (frm.ShowDialog() == DialogResult.OK) if (frm.ShowDialog(this) == DialogResult.OK)
{ {
VSoft.Config.Soft_Config.LoadSetting(); VSoft.Config.Soft_Config.LoadSetting();
hotkey.UnHotKey(100); hotkey.UnHotKey(100);
@ -1601,6 +1822,25 @@ namespace VSoft
} }
return; return;
} }
SaveSelected(TabList_Column.SelectedItems[0].Tag.ToInt(), GetCurColumnId(), IconViewEx1.GetFirstVisibleIndex(), IconViewEx1.SelectedItems.Count >= 1 ? IconViewEx1.SelectedItems[0].Index : -1);
ryCommon.Ini ini = new Ini(VSoft.Config.Soft_Info.UserDataFolder + "\\Win.dat");
ini.WriteIni(VSoft.Config.Soft_Info.Soft_Id, "width", Width);
ini.WriteIni(VSoft.Config.Soft_Info.Soft_Id, "height", Height);
JArray jarr = new JArray();
foreach (var item in dict_cache_type)
{
JObject jo = new JObject
{
{ "ColumnId", item.Key },
{ "IconSelectedIndex", item.Value.IconSelectedIndex },
{ "IconVisibleIndex", item.Value.IconVisibleIndex },
{ "SelectedTypeId", item.Value.SelectedTypeId }
};
jarr.Add(jo);
}
Itrycn_Db.SetSetting("SelectedCache", jarr.ToString());
ini.WriteIni(VSoft.Config.Soft_Info.Soft_Id, "ColumnId", TabList_Column.SelectedItems[0].Tag.ToInt());
ini.WriteIni(VSoft.Config.Soft_Info.Soft_Id, "TypeId", TabList_Type.SelectedItems[0].Tag.ToInt());
} }
private void TabList_Column_KeyDown(object sender, KeyEventArgs e) private void TabList_Column_KeyDown(object sender, KeyEventArgs e)
@ -1700,7 +1940,7 @@ namespace VSoft
TopMost = TopMost TopMost = TopMost
}; };
frm.ShowInCenter(this); frm.ShowInCenter(this);
if (frm.ShowDialog()==DialogResult.OK) if (frm.ShowDialog(this)==DialogResult.OK)
{ {
var info = frm.SelectedInfo; var info = frm.SelectedInfo;
RyQuickSQL mySQL = new RyQuickSQL("Softs"); RyQuickSQL mySQL = new RyQuickSQL("Softs");
@ -1708,11 +1948,13 @@ namespace VSoft
mySQL.AddField("SoftType",1);//0表示运行文件,1表示执行内置命令,2表示执行脚本 mySQL.AddField("SoftType",1);//0表示运行文件,1表示执行内置命令,2表示执行脚本
mySQL.AddField("Path",frm.SQLConnStr); mySQL.AddField("Path",frm.SQLConnStr);
if (info.CmdId.Length > 0) if (info.CmdId.Length > 0)
{ mySQL.AddField("RunPram","cmdid="+ info.CmdId); } { info.RunPram = "cmdid=" + info.CmdId; mySQL.AddField("RunPram","cmdid="+ info.CmdId); }
else else
{ {
info.RunPram = "id=" + info.Id;
mySQL.AddField("RunPram","id="+ info.Id); mySQL.AddField("RunPram","id="+ info.Id);
} }
info.IconPath = info.IconPath.Length > 0 ? info.IconPath : info.Path;
mySQL.AddField("StartPath","");//起始路径 mySQL.AddField("StartPath","");//起始路径
mySQL.AddField("IconPath", info.IconPath.Length>0? info.IconPath: info.Path);//图标路径 mySQL.AddField("IconPath", info.IconPath.Length>0? info.IconPath: info.Path);//图标路径
mySQL.AddField("SetJson","");//设置 mySQL.AddField("SetJson","");//设置
@ -1726,8 +1968,32 @@ namespace VSoft
mySQL.AddField("ColumnId", ColumnId); mySQL.AddField("ColumnId", ColumnId);
mySQL.AddField("sortindex", Itrycn_Db.GetSoftCount(db, ColumnId) + 1); mySQL.AddField("sortindex", Itrycn_Db.GetSoftCount(db, ColumnId) + 1);
mySQL.AddField("addTime", DateTime.Now); mySQL.AddField("addTime", DateTime.Now);
db.ExecuteNonQuery(mySQL.GetInsertSQL(), mySQL); var ds_c = db.ReadData(mySQL.GetInsertSQL() + ";select last_insert_rowid();", mySQL);
LoadDb(); if(ds_c.HaveData())
{
info.Id = ds_c.GetRow(0)[0].ToInt();
}
ds_c?.Dispose();
//LoadDb();
string img_path;
if (info.IconPath.Length == 0)
{
img_path = info.TruePath;
}
else
{
img_path = RyFiles.GetRealPath(info.IconPath);
}
if (dictCacheImg.ContainsKey(img_path))
{
info.Image = dictCacheImg[img_path];
}
else
{
info.Image = API.GetImg(img_path, 128);
dictCacheImg.Add(img_path, info.Image);
}
AddSoft(info);
} }
db.Free(); db.Free();
} }
@ -1810,11 +2076,32 @@ namespace VSoft
private void FrmVSoft_Shown(object sender, EventArgs e) private void FrmVSoft_Shown(object sender, EventArgs e)
{ {
ryCommon.Ini ini = new ryCommon.Ini(Soft_Info.UserDataFolder + "\\Win.dat"); ryCommon.Ini ini = new ryCommon.Ini(Soft_Info.UserDataFolder + "\\Win.dat");
Width = ini.ReadIni(VSoft.Config.Soft_Info.Soft_Id, "width",200,2000, 745);
Height = ini.ReadIni(VSoft.Config.Soft_Info.Soft_Id, "height",200,2000, 543);
//var ColumnId = ini.ReadIni(VSoft.Config.Soft_Info.Soft_Id, "ColumnId", -1);
//var TypeId = ini.ReadIni(VSoft.Config.Soft_Info.Soft_Id, "TypeId", -1);
//for (int i = 0; i < TabList_Column.Items.Count; i++)
//{
// if (TabList_Column.Items[i].Tag.ToInt()==ColumnId)
// {
// TabList_Column.Items[i].Selected = true;
// break;
// }
//}
//for (int i = 0; i < TabList_Type.Items.Count; i++)
//{
// if (TabList_Type.Items[i].Tag.ToInt() == TypeId)
// {
// TabList_Type.Items[i].Selected = true;
// break;
// }
//}
ini.WriteIni(Soft_Info.Soft_Id, "hwnd",Handle.ToInt32()); ini.WriteIni(Soft_Info.Soft_Id, "hwnd",Handle.ToInt32());
if (prog_args!=null && prog_args.Length>=1 && prog_args[0]=="q") if (prog_args!=null && prog_args.Length>=1 && prog_args[0]=="q")
{ {
this.Hide(); this.Hide();
} }
//IconViewEx1.SetInterval(120, 120);
} }
private ListViewItem currentItem = new ListViewItem(); private ListViewItem currentItem = new ListViewItem();
private void IconViewEx1_MouseMove(object sender, MouseEventArgs e) private void IconViewEx1_MouseMove(object sender, MouseEventArgs e)
@ -1823,7 +2110,9 @@ namespace VSoft
if (lvi != null && lvi != currentItem) if (lvi != null && lvi != currentItem)
{ {
currentItem = lvi; currentItem = lvi;
if (lvi.Text.Length > 10) Graphics g = IconViewEx1.CreateGraphics();
var size= g.MeasureString(lvi.Text, IconViewEx1.Font);
if (size.Width > IconViewEx1.TileSize.Width-2)
{ {
lvTp.Show(lvi.Text, IconViewEx1, e.Location); lvTp.Show(lvi.Text, IconViewEx1, e.Location);
} }
@ -1838,5 +2127,67 @@ namespace VSoft
} }
currentItem = lvi; currentItem = lvi;
} }
private void TabList_Type_DragLeave(object sender, EventArgs e)
{
TabList_Type.InsertionMark.Index = -1;
}
private void TabList_Column_DragLeave(object sender, EventArgs e)
{
TabList_Column.InsertionMark.Index = -1;
}
private void IconViewEx1_DragLeave(object sender, EventArgs e)
{
IconViewEx1.InsertionMark.Index = -1;
}
private void BtnLeftColumn_Click(object sender, EventArgs e)
{
if (TabList_Column.Items.Count == 0) { return; }
if (TabList_Column.SelectedItems.Count == 0) { TabList_Column.Items[0].Selected = true; }
else
{
var index = TabList_Column.SelectedItems[0].Index;
if(index>1)
{
index--;
}
else
{
index = TabList_Column.Items.Count - 1;
}
TabList_Column.Items[index].Selected = true;
TabList_Column.EnsureVisible(index);
}
}
private void BtnRightColumn_Click(object sender, EventArgs e)
{
if (TabList_Column.Items.Count == 0) { return; }
if (TabList_Column.SelectedItems.Count == 0) { TabList_Column.Items[0].Selected = true; }
else
{
var index = TabList_Column.SelectedItems[0].Index;
if (index < TabList_Column.Items.Count-1)
{
index++;
}
else
{
index =0;
}
TabList_Column.Items[index].Selected = true;
TabList_Column.EnsureVisible(index);
//TabList_Column.item = TabList_Column.Items[index];
}
}
}
class SelectInfo
{
public int SelectedTypeId { get; set; } = -1;
public int IconVisibleIndex { get; set; } = -1;
public int IconSelectedIndex { get; set; } = -1;
} }
} }

View File

@ -124,32 +124,32 @@
<data name="以管理员方式启动ToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="以管理员方式启动ToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wAAADsABataJCQAAAYRJREFUOE+NkztPwlAUx8/gakIYWFwYHB1w8FUQCEpI1KiTYpSHQVQisviYjZsJ vAAADrwBlbxySQAAAXxJREFUOE+NkztPAkEQx6ewNSEUNDYUlhZY+DoQCEomUaNWilGOM4hKRBoftbEz
k4OJMT6ILhgTFheDiongc4AP4HdgcO/xnPZWaG81/JN/Qu49v1972wJ2iUQiQWqFiqL82yO2/w4Nuann obIwMcYH0QZjQmNjUCGRE8UCPoDfgcL+xizskrvb8/FPJrnk5vfbm909AIcgYhgRy4hIvNizz94nBRG9
DA3MrqMrWcDaSRB30uOGiPfcYrwVWuQr1HnIPxXFnsQxQvYDYeMd1Scf1Yt3hwGMz4UNEc9WBK4JsHfx iHjJoKH5TfJoedLPwrSXmhQi9s5r5xjIVmiwpuBMjPoSpwSZOsHWOxmVABkVPz0ch0hdiAoR6y2bBdS/
AJ0r1wibBAoYMizwolpR9D6OYOPCh5f7AU0kcF0AuU8JhsybCVYfhvXeD9kIbGBYEwILrJYHZYEzVZRg fETutVuC7XoXhjQT+MkoK516HqPmVYCuD0NtkUUA2Q8JhvSbBTaeRjv1OOIgcIBhgwtssFEalgXuZEGC
WH21hRtniixwJQoSDGkSWGBu7cgrCUr57THpgTEIqReE5RpCkpqoIsSr2Dezy4KSwDVBko1fxVHpzFa4 Yb3mCDcvFFngSeQlGFI1CWaln/glQTG3OyFtGAMh+UqwqhNoOkGiSqBWaWBunwmKZoHGjJ+FcWlmO9y7
e+FGuzozAtdDC/VMLCyduR2G2DMqk3GG6wJrhRY91GZ+K/QL83nbYXHrTZ4VmDmGZC8bwu9bISC4a6mM dCeOUusKuKSRjkelmc0wxF9ImVbb98ACc4EPEVu5nYhlZjPMP73147UWkoNMhL7uuUCtUs9KiQZns7/D
/dO5/2EjhoQ/28apgs7oFfon5juDjdCgg2r9NzrEduchiN+O+WmbAvADQWOC4qBCLEQAAAAASUVORK5C IkLCrm3zXCF37IaCU4v/g0UQ0eXwN7rsfX+Gn451t235BkFjguJS2ETKAAAAAElFTkSuQmCC
YII=
</value> </value>
</data> </data>
<data name="新增内置功能ToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="新增内置功能ToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wAAADsABataJCQAAAIpJREFUOE/tktEGxDAQRef/v6NLly5dQpfQtSXkixJJHu661R36NC/70NJhiDnH vAAADrwBlbxySQAAAJdJREFUOE/NkVEHxDAQhPf//44eLT1aQo/QuhLyixJJHramdOnTHHcPtyyx31iz
mImRv0SMESEELJ8F73mG9x6vacKGTS6ErbVdOudUsLiwM4s55zX5fo6jChYXjvUTUkqoteIxDCpYXLgT GZFfVIxRQwi6v3fd1lW99/paFv2UC2Br7dbOORMwLtiMYc75bLznaTIB4wJblyClpLVWfY6jCRgX3HRZ
BSZhKQX3vlfB4sIP4U4ci50Jb12ngsUPENcdnPsORL5USPZgYQ6cHAAAAABJRU5ErkJggg== Ayyl6ND3JmBc8CG4CbawGfDRdSZg/A+K5cw4zZlxmjPjNGfGac6M05wZ/6oOVEj2YBfdvXIAAAAASUVO
RK5CYII=
</value> </value>
</data> </data>
<data name="BtnAddColumn.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="BtnAddColumn.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAABGdBTUEAALGPC/xhBQAAAPFJREFUSEvt iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAABGdBTUEAALGPC/xhBQAAAPRJREFUSEvt
l7EKwjAQhrM4OCazz6m77g5Cii6+gTgquuhrJG7u6mBd6/0apIQTG0wolPzwQeld86ft5dqIIE3PfVXY l7EKwkAMhm9xcLzMPqfuujsICbr4BuKo6KKvcenmrh2sayUqKjlbLdxZ0P7wQ2n+9uPapPSMqaLhrg3E
JVES1Qtt7jiHmMuKL6VP44+hD8VcWnypwuxZU6DNzqXFl9TmyJoSsrAHlxZf2bhONo6qjhgvqh4NOERz UyDOgDi/GN1RzklNx4MJMOnfgdqY9HU+mIDc2gM+Vr7S+WCy6LYe8GZLvNH5YGrADVjng+lHwJO8ZdF1
wMU/uHGmADEvl4UazUrN7AB3MecGSonUdiNoFhcumBIyvlLjtw8umJiyPWN61F8LJhV4vfSps1s/kBoU 5eMgF79xqoFP4PRF3jOgm8GIO7KKsb5JbFvkhbHEe12IbYt8MIB80oUvOKsPXNYwsSyv1wDxUhdiWxra
tEBp0wzWKPUG/LWc3JIdYQm7xdxMHelcAcrGdbJxVLVm3NoPPRlPWFOQcgvDbtrex4GbNiGeSkzyFPRt SGtb4rlu+wIXPp1Pxuk2sj0ZYT3VpQr7AamgBtyAdT6Y/g9c2w89kBt4wDs44hbm5abtelx503YGSkzy
h10AAAAASUVORK5CYII= FCr2IzYAAAAASUVORK5CYII=
</value> </value>
</data> </data>
<metadata name="MenuTabColumn.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="MenuTabColumn.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
@ -182,37 +182,36 @@
<data name="IconViewEx1.Icon" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="IconViewEx1.Icon" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
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
7NsAAAAASUVORK5CYII=
</value> </value>
</data> </data>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">

View File

@ -68,12 +68,25 @@ namespace VSoft.Prams
TargetPath = TargetPath.Replace("C:\\Program Files (x86)\\", "C:\\Program Files\\"); TargetPath = TargetPath.Replace("C:\\Program Files (x86)\\", "C:\\Program Files\\");
} }
} }
string IconLocation = shortcut.IconLocation;
var iPos = IconLocation.LastIndexOf(",");
var IconIndex = 0;
if (iPos >= 0)
{
if(IconLocation.Substring(iPos+1).IsInt())
{
IconIndex = IconLocation.Substring(iPos + 1).ToInt();
IconLocation=IconLocation.Substring(0, iPos);
}
}
if (IconLocation.Length == 0) { IconLocation = TargetPath; }
return new ShortcutDescription() return new ShortcutDescription()
{ {
TargetPath = TargetPath, TargetPath = TargetPath,
Arguments = shortcut.Arguments, Arguments = shortcut.Arguments,
WorkDir = shortcut.WorkingDirectory, WorkDir = shortcut.WorkingDirectory,
IconLocation= shortcut.IconLocation, IconLocation= IconLocation,
IconIndex= IconIndex,
Description = shortcut.Description Description = shortcut.Description
}; };
} }

View File

@ -60,6 +60,12 @@ public class Json
else else
{ return jo[name].ToInt(defvalue); } { return jo[name].ToInt(defvalue); }
} }
public int GetJsonValue(string name, int min, int max, int defValue)
{
if (jo[name] == null) { return defValue; }
else
{ return jo[name].ToInt(min, max,defValue); }
}
public Int64 GetJsonValue(string name, Int64 defvalue) public Int64 GetJsonValue(string name, Int64 defvalue)
{ {
if (jo[name] == null) { return defvalue; } if (jo[name] == null) { return defvalue; }

View File

@ -83,20 +83,22 @@ namespace VSoft.Prams
frm.TopMost = true; frm.TopMost = true;
var handle= WinAPI.User32.GetActiveWindow(); var handle= WinAPI.User32.GetActiveWindow();
var have_owner = false; var have_owner = false;
Form owner = null;
for (int i = 0; i < Application.OpenForms.Count; i++) for (int i = 0; i < Application.OpenForms.Count; i++)
{ {
if(Application.OpenForms[i].Handle==handle) if(Application.OpenForms[i].Handle==handle)
{ {
var owner = Application.OpenForms[i]; owner = Application.OpenForms[i];
frm.Location = new System.Drawing.Point(owner.Left + (owner.Width - frm.Width) / 2, owner.Top + (owner.Height - frm.Height) / 2); frm.Location = new System.Drawing.Point(owner.Left + (owner.Width - frm.Width) / 2, owner.Top + (owner.Height - frm.Height) / 2);
have_owner = true; have_owner = true;
break;
} }
} }
//WinAPI.User32.GetWindowRect(handle,out var rectangle); //WinAPI.User32.GetWindowRect(handle,out var rectangle);
//var title2= ryCommon.RyForm.GetWinText(handle); //var title2= ryCommon.RyForm.GetWinText(handle);
//frm.Location = new System.Drawing.Point(rectangle.X + (rectangle.Width - frm.Width) / 2, rectangle.Y + (rectangle.Height - frm.Height) / 2); //frm.Location = new System.Drawing.Point(rectangle.X + (rectangle.Width - frm.Width) / 2, rectangle.Y + (rectangle.Height - frm.Height) / 2);
if (!have_owner) { frm.StartPosition = FormStartPosition.CenterScreen; } if (!have_owner) { frm.StartPosition = FormStartPosition.CenterScreen; }
return frm.ShowDialog(); return frm.ShowDialog(owner);
} }
} }
} }

View File

@ -102,22 +102,38 @@ namespace VSoft.Prams
} }
return 0; return 0;
} }
if (RunasAdmin) Json json = new Json(SetJson);
var RunCount = json.GetJsonValue("RunCount", 1);
var run_result = 37;
for (int i = 0; i < RunCount; i++)
{ {
return RunProcessAsAdmin(path, parm, StartPath); if (RunasAdmin)
}
else
{
Json json = new Json(SetJson);
if (json.GetJsonValue("RunAsAdmin", false))
{ {
return RunProcessAsAdmin(path, parm, StartPath); if(RunProcessAsAdmin(path, parm, StartPath, json.GetJsonValue("RunMode", 0))==-1)
{
run_result = -1;break;
}
} }
else else
{ {
return RyFiles.RunFile(path, parm, StartPath); if (json.GetJsonValue("RunAsAdmin", false))
{
if (RunProcessAsAdmin(path, parm, StartPath, json.GetJsonValue("RunMode", 0)) == -1)
{
run_result = -1; break;
}
}
else
{
if (RyFiles.RunFile(path, parm, StartPath, json.GetJsonValue("RunMode", 0)) < 36)
{
run_result = -1; break;
}
}
} }
} }
return run_result;
} }
/// <summary> /// <summary>
/// 以管理员方式打开 /// 以管理员方式打开
@ -126,7 +142,7 @@ namespace VSoft.Prams
/// <param name="parameters"></param> /// <param name="parameters"></param>
/// <param name="CurrentDirectory"></param> /// <param name="CurrentDirectory"></param>
/// <returns></returns> /// <returns></returns>
public static int RunProcessAsAdmin(string exeName, string parameters, string CurrentDirectory) public static int RunProcessAsAdmin(string exeName, string parameters, string CurrentDirectory,int RunMode)
{ {
try try
{ {
@ -135,6 +151,22 @@ namespace VSoft.Prams
startInfo.WorkingDirectory = CurrentDirectory; startInfo.WorkingDirectory = CurrentDirectory;
startInfo.FileName = exeName; startInfo.FileName = exeName;
startInfo.Verb = "runas"; startInfo.Verb = "runas";
switch(RunMode)
{
case 0:
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
break;
case 1:
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
break;
case 2:
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Minimized;
break;
case 3:
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Maximized;
break;
}
//MLHIDE //MLHIDE
startInfo.Arguments = parameters; startInfo.Arguments = parameters;
startInfo.ErrorDialog = true; startInfo.ErrorDialog = true;

View File

@ -11,6 +11,7 @@ namespace VSoft.Prams
public string Arguments { get; set; } = ""; public string Arguments { get; set; } = "";
public string WorkDir { get; set; } = ""; public string WorkDir { get; set; } = "";
public string IconLocation { get; set; } = ""; public string IconLocation { get; set; } = "";
public int IconIndex { get; set; } = 0;
public string Description { get; set; } = ""; public string Description { get; set; } = "";
} }
} }

View File

@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("睿元网络")] [assembly: AssemblyCompany("睿元网络")]
[assembly: AssemblyProduct("VSoft")] [assembly: AssemblyProduct("VSoft")]
[assembly: AssemblyCopyright("Copyright itrycn© 2010-2020")] [assembly: AssemblyCopyright("Copyright itrycn© 2010-2025")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示: //通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.2312.0401")] [assembly: AssemblyVersion("2.0.2412.1001")]
[assembly: AssemblyFileVersion("1.0.2312.0401")] [assembly: AssemblyFileVersion("2.0.2412.1001")]

View File

@ -56,7 +56,7 @@ namespace ryControls
} }
else else
{ {
if ( last_selectIndex < this.Items.Count) if (last_selectIndex < this.Items.Count)
{ {
//this.Items[last_selectIndex].Selected = true; //this.Items[last_selectIndex].Selected = true;
} }

View File

@ -1,4 +1,5 @@
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using ryCommon;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
@ -49,6 +50,11 @@ namespace VSoft.Tools
post_data += "&sign=" + sign; post_data += "&sign=" + sign;
var http= web.Post("http://api.fanyi.baidu.com/api/trans/vip/translate", post_data); var http= web.Post("http://api.fanyi.baidu.com/api/trans/vip/translate", post_data);
JObject jo = JObject.Parse(http.Html); JObject jo = JObject.Parse(http.Html);
if(jo.GetJsonValue("error_code",0)>0)
{
http = web.Post("http://api.fanyi.baidu.com/api/trans/vip/translate", post_data);
jo = JObject.Parse(http.Html);
}
var trans_result = jo["trans_result"]; var trans_result = jo["trans_result"];
if (trans_result != null) if (trans_result != null)
{ {
@ -65,10 +71,15 @@ namespace VSoft.Tools
} }
last_text = from_txt; last_text = from_txt;
return text; return text;
}
else
{
} }
return ""; return "";
} }
catch(Exception ex) { return "错误=>"+ex.Message; } catch(Exception ex)
{ return "错误=>"+ex.Message; }
} }
string last_text = ""; string last_text = "";
// 计算MD5值 // 计算MD5值