using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.Windows.Forms;
using $safeprojectname$.Controls;
namespace $safeprojectname$
{
///
/// Simplified class responsible for making requests to Amazon.com Web service and returning results.
///
///
/// ***Online Web service features are not implemented in this version of the starter kit. Please see the Getting Started documentation to learn how to download an updated version.
///
public class SimpleAmazonWS
{
///
/// Configures defaults for the search request
///
/// Some default values can be changed in the Settings designer without changing code.
public SimpleAmazonWS()
{
}
///
/// Simple search method that returns a list of DVD objects based on the search string argument.
///
/// dvd keyword to search for, e.g. name, actor, or UPC
/// BindingList of DVD search results
///
public BindingList SearchDVDs(string searchString)
{
throw new NotImplementedException("Online Web service features are not implemented in this version of the starter kit. Please see the Getting Started documentation to learn how to download an updated version. ");
}
///
/// Looks up refreshed data about a particular DVD based on a UPC string argument.
///
/// UPC code of the DVD to look up
/// First DVD object found with this matching UPC, or nothing if none were found
///
public DVD RefreshDVDByUPC(string upc)
{
throw new NotImplementedException("Online Web service features are not implemented in this version of the starter kit. Please see the Getting Started documentation to learn how to download an updated version. ");
}
///
/// Utility function to return Amazon's custom date formats into a .NET Date type
///
/// Date string returned by Amazon.com's ProductInfo type
/// Date type converted from custom string, or Date.MinValue if parameter is nothing
///
private string AmazonDateFormatToDateString(string amazonDate)
{
// Format to handle Amazon's convention for date strings; 0 means not set
string[] expectedFormats = { "d", "yyyymmdd", "yyyy0000", "yyyymm00", "yyyy00dd" };
if (amazonDate != null)
{
DateTime date = DateTime.ParseExact(amazonDate, expectedFormats, Application.CurrentCulture, DateTimeStyles.AllowWhiteSpaces);
return date.ToString("yyyy");
}
return null;
}
}
}