整理代码
This commit is contained in:
@@ -271,9 +271,25 @@ public static class UIExtensions
|
||||
{
|
||||
return new ContextualHelp(ContextualHelpType.Url, text);
|
||||
}
|
||||
ImageAssist.ExtractResource(helpFileSafeName, text);
|
||||
ExtractResource(helpFileSafeName, text);
|
||||
return new ContextualHelp(ContextualHelpType.ChmFile, text);
|
||||
}
|
||||
/// <summary>
|
||||
/// 提取资源
|
||||
/// </summary>
|
||||
/// <param name="resourceName"></param>
|
||||
/// <param name="path"></param>
|
||||
private static void ExtractResource(string resourceName, string path)
|
||||
{
|
||||
using var manifestResourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName);
|
||||
using var stream = File.Create(path);
|
||||
var array = new byte[8192];
|
||||
int count;
|
||||
while ((count = manifestResourceStream.Read(array, 0, array.Length)) > 0)
|
||||
{
|
||||
stream.Write(array, 0, count);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 添加按钮
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user