Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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):
```xml

H
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])