https://github.com/havendv/h.resources.generator
Generates a static class with all Embedded resources
https://github.com/havendv/h.resources.generator
dotnet generator net5 netcore netframework resourcer resources
Last synced: 6 months ago
JSON representation
Generates a static class with all Embedded resources
- Host: GitHub
- URL: https://github.com/havendv/h.resources.generator
- Owner: HavenDV
- License: mit
- Created: 2021-04-10T02:32:26.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-04-08T00:46:08.000Z (6 months ago)
- Last Synced: 2025-04-12T12:55:55.095Z (6 months ago)
- Topics: dotnet, generator, net5, netcore, netframework, resourcer, resources
- Language: C#
- Homepage:
- Size: 307 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [H.Resources.Generator](https://github.com/HavenDV/H.Resources.Generator/)
[](https://github.com/HavenDV/H.Resources.Generator/search?l=C%23&o=desc&s=&type=Code)
[](LICENSE.md)
[](https://github.com/dotnet/standard/blob/master/docs/versions/netstandard2.0.md)
[](https://github.com/HavenDV/H.Resources.Generator/actions?query=workflow%3A%22.NET%22)### Nuget
[](https://www.nuget.org/packages/H.Resources.Generator/)
```
Install-Package H.Resources.Generator
```### Usage
Just install this package and add any resources to Resources subfolder. After you can use resources in the code:
```cs
var bytes = H.Resources.name_png.AsBytes();
// or
var text = H.Resources.name_txt.AsText();
```### Advanced Usage
```xml
true
```
After it, use resource in code:
```cs
var image = H.Resources.image_name_png.AsImage();
// or
var bytes = H.Resources.image_name_png.AsBytes();
```Available methods:
- System.Drawing.Image AsImage() (only if `HResourcesGenerator_WithSystemDrawing` is true)
- System.IO.Stream AsStream()
- string AsString()
- byte[] AsBytes()Global options(Default values are provided and can be omitted):
```xmlH
internal
Resources
true
false```
By default, it includes this code:
```xml
```
You can disable this behavior with `false`### Alternatives
- [Resourcer.Fody](https://github.com/Fody/Resourcer)### Contacts
* [mail](mailto:havendv@gmail.com)