Skip to content

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

License

Notifications You must be signed in to change notification settings

SimonCropp/SimpleInfoName

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SimpleInfoName

Build status NuGet Status

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

  • Type
  • ParameterInfo
  • PropertyInfo
  • FieldInfo
  • MethodInfo
  • ConstructorInfo

See Milestones for release notes.

NuGet package

Usage

Given a class definition of:

namespace MyNamespace
{
    public class Parent<T>;

    public class Target<K> : Parent<int>
    {
        public Target()
        {
        }

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

        public void Method<Y, D>(List<D> parameter)
        {
        }
    }
}

snippet source | anchor

And a constructed type of Target<int>.

The simple names would be:

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

Icon

Complex designed by auttapol from The Noun Project.

About

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

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Contributors 3

  •  
  •  
  •  

Languages