mirror of
https://github.com/jie65535/GrasscutterCommandGenerator.git
synced 2025-12-08 08:38:23 +08:00
Separate pages
This commit is contained in:
25
Source/GrasscutterTools/Utils/Common.cs
Normal file
25
Source/GrasscutterTools/Utils/Common.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
|
||||
using GrasscutterTools.Game;
|
||||
using GrasscutterTools.OpenCommand;
|
||||
|
||||
namespace GrasscutterTools.Utils
|
||||
{
|
||||
internal static class Common
|
||||
{
|
||||
/// <summary>
|
||||
/// 应用版本
|
||||
/// </summary>
|
||||
public static Version AppVersion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 命令版本
|
||||
/// </summary>
|
||||
public static CommandVersion CommandVersion { get; } = CommandVersion.Latest();
|
||||
|
||||
/// <summary>
|
||||
/// 开放命令接口
|
||||
/// </summary>
|
||||
public static OpenCommandAPI OC { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
using System.Linq;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using GrasscutterTools.Properties;
|
||||
|
||||
namespace GrasscutterTools.Utils
|
||||
{
|
||||
public static class UIUtil
|
||||
@@ -41,5 +44,39 @@ namespace GrasscutterTools.Utils
|
||||
}
|
||||
listBox.EndUpdate();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 使用浏览器打开网址
|
||||
/// </summary>
|
||||
/// <param name="url">网址</param>
|
||||
public static void OpenURL(string url)
|
||||
{
|
||||
try
|
||||
{
|
||||
System.Diagnostics.Process.Start(url);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
MessageBox.Show(Resources.BrowserOpenFailedTip + "\n " + url,
|
||||
Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 提示气泡对象
|
||||
/// </summary>
|
||||
private readonly static ToolTip TTip = new ToolTip();
|
||||
|
||||
/// <summary>
|
||||
/// 在指定控件上显示提示气泡
|
||||
/// </summary>
|
||||
/// <param name="message">消息</param>
|
||||
/// <param name="control">控件</param>
|
||||
public static void ShowTip(string message, Control control)
|
||||
{
|
||||
TTip.Show(message, control, 0, control.Size.Height, 3000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user