//----------------------------------------------------------------------- // // Copyright (c) Andrew Arnott. All rights reserved. // //----------------------------------------------------------------------- namespace DotNetOAuth.Messaging.Reflection { using System; /// /// A pair of conversion functions to map some type to a string and back again. /// internal struct ValueMapping { /// /// The mapping function that converts some custom type to a string. /// internal Func ValueToString; /// /// The mapping function that converts a string to some custom type. /// internal Func StringToValue; /// /// Initializes a new instance of the struct. /// /// The mapping function that converts some custom type to a string. /// The mapping function that converts a string to some custom type. internal ValueMapping(Func toString, Func toValue) { if (toString == null) { throw new ArgumentNullException("toString"); } if (toValue == null) { throw new ArgumentNullException("toValue"); } this.ValueToString = toString; this.StringToValue = toValue; } } }