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) ); } }