/// <summary> /// Decodes the base64 encoded properties of the Attribute. /// The Name and/or Value properties of an Attribute can be base64 encoded. /// </summary> /// <param name="inputAttribute">The properties of this Attribute will be decoded</param> /// <seealso cref="P:Amazon.SimpleDB.Model.Attribute.NameEncoding" /> /// <seealso cref="P:Amazon.SimpleDB.Model.Attribute.ValueEncoding" /> public static void DecodeAttribute(Amazon.SimpleDB.Model.Attribute inputAttribute) { if (null == inputAttribute) { throw new ArgumentNullException("inputAttribute", "The Attribute passed in was null"); } string encoding = inputAttribute.NameEncoding; if (null != encoding) { //if (String.Compare(encoding, base64Str, true) == 0) if (String.Compare(encoding, base64Str, StringComparison.CurrentCultureIgnoreCase) == 0) { // The Name is base64 encoded inputAttribute.Name = AmazonSimpleDBUtil.DecodeBase64String(inputAttribute.Name); inputAttribute.NameEncoding = ""; } } encoding = inputAttribute.ValueEncoding; if (null != encoding) { //if (String.Compare(encoding, base64Str, true) == 0) if (String.Compare(encoding, base64Str, StringComparison.CurrentCultureIgnoreCase) == 0) { // The Value is base64 encoded inputAttribute.Value = AmazonSimpleDBUtil.DecodeBase64String(inputAttribute.Value); inputAttribute.ValueEncoding = ""; } } }
/// <summary> /// Decodes the base64 encoded properties of the Attribute. /// The Name and/or Value properties of an Attribute can be base64 encoded. /// </summary> /// <param name="inputAttribute">The properties of this Attribute will be decoded</param> /// <seealso cref="P:Amazon.SimpleDB.Model.Attribute.NameEncoding" /> /// <seealso cref="P:Amazon.SimpleDB.Model.Attribute.ValueEncoding" /> public static void DecodeAttribute(Amazon.SimpleDB.Model.Attribute inputAttribute) { if (null == inputAttribute) { throw new ArgumentNullException("inputAttribute", "The Attribute passed in was null"); } string encoding = inputAttribute.AlternateNameEncoding; if (null != encoding) { if (string.Equals(encoding, base64Str, StringComparison.OrdinalIgnoreCase)) { // The Name is base64 encoded inputAttribute.Name = AmazonSimpleDBUtil.DecodeBase64String(inputAttribute.Name); inputAttribute.AlternateNameEncoding = ""; } } encoding = inputAttribute.AlternateValueEncoding; if (null != encoding) { if (string.Equals(encoding, base64Str, StringComparison.OrdinalIgnoreCase)) { // The Value is base64 encoded inputAttribute.Value = AmazonSimpleDBUtil.DecodeBase64String(inputAttribute.Value); inputAttribute.AlternateValueEncoding = ""; } } }