Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static string GetTextFromEmbeddedResource(string embeddedResourcePath, As
/// <returns>Text of the file.</returns>
public static string GetTextFromResource(string fileName)
{
return GetTextFromFile(new FileInfo(Path.Combine(ResourcesFolder, fileName)));
return GetTextFromFile(GetResourceFile(fileName));
}

/// <summary>
Expand All @@ -53,7 +53,7 @@ public static string GetTextFromResource(string fileName)
/// <returns>True if exists and false otherwise</returns>
public static bool IsResourceFileExist(string fileName)
{
var fileInfo = new FileInfo(Path.Combine(ResourcesFolder, fileName));
var fileInfo = GetResourceFile(fileName);
return fileInfo.Exists;
}

Expand All @@ -69,5 +69,10 @@ public static string GetTextFromFile(FileInfo fileInfo)
return reader.ReadToEnd();
}
}

private static FileInfo GetResourceFile(string fileName)
{
return new FileInfo(Path.Combine(AppContext.BaseDirectory, ResourcesFolder, fileName));
}
}
}