------ #### SuperDesign V3.0.2412.2101 - *.[新增]新增支持多选更新日志列表,合并生成Html日志。 - *.[改进]支持设置解决方案中的哪些项目日志不显示在Html日志列表里。 - *.[改进]打开时默认选中主项目的更新日志Tab。 - *.[修复]修复创建项目时的版权日期不会随着当前日期更新的BUG。 - *.[修复]修复创建项目时引用的RaUI项目文件无法转换成RaUI.dll的BUG。 - *.[修复]修复连续快速打开项目,会导致软件多开的BUG。
79 lines
2.7 KiB
C#
79 lines
2.7 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.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)
|
|
{
|
|
RyFiles.RunFile(git_path, "/command:commit", BFFolderPath);
|
|
using (var bg = new BackgroundWorker())
|
|
{
|
|
bg.DoWork += delegate { System.Threading.Thread.Sleep(1000); };//180秒后,3分钟
|
|
bg.RunWorkerCompleted += delegate {
|
|
var handle = RyForm.GetForegroundWindow();
|
|
var path = ryCommon.ProcessExt.GetPath(RyForm.GetProcessId(handle));
|
|
if (path != null && path.Length > 0)
|
|
{
|
|
var filename = System.IO.Path.GetFileName(path);
|
|
if (filename == "TortoiseGitProc.exe")
|
|
{
|
|
SendKeys.Send("^v");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
index++;
|
|
if(index>10 || this.IsDisposed)
|
|
{
|
|
return;
|
|
}
|
|
System.Threading.Thread.Sleep(1000);
|
|
}
|
|
}; // 线程执行完成后会执行 RunWorkerCompleted 事伯的代码块
|
|
bg.RunWorkerAsync();
|
|
}
|
|
}
|
|
}
|
|
|
|
private void BtnCopyHtml_Click(object sender, EventArgs e)
|
|
{
|
|
RyFiles.CopyToClip(HtmlLog);
|
|
}
|
|
}
|
|
}
|