How can I load an embedded resource as an ITemplate? The LoadTemplate() method only takes a string virtual path, and obviously this will not work for embedded resources.
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Carriage Return (ASCII chr 13) is missing from tex
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
Assuming that your templates are embedded and need to stay that way (which I think you may want to reconsider), here is a function I wrote a while back that I've used successfully many times when dealing with embedded files (mostly .sql files). It converts an embedded resource to a string. You may then need to write your template out to disk.
Example usage:
Your control should look like it:
Then the embedded file:
Then when using the control it will load the embedded resource, so using:
Will create a TextBox.
If you are trying to access a file inside a DLL, see this implementation of VirtualPathProvider.