-
-
Notifications
You must be signed in to change notification settings - Fork 259
Open
Description
DL code (as zip) -> does not dl litehtml folder content.
After correcting this and using Example.WPF, example builds but throws exception trying to find embedded resource "master.css" in LiteHtmlSharp.Wpf.IncludedMasterCss.GetMasterCssResource().
It was unclear if the resource was supposed to be in LiteHtmlSharp.Wpf (which it is not), LiteHtmlSharp (which it is) or both.
I hacked it to read the file directly and the WPF example worked (nicely)!
A 'cleaner' hack is;
namespace LiteHtmlSharp.Wpf
{
public static class IncludedMasterCss
{
public static string CssString => _includedMasterCss.Value;
static Lazy<string> _includedMasterCss = new Lazy<string>(GetMasterCssResource);
static string GetMasterCssResource()
{
#if gtrm
var assembly = Assembly.GetExecutingAssembly();
var masterCssResourceName = assembly.GetManifestResourceNames().FirstOrDefault(s => s.Contains("master.css"));
using (var reader = new StreamReader(assembly.GetManifestResourceStream(masterCssResourceName), Encoding.UTF8))
{
return reader.ReadToEnd();
}
#else
return LiteHtmlSharp.IncludedMasterCss.CssString;
#endif
}
}
}
Metadata
Metadata
Assignees
Labels
No labels