From 8c19366314836eba47a0a5efd6481a20e79f6b1a Mon Sep 17 00:00:00 2001 From: antiduh Date: Fri, 11 Jul 2014 21:32:06 +0000 Subject: [PATCH] Fixed the attribute usage and renamed the EnumMgr methods - FromText and ToText. --- NSspi/EnumMgr.cs | 6 +++--- NSspi/SSPIException.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/NSspi/EnumMgr.cs b/NSspi/EnumMgr.cs index cdc0633..c4cd337 100644 --- a/NSspi/EnumMgr.cs +++ b/NSspi/EnumMgr.cs @@ -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( string text ) + public static T FromText( string text ) { FieldInfo[] fields = typeof( T ).GetFields(); diff --git a/NSspi/SSPIException.cs b/NSspi/SSPIException.cs index e2e466f..f9d3dab 100644 --- a/NSspi/SSPIException.cs +++ b/NSspi/SSPIException.cs @@ -74,7 +74,7 @@ namespace NSspi "{0}. Error Code = '{1:X}' - \"{2}\".", this.message, this.errorCode, - EnumMgr.Text(this.errorCode) + EnumMgr.ToText(this.errorCode) ); } }