Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/simoncropp/simpleinfoname

Generates simple names for *Infos (types, parameters, properties, fields, and methods)
https://github.com/simoncropp/simpleinfoname

Last synced: 8 days ago
JSON representation

Generates simple names for *Infos (types, parameters, properties, fields, and methods)

Awesome Lists containing this project

README

        

# SimpleInfoName

[![Build status](https://ci.appveyor.com/api/projects/status/dl7snkk70b964ke4/branch/main?svg=true)](https://ci.appveyor.com/project/SimonCropp/SimpleInfoName)
[![NuGet Status](https://img.shields.io/nuget/v/SimpleInfoName.svg)](https://www.nuget.org/packages/SimpleInfoName/)

Generates names for reflection infos. Adds a `SimpleName()` extension method to the following types.

* Type
* ParameterInfo
* PropertyInfo
* FieldInfo
* MethodInfo
* ConstructorInfo

**See [Milestones](../../milestones?state=closed) for release notes.**

## NuGet package

* https://nuget.org/packages/SimpleInfoName/

## Usage

Given a class definition of:


```cs
namespace MyNamespace
{
public class Parent;

public class Target : Parent
{
public Target()
{
}

public string Property { get; set; } = null!;
public string field = null!;

public void Method(List parameter)
{
}
}
}
```
snippet source | anchor

And a constructed type of `Target`.

The simple names would be:

| | |
| - | - |
| Type | `Target` |
| | Compared to `Type.FullName` of
`MyNamespace.Target'1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]` |
| Constructor | `Target.ctor()` |
| Method | `Target.Method(List parameter)` |
| Parameter | `'parameter' of Target.Method(List parameter)` |
| Field | `Target.field` |
| Property | `Target.Property` |

## Icon

[Complex](https://thenounproject.com/term/complex/2270599/) designed by [auttapol](https://thenounproject.com/monsterku69) from [The Noun Project](https://thenounproject.com).