简体   繁体   English

WPF和Smith HTML编辑器 - 字体列表为空

[英]WPF and Smith HTML Editor - Font list is empty

So since there's no real guide or explanation of how to use the Smith's Html Editor on project website, I've used source to build the .dll and then referenced it in my project. 因为没有关于如何在项目网站上使用Smith的Html编辑器的真实指导或解释,我使用source来构建.dll然后在我的项目中引用它。

I managed to get the binding and the editor working, however list of fonts is empty. 我设法得到绑定和编辑器工作,但字体列表是空的。

在此输入图像描述

Has anyone encountered this ever? 有没有人遇到过这个?

Thanks in advance! 提前致谢!

Alright, I think I've found the error. 好吧,我想我发现了错误。 I've been using "PrettyLib" for .NET which moves .dll's and other configuration files into specific folder of the installation (or debug) directory. 我一直在使用“PrettyLib”for .NET,它将.dll和其他配置文件移动到安装(或调试)目录的特定文件夹中。 (usually \\lib\\ ) (通常\\lib\\

In the HtmlEditor.xaml.cs of the source code, there's a InitStyles() method which basically reads the config file with XmlReader and then populates the comboboxes for Font Family and Font Size. 在源代码的HtmlEditor.xaml.cs中,有一个InitStyles()方法,它基本上用XmlReader读取配置文件,然后填充字体系列和字体大小的组合框。

Creator of the Editor used pretty specific location of the configuration file, which is just "smithhtmleditor.config.xml" - I assume root of the project. 编辑器的创建者使用配置文件的非常具体的位置,这只是"smithhtmleditor.config.xml" - 我假设项目的根。

I used the 我用了

Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]) + "\\lib\\" + ConfigPath)

Which reads the location of where Application is installed at and adds \\lib\\smithhtmleditor.config.xml 其中读取安装Application的位置,并添加\\lib\\smithhtmleditor.config.xml

Instead of old 而不是老

XmlTextReader.Create(ConfigPath)

I cleaned, rebuilt the solution and the new dll worked as intended. 我清理,重建解决方案,新的dll按预期工作。

Edit: Sometimes I wish I knew why people downvote for no specific reason. 编辑:有时我希望我知道为什么人们没有特别的原因而投票。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM