/// <summary> /// Decodes the base64 encoded members of the Item if necessary. /// The Name property of an Item can be base64 encoded. /// This method also decodes any encoded properties of the Attributes /// associated with the Input Item. /// </summary> /// <param name="inputItem">The Item to be decoded</param> /// <seealso cref="P:Amazon.SimpleDB.Model.Item.NameEncoding" /> /// <seealso cref="P:Amazon.SimpleDB.Util.AmazonSimpleDBUtil.DecodeAttributes" /> public static void DecodeItem(Amazon.SimpleDB.Model.Item inputItem) { if (null == inputItem) { throw new ArgumentNullException("inputItem", "The Item passed in was null"); } string encoding = inputItem.AlternateNameEncoding; if (null != encoding) { if (string.Equals(encoding, base64Str, StringComparison.OrdinalIgnoreCase)) { // The Name is base64 encoded inputItem.Name = AmazonSimpleDBUtil.DecodeBase64String(inputItem.Name); inputItem.AlternateNameEncoding = ""; } } AmazonSimpleDBUtil.DecodeAttributes(inputItem.Attributes); }
/// <summary> /// Decodes the base64 encoded members of the Item if necessary. /// The Name property of an Item can be base64 encoded. /// This method also decodes any encoded properties of the Attributes /// associated with the Input Item. /// </summary> /// <param name="inputItem">The Item to be decoded</param> /// <seealso cref="P:Amazon.SimpleDB.Model.Item.NameEncoding" /> /// <seealso cref="P:Amazon.SimpleDB.Util.AmazonSimpleDBUtil.DecodeAttributes" /> public static void DecodeItem(Amazon.SimpleDB.Model.Item inputItem) { if (null == inputItem) { throw new ArgumentNullException("inputItem", "The Item passed in was null"); } string encoding = inputItem.NameEncoding; if (null != encoding) { if (String.Compare(encoding, base64Str, true) == 0) { // The Name is base64 encoded inputItem.Name = AmazonSimpleDBUtil.DecodeBase64String(inputItem.Name); inputItem.NameEncoding = ""; } } AmazonSimpleDBUtil.DecodeAttributes(inputItem.Attribute); }