/net-Description

Get the DescriptionAttribute text from classes, enum values, properties and others.

Primary LanguageC#

Description

Get the DescriptionAttribute text from classes, enum values, properties and others.

Usage

using System.ComponentModel;
using DescriptionLibrary;

public enum StarterPokemon
{
    [Description("It can go for days without eating a single morsel. In the bulb on its back, it stores energy.")]
    Bulbasaur,

    [Description("The flame at the tip of its tail makes a sound as it burns. You can only hear it in quiet places.")]
    Charmander,

    [Description("Shoots water at prey while in the water. Withdraws into its shell when in danger.")]
    Squirtle,
}

Console.WriteLine("Bulbasaur: {0}", StarterPokemon.Bulbasaur.Description());
Console.WriteLine("Charmander: {0}", StarterPokemon.Charmander.Description());
Console.WriteLine("Squirtle: {0}", StarterPokemon.Squirtle.Description());