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.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace SteamStorefrontAPI.Classes
{

View File

@ -1,11 +1,4 @@
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.Converters;
using Newtonsoft.Json;
namespace SteamStorefrontAPI.Classes
{

View File

@ -1,11 +1,4 @@
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.Converters;
using Newtonsoft.Json;
namespace SteamStorefrontAPI.Classes
{

View File

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

View File

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

View File

@ -1,11 +1,4 @@
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.Converters;
using Newtonsoft.Json;
namespace SteamStorefrontAPI.Classes
{

View File

@ -1,11 +1,4 @@
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.Converters;
using Newtonsoft.Json;
namespace SteamStorefrontAPI.Classes
{

View File

@ -1,11 +1,4 @@
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.Converters;
using Newtonsoft.Json;
namespace SteamStorefrontAPI.Classes
{

View File

@ -1,12 +1,8 @@
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.Converters;
using Newtonsoft.Json.Linq;
namespace SteamStorefrontAPI.Classes
{

View File

@ -1,11 +1,4 @@
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.Converters;
using Newtonsoft.Json;
namespace SteamStorefrontAPI.Classes
{

View File

@ -1,11 +1,4 @@
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.Converters;
using Newtonsoft.Json;
namespace SteamStorefrontAPI.Classes
{

View File

@ -1,11 +1,5 @@
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.Converters;
namespace SteamStorefrontAPI.Classes
{

View File

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

View File

@ -1,11 +1,4 @@
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.Converters;
using Newtonsoft.Json;
namespace SteamStorefrontAPI.Classes
{

View File

@ -1,11 +1,4 @@
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.Converters;
using Newtonsoft.Json;
namespace SteamStorefrontAPI.Classes
{

View File

@ -1,11 +1,5 @@
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.Converters;
namespace SteamStorefrontAPI.Classes
{

View File

@ -1,11 +1,4 @@
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.Converters;
using Newtonsoft.Json;
namespace SteamStorefrontAPI.Classes
{

View File

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

View File

@ -1,8 +1,5 @@
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.Converters;

View File

@ -1,11 +1,4 @@
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.Converters;
using Newtonsoft.Json;
namespace SteamStorefrontAPI.Classes
{

View File

@ -1,11 +1,5 @@
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.Converters;
namespace SteamStorefrontAPI.Classes
{

View File

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

View File

@ -1,23 +1,21 @@
using Newtonsoft.Json.Linq;
using SteamStorefrontAPI.Classes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Net.Http;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
using SteamStorefrontAPI.Classes;
namespace SteamStorefrontAPI
{
/// <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
{
private static HttpClient client = new HttpClient();
private const string steamBaseUri = "http://store.steampowered.com/api/appdetails";
/// <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>
public static async Task<SteamApp> GetAsync(int AppId)
{
@ -25,24 +23,38 @@ namespace SteamStorefrontAPI
}
/// <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="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)
{
return await GetAsync(AppId, CountryCode, "");
}
/// <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="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. title, description, release dates.</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. title,
/// description, release dates.
/// </param>
public static async Task<SteamApp> GetAsync(int AppId, string CountryCode, string Language)
{
string steamUri = $"{steamBaseUri}?appids={AppId}";
steamUri = string.IsNullOrWhiteSpace(CountryCode) ? steamUri : $"{steamUri}&cc={CountryCode}";
steamUri = string.IsNullOrWhiteSpace(Language) ? steamUri : $"{steamUri}&l={Language.ToLower()}";
steamUri = string.IsNullOrWhiteSpace(CountryCode)
? steamUri
: $"{steamUri}&cc={CountryCode}";
steamUri = string.IsNullOrWhiteSpace(Language)
? steamUri
: $"{steamUri}&l={Language.ToLower()}";
var response = await client.GetAsync(steamUri);
if (!response.IsSuccessStatusCode) { return null; }

View File

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

View File

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

View File

@ -1,23 +1,21 @@
using Newtonsoft.Json.Linq;
using SteamStorefrontAPI.Classes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Net.Http;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
using SteamStorefrontAPI.Classes;
namespace SteamStorefrontAPI
{
/// <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
{
private static HttpClient client = new HttpClient();
private static readonly HttpClient client = new HttpClient();
private const string steamBaseUri = "http://store.steampowered.com/api/packagedetails";
/// <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>
public static async Task<PackageInfo> GetAsync(int PackageId)
{
@ -25,24 +23,39 @@ namespace SteamStorefrontAPI
}
/// <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="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)
{
return await GetAsync(PackageId, CountryCode, null);
}
/// <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="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. title, description, release dates.</param>
public static async Task<PackageInfo> GetAsync(int PackageId, string CountryCode, string Language)
/// <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. title,
/// description, release dates.
/// </param>
public static async Task<PackageInfo> GetAsync(int PackageId, string CountryCode,
string Language)
{
string steamUri = $"{steamBaseUri}?packageids={PackageId}";
steamUri = string.IsNullOrWhiteSpace(CountryCode) ? steamUri : $"{steamUri}&cc={CountryCode}";
steamUri = string.IsNullOrWhiteSpace(Language) ? steamUri : $"{steamUri}&l={Language.ToLower()}";
steamUri = string.IsNullOrWhiteSpace(CountryCode)
? steamUri
: $"{steamUri}&cc={CountryCode}";
steamUri = string.IsNullOrWhiteSpace(Language)
? steamUri
: $"{steamUri}&l={Language.ToLower()}";
var response = await client.GetAsync(steamUri);
if (!response.IsSuccessStatusCode) { return null; }

View File

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