Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 7 days 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 3 years ago)
- Default Branch: master
- Last Pushed: 2024-11-04T23:56:20.000Z (11 days ago)
- Last Synced: 2024-11-05T00:30:34.840Z (11 days ago)
- Topics: dotnet, generator, net5, netcore, netframework, resourcer, resources
- Language: C#
- Homepage:
- Size: 268 KB
- Stars: 6
- Watchers: 3
- 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/)
[![Language](https://img.shields.io/badge/language-C%23-blue.svg?style=flat-square)](https://github.com/HavenDV/H.Resources.Generator/search?l=C%23&o=desc&s=&type=Code)
[![License](https://img.shields.io/github/license/HavenDV/H.Resources.Generator.svg?label=License&maxAge=86400)](LICENSE.md)
[![Requirements](https://img.shields.io/badge/Requirements-.NET%20Standard%202.0-blue.svg)](https://github.com/dotnet/standard/blob/master/docs/versions/netstandard2.0.md)
[![Build Status](https://github.com/HavenDV/H.Resources.Generator/workflows/.NET/badge.svg?branch=master)](https://github.com/HavenDV/H.Resources.Generator/actions?query=workflow%3A%22.NET%22)### Nuget
[![NuGet](https://img.shields.io/nuget/dt/H.Resources.Generator.svg?style=flat-square&label=H.Resources.Generator)](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:[email protected])