SuperDesign/Source/开发辅助工具/Tools/UpLog/FrmPublishLogs.cs
zilinsoft c000c7ef1b ### 2025-01-08 星期三更新
------
#### RySmartEditor    V1.0.2501.0801
- *.[改进]复制文件到其它站点同位置功能支持复制文件夹。
#### SuperDesign    V3.0.2501.0801
- *.[新增]支持直接设置主项目的功能。
- *.[新增]新增支持设置在发布日志时是否更新版本号的功能。
- *.[新增]更新日志右键菜单支持快速添加日志前缀。
- *.[改进]更新日志保存时如果冲突,则显示数据库和本地日志内容进行对比。
- *.[修复]修复更新日志输入框粘贴文本会携带颜色的字体的BUG。
- *.[修复]修复打开Git时无法粘贴更新日志的BUG。
2025-01-08 16:55:25 +08:00

78 lines
2.6 KiB
C#

using Newtonsoft.Json.Linq;
using ryCommon;
using ryControls.Controls;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace SuperDesign.Tools.UpLog
{
public partial class FrmPublishLogs : Form
{
public FrmPublishLogs()
{
InitializeComponent();
}
private string MdLog { get; set; } = "";
private string HtmlLog { get; set; } = "";
public void ShowLog(string LogJson)
{
try
{
JArray jarr = JArray.Parse(LogJson);
MdLog = SuperDesign.Manager.APIManager.GetMdLogText(jarr, DateTime.Now);
HtmlLog = SuperDesign.Manager.APIManager.GetHtmlLogText(BFFolderPath, jarr, DateTime.Now);
}
catch { }
}
public string BFFolderPath { get; set; } = "";
int index = 0;
private void BtnCopyMD_Click(object sender, EventArgs e)
{
RyFiles.CopyToClip(MdLog);
var git_path= SuperDesign.Manager.APIManager.GetTortoiseGitProcPath();
if(git_path.Length>0 && BFFolderPath.Length>0)
{
index = 0;
RyFiles.RunFile(git_path, "/command:commit", BFFolderPath);
new Thread(Start).Start();
void Start()
{
while (index < 10 && !this.IsDisposed)
{
System.Threading.Thread.Sleep(1000);
var handle = RyForm.GetForegroundWindow();
var path = ryCommon.ProcessExt.GetPath(RyForm.GetProcessId(handle));
index++;
if (path != null && path.Length > 0)
{
var filename = System.IO.Path.GetFileName(path);
if (filename == "TortoiseGitProc.exe")
{
this.Invoke(new Action(() =>
{
SendKeys.Send("^v");
}));
break;
}
}
}
}
}
}
private void BtnCopyHtml_Click(object sender, EventArgs e)
{
RyFiles.CopyToClip(HtmlLog);
}
}
}