diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2012-03-10 07:49:13 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2012-03-10 07:49:13 -0800 |
commit | 6e68095c020f88f6c61b3a76f1fa885ead1e7f15 (patch) | |
tree | 83bfc6d5ff5cddf7144cc85de5b4df755753b724 /src/DotNetOpenAuth.OpenId/OpenId/Extensions/SimpleRegistration/Gender.cs | |
parent | 945b058634609684e72d6ea233d4643dd2f17a32 (diff) | |
parent | 351ecb6678ec3cbd469bfa8076dfdc7aad83e987 (diff) | |
download | DotNetOpenAuth-6e68095c020f88f6c61b3a76f1fa885ead1e7f15.zip DotNetOpenAuth-6e68095c020f88f6c61b3a76f1fa885ead1e7f15.tar.gz DotNetOpenAuth-6e68095c020f88f6c61b3a76f1fa885ead1e7f15.tar.bz2 |
Merge branch 'stylecopUpgrade'
Diffstat (limited to 'src/DotNetOpenAuth.OpenId/OpenId/Extensions/SimpleRegistration/Gender.cs')
-rw-r--r-- | src/DotNetOpenAuth.OpenId/OpenId/Extensions/SimpleRegistration/Gender.cs | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/src/DotNetOpenAuth.OpenId/OpenId/Extensions/SimpleRegistration/Gender.cs b/src/DotNetOpenAuth.OpenId/OpenId/Extensions/SimpleRegistration/Gender.cs index 05cbfbb..c0b1c03 100644 --- a/src/DotNetOpenAuth.OpenId/OpenId/Extensions/SimpleRegistration/Gender.cs +++ b/src/DotNetOpenAuth.OpenId/OpenId/Extensions/SimpleRegistration/Gender.cs @@ -5,10 +5,6 @@ //----------------------------------------------------------------------- namespace DotNetOpenAuth.OpenId.Extensions.SimpleRegistration { - using System; - using DotNetOpenAuth.Messaging; - using DotNetOpenAuth.Messaging.Reflection; - /// <summary> /// Indicates the gender of a user. /// </summary> @@ -23,48 +19,4 @@ namespace DotNetOpenAuth.OpenId.Extensions.SimpleRegistration { /// </summary> Female, } - - /// <summary> - /// Encodes/decodes the Simple Registration Gender type to its string representation. - /// </summary> - internal class GenderEncoder : IMessagePartEncoder { - #region IMessagePartEncoder Members - - /// <summary> - /// Encodes the specified value. - /// </summary> - /// <param name="value">The value. Guaranteed to never be null.</param> - /// <returns> - /// The <paramref name="value"/> in string form, ready for message transport. - /// </returns> - public string Encode(object value) { - var gender = (Gender?)value; - if (gender.HasValue) { - switch (gender.Value) { - case Gender.Male: return Constants.Genders.Male; - case Gender.Female: return Constants.Genders.Female; - } - } - - return null; - } - - /// <summary> - /// Decodes the specified value. - /// </summary> - /// <param name="value">The string value carried by the transport. Guaranteed to never be null, although it may be empty.</param> - /// <returns> - /// The deserialized form of the given string. - /// </returns> - /// <exception cref="FormatException">Thrown when the string value given cannot be decoded into the required object type.</exception> - public object Decode(string value) { - switch (value) { - case Constants.Genders.Male: return SimpleRegistration.Gender.Male; - case Constants.Genders.Female: return SimpleRegistration.Gender.Female; - default: throw new FormatException(); - } - } - - #endregion - } }
\ No newline at end of file |