Remove unused using statements

This commit is contained in:
Vasily Vasilyev 2019-05-14 21:53:39 +03:00
parent e6647fa196
commit cbb2569313
27 changed files with 129 additions and 222 deletions

View File

@ -1,11 +1,5 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace SteamStorefrontAPI.Classes namespace SteamStorefrontAPI.Classes
{ {

View File

@ -1,11 +1,4 @@
using System; using Newtonsoft.Json;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace SteamStorefrontAPI.Classes namespace SteamStorefrontAPI.Classes
{ {

View File

@ -1,11 +1,4 @@
using System; using Newtonsoft.Json;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace SteamStorefrontAPI.Classes namespace SteamStorefrontAPI.Classes
{ {

View File

@ -1,11 +1,5 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace SteamStorefrontAPI.Classes namespace SteamStorefrontAPI.Classes
{ {

View File

@ -1,11 +1,5 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace SteamStorefrontAPI.Classes namespace SteamStorefrontAPI.Classes
{ {

View File

@ -1,11 +1,4 @@
using System; using Newtonsoft.Json;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace SteamStorefrontAPI.Classes namespace SteamStorefrontAPI.Classes
{ {

View File

@ -1,11 +1,4 @@
using System; using Newtonsoft.Json;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace SteamStorefrontAPI.Classes namespace SteamStorefrontAPI.Classes
{ {

View File

@ -1,11 +1,4 @@
using System; using Newtonsoft.Json;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace SteamStorefrontAPI.Classes namespace SteamStorefrontAPI.Classes
{ {

View File

@ -1,12 +1,8 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization; using System.Globalization;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Converters; using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
namespace SteamStorefrontAPI.Classes namespace SteamStorefrontAPI.Classes
{ {

View File

@ -1,11 +1,4 @@
using System; using Newtonsoft.Json;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace SteamStorefrontAPI.Classes namespace SteamStorefrontAPI.Classes
{ {

View File

@ -1,11 +1,4 @@
using System; using Newtonsoft.Json;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace SteamStorefrontAPI.Classes namespace SteamStorefrontAPI.Classes
{ {

View File

@ -1,11 +1,5 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace SteamStorefrontAPI.Classes namespace SteamStorefrontAPI.Classes
{ {

View File

@ -1,9 +1,5 @@
using Newtonsoft.Json; using System;
using System; using Newtonsoft.Json;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SteamStorefrontAPI.Classes namespace SteamStorefrontAPI.Classes
{ {

View File

@ -1,11 +1,4 @@
using System; using Newtonsoft.Json;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace SteamStorefrontAPI.Classes namespace SteamStorefrontAPI.Classes
{ {

View File

@ -1,11 +1,4 @@
using System; using Newtonsoft.Json;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace SteamStorefrontAPI.Classes namespace SteamStorefrontAPI.Classes
{ {

View File

@ -1,11 +1,5 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace SteamStorefrontAPI.Classes namespace SteamStorefrontAPI.Classes
{ {

View File

@ -1,11 +1,4 @@
using System; using Newtonsoft.Json;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace SteamStorefrontAPI.Classes namespace SteamStorefrontAPI.Classes
{ {

View File

@ -1,8 +1,4 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization; using System.Globalization;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Converters; using Newtonsoft.Json.Converters;
@ -26,9 +22,6 @@ namespace SteamStorefrontAPI.Classes
[JsonProperty("layout")] [JsonProperty("layout")]
public string Layout { get; set; } public string Layout { get; set; }
//[JsonProperty("status")]
//public int Status { get; set; }
public FeaturedApps() public FeaturedApps()
{ {
this.LargeCapsules = new List<AppInfo>(); this.LargeCapsules = new List<AppInfo>();

View File

@ -1,8 +1,5 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization; using System.Globalization;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Converters; using Newtonsoft.Json.Converters;

View File

@ -1,11 +1,4 @@
using System; using Newtonsoft.Json;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace SteamStorefrontAPI.Classes namespace SteamStorefrontAPI.Classes
{ {

View File

@ -1,11 +1,5 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace SteamStorefrontAPI.Classes namespace SteamStorefrontAPI.Classes
{ {

View File

@ -1,8 +1,4 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization; using System.Globalization;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Converters; using Newtonsoft.Json.Converters;

View File

@ -1,23 +1,21 @@
using Newtonsoft.Json.Linq; using System.Net.Http;
using SteamStorefrontAPI.Classes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
using SteamStorefrontAPI.Classes;
namespace SteamStorefrontAPI namespace SteamStorefrontAPI
{ {
/// <summary> /// <summary>
/// Endpoint returning details for an application in the steam store.</summary> /// Endpoint returning details for an application in the steam store.
/// </summary>
public static class AppDetails public static class AppDetails
{ {
private static HttpClient client = new HttpClient(); private static HttpClient client = new HttpClient();
private const string steamBaseUri = "http://store.steampowered.com/api/appdetails"; private const string steamBaseUri = "http://store.steampowered.com/api/appdetails";
/// <summary> /// <summary>
/// Retrieves details for the specified application via an asynchronous operation.</summary> /// Retrieves details for the specified application via an asynchronous operation.
/// </summary>
/// <param name="AppId">Steam App ID.</param> /// <param name="AppId">Steam App ID.</param>
public static async Task<SteamApp> GetAsync(int AppId) public static async Task<SteamApp> GetAsync(int AppId)
{ {
@ -25,24 +23,38 @@ namespace SteamStorefrontAPI
} }
/// <summary> /// <summary>
/// Retrieves details for the specified application via an asynchronous operation.</summary> /// Retrieves details for the specified application via an asynchronous operation.
/// </summary>
/// <param name="AppId">Steam App ID.</param> /// <param name="AppId">Steam App ID.</param>
/// <param name="CountryCode">Two letter country code to customise currency and date values.</param> /// <param name="CountryCode">
/// Two letter country code to customise currency and date values.
/// </param>
public static async Task<SteamApp> GetAsync(int AppId, string CountryCode) public static async Task<SteamApp> GetAsync(int AppId, string CountryCode)
{ {
return await GetAsync(AppId, CountryCode, ""); return await GetAsync(AppId, CountryCode, "");
} }
/// <summary> /// <summary>
/// Retrieves details for the specified application via an asynchronous operation.</summary> /// Retrieves details for the specified application via an asynchronous operation.
/// </summary>
/// <param name="AppId">Steam App ID.</param> /// <param name="AppId">Steam App ID.</param>
/// <param name="CountryCode">Two letter country code to customise currency and date values.</param> /// <param name="CountryCode">
/// <param name="Language">Full name of the language in english used for string localization e.g. title, description, release dates.</param> /// Two letter country code to customise currency and date values.
/// </param>
/// <param name="Language">
/// Full name of the language in english used for string localization e.g. title,
/// description, release dates.
/// </param>
public static async Task<SteamApp> GetAsync(int AppId, string CountryCode, string Language) public static async Task<SteamApp> GetAsync(int AppId, string CountryCode, string Language)
{ {
string steamUri = $"{steamBaseUri}?appids={AppId}"; string steamUri = $"{steamBaseUri}?appids={AppId}";
steamUri = string.IsNullOrWhiteSpace(CountryCode) ? steamUri : $"{steamUri}&cc={CountryCode}"; steamUri = string.IsNullOrWhiteSpace(CountryCode)
steamUri = string.IsNullOrWhiteSpace(Language) ? steamUri : $"{steamUri}&l={Language.ToLower()}"; ? steamUri
: $"{steamUri}&cc={CountryCode}";
steamUri = string.IsNullOrWhiteSpace(Language)
? steamUri
: $"{steamUri}&l={Language.ToLower()}";
var response = await client.GetAsync(steamUri); var response = await client.GetAsync(steamUri);
if (!response.IsSuccessStatusCode) { return null; } if (!response.IsSuccessStatusCode) { return null; }

View File

@ -1,44 +1,53 @@
using Newtonsoft.Json.Linq; using System.Net.Http;
using SteamStorefrontAPI.Classes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
using SteamStorefrontAPI.Classes;
namespace SteamStorefrontAPI namespace SteamStorefrontAPI
{ {
/// <summary> /// <summary>
/// Endpoint returning a list of featured items in the steam store.</summary> /// Endpoint returning a list of featured items in the steam store.
/// </summary>
public static class Featured public static class Featured
{ {
private static HttpClient client = new HttpClient(); private static HttpClient client = new HttpClient();
private const string steamBaseUri = "https://store.steampowered.com/api/featured"; private const string steamBaseUri = "https://store.steampowered.com/api/featured";
/// <summary> /// <summary>
/// Retrieves a list of featured items via an asynchronous operation.</summary> /// Retrieves a list of featured items via an asynchronous operation.
/// </summary>
public static async Task<FeaturedApps> GetAsync() public static async Task<FeaturedApps> GetAsync()
{ {
return await GetAsync(null, null); return await GetAsync(null, null);
} }
/// <summary> /// <summary>
/// Retrieves a list of featured items via an asynchronous operation.</summary> /// Retrieves a list of featured items via an asynchronous operation.
/// <param name="CountryCode">Two letter country code to customise currency and date values.</param> /// </summary>
/// <param name="CountryCode">
/// Two letter country code to customise currency and date values.
/// </param>
public static async Task<FeaturedApps> GetAsync(string CountryCode) public static async Task<FeaturedApps> GetAsync(string CountryCode)
{ {
return await GetAsync(CountryCode, null); return await GetAsync(CountryCode, null);
} }
/// <summary> /// <summary>
/// Retrieves a list of featured items via an asynchronous operation.</summary> /// Retrieves a list of featured items via an asynchronous operation.
/// <param name="CountryCode">Two letter country code to customise currency and date values.</param> /// </summary>
/// <param name="Language">Full name of the language in english used for string localization e.g. name, description.</param> /// <param name="CountryCode">
/// Two letter country code to customise currency and date values.
/// </param>
/// <param name="Language">
/// Full name of the language in english used for string localization e.g. name,
/// description.
/// </param>
public static async Task<FeaturedApps> GetAsync(string CountryCode, string Language) public static async Task<FeaturedApps> GetAsync(string CountryCode, string Language)
{ {
string steamUri = steamBaseUri; string steamUri = steamBaseUri;
steamUri = string.IsNullOrWhiteSpace(CountryCode) ? steamUri : $"{steamUri}?cc={CountryCode}"; steamUri = string.IsNullOrWhiteSpace(CountryCode)
? steamUri
: $"{steamUri}?cc={CountryCode}";
if (!string.IsNullOrWhiteSpace(Language)) if (!string.IsNullOrWhiteSpace(Language))
{ {

View File

@ -1,44 +1,54 @@
using Newtonsoft.Json.Linq; using System.Collections.Generic;
using SteamStorefrontAPI.Classes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http; using System.Net.Http;
using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
using SteamStorefrontAPI.Classes;
namespace SteamStorefrontAPI namespace SteamStorefrontAPI
{ {
/// <summary> /// <summary>
/// Endpoint returning a list of featured items, grouped by category, in the steam store.</summary> /// Endpoint returning a list of featured items, grouped by category, in the steam store.
/// </summary>
public static class FeaturedCategories public static class FeaturedCategories
{ {
private static HttpClient client = new HttpClient(); private static HttpClient client = new HttpClient();
private const string steamBaseUri = "https://store.steampowered.com/api/featuredcategories"; private const string steamBaseUri = "https://store.steampowered.com/api/featuredcategories";
/// <summary> /// <summary>
/// Retrieves a list of featured items, grouped by category, via an asynchronous operation.</summary> /// Retrieves a list of featured items, grouped by category, via an asynchronous operation.
/// </summary>
public static async Task<IEnumerable<FeaturedCategory>> GetAsync() public static async Task<IEnumerable<FeaturedCategory>> GetAsync()
{ {
return await GetAsync(null, null); return await GetAsync(null, null);
} }
/// <summary> /// <summary>
/// Retrieves a list of featured items, grouped by category, via an asynchronous operation.</summary> /// Retrieves a list of featured items, grouped by category, via an asynchronous operation.
/// <param name="CountryCode">Two letter country code to customise currency and date values.</param> /// </summary>
/// <param name="CountryCode">
/// Two letter country code to customise currency and date values.
/// </param>
public static async Task<IEnumerable<FeaturedCategory>> GetAsync(string CountryCode) public static async Task<IEnumerable<FeaturedCategory>> GetAsync(string CountryCode)
{ {
return await GetAsync(CountryCode, null); return await GetAsync(CountryCode, null);
} }
/// <summary> /// <summary>
/// Retrieves a list of featured items, grouped by category, via an asynchronous operation.</summary> /// Retrieves a list of featured items, grouped by category, via an asynchronous operation.
/// <param name="CountryCode">Two letter country code to customise currency and date values.</param> /// </summary>
/// <param name="Language">Full name of the language in english used for string localization e.g. name, description.</param> /// <param name="CountryCode">Two letter country code to customise currency and date values.
public static async Task<IEnumerable<FeaturedCategory>> GetAsync(string CountryCode, string Language) /// </param>
/// <param name="Language">
/// Full name of the language in english used for string localization e.g. name,
/// description.
/// </param>
public static async Task<IEnumerable<FeaturedCategory>> GetAsync(string CountryCode,
string Language)
{ {
string steamUri = steamBaseUri; string steamUri = steamBaseUri;
steamUri = string.IsNullOrWhiteSpace(CountryCode) ? steamUri : $"{steamUri}?cc={CountryCode}"; steamUri = string.IsNullOrWhiteSpace(CountryCode)
? steamUri
: $"{steamUri}?cc={CountryCode}";
if (!string.IsNullOrWhiteSpace(Language)) if (!string.IsNullOrWhiteSpace(Language))
{ {

View File

@ -1,23 +1,21 @@
using Newtonsoft.Json.Linq; using System.Net.Http;
using SteamStorefrontAPI.Classes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
using SteamStorefrontAPI.Classes;
namespace SteamStorefrontAPI namespace SteamStorefrontAPI
{ {
/// <summary> /// <summary>
/// Endpoint returning details for a package in the steam store.</summary> /// Endpoint returning details for a package in the steam store.
/// </summary>
public static class PackageDetails public static class PackageDetails
{ {
private static HttpClient client = new HttpClient(); private static readonly HttpClient client = new HttpClient();
private const string steamBaseUri = "http://store.steampowered.com/api/packagedetails"; private const string steamBaseUri = "http://store.steampowered.com/api/packagedetails";
/// <summary> /// <summary>
/// Retrieves details for the specified package via an asynchronous operation.</summary> /// Retrieves details for the specified package via an asynchronous operation.
/// </summary>
/// <param name="PackageId">Steam package ID.</param> /// <param name="PackageId">Steam package ID.</param>
public static async Task<PackageInfo> GetAsync(int PackageId) public static async Task<PackageInfo> GetAsync(int PackageId)
{ {
@ -25,24 +23,39 @@ namespace SteamStorefrontAPI
} }
/// <summary> /// <summary>
/// Retrieves details for the specified package via an asynchronous operation.</summary> /// Retrieves details for the specified package via an asynchronous operation.
/// </summary>
/// <param name="PackageId">Steam package ID.</param> /// <param name="PackageId">Steam package ID.</param>
/// <param name="CountryCode">Two letter country code to customise currency and date values.</param> /// <param name="CountryCode">
/// Two letter country code to customise currency and date values.
/// </param>
public static async Task<PackageInfo> GetAsync(int PackageId, string CountryCode) public static async Task<PackageInfo> GetAsync(int PackageId, string CountryCode)
{ {
return await GetAsync(PackageId, CountryCode, null); return await GetAsync(PackageId, CountryCode, null);
} }
/// <summary> /// <summary>
/// Retrieves details for the specified package via an asynchronous operation.</summary> /// Retrieves details for the specified package via an asynchronous operation.
/// </summary>
/// <param name="PackageId">Steam package ID.</param> /// <param name="PackageId">Steam package ID.</param>
/// <param name="CountryCode">Two letter country code to customise currency and date values.</param> /// <param name="CountryCode">
/// <param name="Language">Full name of the language in english used for string localization e.g. title, description, release dates.</param> /// Two letter country code to customise currency and date values.
public static async Task<PackageInfo> GetAsync(int PackageId, string CountryCode, string Language) /// </param>
/// <param name="Language">
/// Full name of the language in english used for string localization e.g. title,
/// description, release dates.
/// </param>
public static async Task<PackageInfo> GetAsync(int PackageId, string CountryCode,
string Language)
{ {
string steamUri = $"{steamBaseUri}?packageids={PackageId}"; string steamUri = $"{steamBaseUri}?packageids={PackageId}";
steamUri = string.IsNullOrWhiteSpace(CountryCode) ? steamUri : $"{steamUri}&cc={CountryCode}"; steamUri = string.IsNullOrWhiteSpace(CountryCode)
steamUri = string.IsNullOrWhiteSpace(Language) ? steamUri : $"{steamUri}&l={Language.ToLower()}"; ? steamUri
: $"{steamUri}&cc={CountryCode}";
steamUri = string.IsNullOrWhiteSpace(Language)
? steamUri
: $"{steamUri}&l={Language.ToLower()}";
var response = await client.GetAsync(steamUri); var response = await client.GetAsync(steamUri);
if (!response.IsSuccessStatusCode) { return null; } if (!response.IsSuccessStatusCode) { return null; }

View File

@ -1,10 +1,8 @@
using SteamStorefrontAPI; using System.Collections.Generic;
using SteamStorefrontAPI.Classes;
using System;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using SteamStorefrontAPI;
using SteamStorefrontAPI.Classes;
namespace SteamStorefrontConsole namespace SteamStorefrontConsole