mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-08-11 10:39:42 +00:00
refactor implementation
This commit is contained in:
@@ -8,7 +8,7 @@ namespace ElectronNET.CLI
|
||||
{
|
||||
private const string ResourcePath = "ElectronNET.CLI.{0}";
|
||||
|
||||
public static Stream GetTestResourceFileStream(string folderAndFileInProjectPath)
|
||||
private static Stream GetTestResourceFileStream(string folderAndFileInProjectPath)
|
||||
{
|
||||
var asm = Assembly.GetExecutingAssembly();
|
||||
var resource = string.Format(ResourcePath, folderAndFileInProjectPath);
|
||||
@@ -16,7 +16,7 @@ namespace ElectronNET.CLI
|
||||
return asm.GetManifestResourceStream(resource);
|
||||
}
|
||||
|
||||
public static string GetTestResourceFileContent(string folderAndFileInProjectPath)
|
||||
private static string GetTestResourceFileContent(string folderAndFileInProjectPath)
|
||||
{
|
||||
var asm = Assembly.GetExecutingAssembly();
|
||||
var resource = string.Format(ResourcePath, folderAndFileInProjectPath);
|
||||
@@ -32,5 +32,13 @@ namespace ElectronNET.CLI
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
public static void DeployEmbeddedFile(string targetPath, string file)
|
||||
{
|
||||
using (var fileStream = File.Create(Path.Combine(targetPath, file)))
|
||||
{
|
||||
var streamFromEmbeddedFile = GetTestResourceFileStream("ElectronHost." + file);
|
||||
streamFromEmbeddedFile.CopyTo(fileStream);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user