Fixed the attribute usage and renamed the EnumMgr methods - FromText and ToText.

This commit is contained in:
antiduh
2014-07-11 21:32:06 +00:00
parent 3a134be9df
commit 8c19366314
2 changed files with 4 additions and 4 deletions

View File

@@ -6,7 +6,7 @@ using System.Text;
namespace NSspi
{
[AttributeUsage( AttributeTargets.Enum )]
[AttributeUsage( AttributeTargets.Field )]
public class EnumStringAttribute : Attribute
{
public EnumStringAttribute( string text )
@@ -19,7 +19,7 @@ namespace NSspi
public class EnumMgr
{
public static string Text( Enum value )
public static string ToText( Enum value )
{
FieldInfo field = value.GetType().GetField( value.ToString() );
@@ -35,7 +35,7 @@ namespace NSspi
}
}
public static T Enum<T>( string text )
public static T FromText<T>( string text )
{
FieldInfo[] fields = typeof( T ).GetFields();