Skip to content

pwujczyk/ProductivityTools.DescriptionValue

Repository files navigation

Description attribute value

Library allows to get description content from DescriptionAttribute.

Currently it retrieve value from following elements:

  • Property

  • Field

  • Method

  • Enum

Usage example:

typeof(TestClass).GetPropertyDescription("PropertyName"); 
typeof(TestClass).GetFieldDescription("FieldName"); 
typeof(TestClass).GetMethodDescription("Method1"); 
testClass.Enum.GetDescription();

all methods:

  • extension method Description for enum
  • extension method Description for Type
  • extension method PropertyDescription for Property
  • extension method MethodDescription for Method
  • extension method FieldDescription for Field

Description is not existing

Method will throw an exception if we will try to get value from item which doesn't have exception set up. You could use DescriptionExists* methods to validate before using. Methods:

  • extension method DescriptionExists for enum
  • extension method DescriptionExists for Type
  • extension method PropertyDescriptionExists for Property
  • extension method MethodDescriptionExists for Method
  • extension method FieldDescriptionExists for Field

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages