Applying our private member naming convention

Just trying to make @half-ogre happy
This commit is contained in:
Haacked
2013-10-04 10:01:20 -07:00
parent 41263a329c
commit adfb50198e
14 changed files with 71 additions and 76 deletions
@@ -7,42 +7,42 @@ namespace Octokit.Reactive.Clients
{
public class ObservableAuthorizationsClient : IObservableAuthorizationsClient
{
readonly IAuthorizationsClient client;
readonly IAuthorizationsClient _client;
public ObservableAuthorizationsClient(IAuthorizationsClient client)
{
Ensure.ArgumentNotNull(client, "client");
this.client = client;
_client = client;
}
public IObservable<IReadOnlyCollection<Authorization>> GetAll()
{
return client.GetAll().ToObservable();
return _client.GetAll().ToObservable();
}
public IObservable<Authorization> Get(int id)
{
return client.Get(id).ToObservable();
return _client.Get(id).ToObservable();
}
public IObservable<Authorization> Update(int id, AuthorizationUpdate authorization)
{
Ensure.ArgumentNotNull(authorization, "authorization");
return client.Update(id, authorization).ToObservable();
return _client.Update(id, authorization).ToObservable();
}
public IObservable<Authorization> Create(AuthorizationUpdate authorization)
{
Ensure.ArgumentNotNull(authorization, "authorization");
return client.Create(authorization).ToObservable();
return _client.Create(authorization).ToObservable();
}
public IObservable<Unit> Delete(int id)
{
return client.Delete(id).ToObservable();
return _client.Delete(id).ToObservable();
}
}
}
@@ -6,18 +6,18 @@ namespace Octokit.Reactive.Clients
{
public class ObservableAutoCompleteClient : IObservableAutoCompleteClient
{
readonly IAutoCompleteClient client;
readonly IAutoCompleteClient _client;
public ObservableAutoCompleteClient(IAutoCompleteClient client)
{
Ensure.ArgumentNotNull(client, "client");
this.client = client;
_client = client;
}
public IObservable<IReadOnlyDictionary<string, Uri>> GetEmojis()
{
return client.GetEmojis().ToObservable();
return _client.GetEmojis().ToObservable();
}
}
}
@@ -6,32 +6,32 @@ namespace Octokit.Reactive.Clients
{
public class ObservableOrganizationsClient : IObservableOrganizationsClient
{
readonly IOrganizationsClient client;
readonly IOrganizationsClient _client;
public ObservableOrganizationsClient(IOrganizationsClient client)
{
Ensure.ArgumentNotNull(client, "client");
this.client = client;
_client = client;
}
public IObservable<Organization> Get(string org)
{
Ensure.ArgumentNotNullOrEmptyString(org, "org");
return client.Get(org).ToObservable();
return _client.Get(org).ToObservable();
}
public IObservable<IReadOnlyCollection<Organization>> GetAllForCurrent()
{
return client.GetAllForCurrent().ToObservable();
return _client.GetAllForCurrent().ToObservable();
}
public IObservable<IReadOnlyCollection<Organization>> GetAll(string user)
{
Ensure.ArgumentNotNullOrEmptyString(user, "user");
return client.GetAll(user).ToObservable();
return _client.GetAll(user).ToObservable();
}
}
}
@@ -6,13 +6,13 @@ namespace Octokit.Reactive.Clients
{
public class ObservableRepositoriesClient : IObservableRepositoriesClient
{
readonly IRepositoriesClient client;
readonly IRepositoriesClient _client;
public ObservableRepositoriesClient(IRepositoriesClient client)
{
Ensure.ArgumentNotNull(client, "client");
this.client = client;
_client = client;
}
public IObservable<Repository> Get(string owner, string name)
@@ -20,26 +20,26 @@ namespace Octokit.Reactive.Clients
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
return client.Get(owner, name).ToObservable();
return _client.Get(owner, name).ToObservable();
}
public IObservable<IReadOnlyCollection<Repository>> GetAllForCurrent()
{
return client.GetAllForCurrent().ToObservable();
return _client.GetAllForCurrent().ToObservable();
}
public IObservable<IReadOnlyCollection<Repository>> GetAllForUser(string login)
{
Ensure.ArgumentNotNullOrEmptyString(login, "login");
return client.GetAllForUser(login).ToObservable();
return _client.GetAllForUser(login).ToObservable();
}
public IObservable<IReadOnlyCollection<Repository>> GetAllForOrg(string organization)
{
Ensure.ArgumentNotNullOrEmptyString(organization, "organization");
return client.GetAllForOrg(organization).ToObservable();
return _client.GetAllForOrg(organization).ToObservable();
}
public IObservable<Readme> GetReadme(string owner, string name)
@@ -47,7 +47,7 @@ namespace Octokit.Reactive.Clients
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
return client.GetReadme(owner, name).ToObservable();
return _client.GetReadme(owner, name).ToObservable();
}
}
}
@@ -7,49 +7,49 @@ namespace Octokit.Reactive.Clients
{
public class ObservableSshKeysClient : IObservableSshKeysClient
{
readonly ISshKeysClient client;
readonly ISshKeysClient _client;
public ObservableSshKeysClient(ISshKeysClient client)
{
Ensure.ArgumentNotNull(client, "client");
this.client = client;
_client = client;
}
public IObservable<SshKey> Get(int id)
{
return client.Get(id).ToObservable();
return _client.Get(id).ToObservable();
}
public IObservable<IReadOnlyCollection<SshKey>> GetAll(string user)
{
Ensure.ArgumentNotNullOrEmptyString(user, "user");
return client.GetAll(user).ToObservable();
return _client.GetAll(user).ToObservable();
}
public IObservable<IReadOnlyCollection<SshKey>> GetAllForCurrent()
{
return client.GetAllForCurrent().ToObservable();
return _client.GetAllForCurrent().ToObservable();
}
public IObservable<SshKey> Create(SshKeyUpdate key)
{
Ensure.ArgumentNotNull(key, "key");
return client.Create(key).ToObservable();
return _client.Create(key).ToObservable();
}
public IObservable<SshKey> Update(int id, SshKeyUpdate key)
{
Ensure.ArgumentNotNull(key, "key");
return client.Update(id, key).ToObservable();
return _client.Update(id, key).ToObservable();
}
public IObservable<Unit> Delete(int id)
{
return client.Delete(id).ToObservable();
return _client.Delete(id).ToObservable();
}
}
}
@@ -11,7 +11,7 @@ namespace Octokit.Reactive.Clients
{
Ensure.ArgumentNotNull(client, "client");
this._client = client;
_client = client;
}
public IObservable<User> Get(string login)
-4
View File
@@ -1,8 +1,4 @@
using System;
using System.Globalization;
using System.Linq;
using System.Collections.Generic;
using System.Reflection;
using System.Threading.Tasks;
using Octokit.Http;
+4 -3
View File
@@ -12,18 +12,19 @@ namespace Octokit.Clients
/// </summary>
public class AutoCompleteClient : IAutoCompleteClient
{
readonly IConnection connection;
readonly IConnection _connection;
public AutoCompleteClient(IConnection connection)
{
Ensure.ArgumentNotNull(connection, "connection");
this.connection = connection;
_connection = connection;
}
public async Task<IReadOnlyDictionary<string, Uri>> GetEmojis()
{
var endpoint = new Uri("/emojis", UriKind.Relative);
var response = await connection.GetAsync<Dictionary<string, string>>(endpoint, null);
var response = await _connection.GetAsync<Dictionary<string, string>>(endpoint, null);
return new ReadOnlyDictionary<string, Uri>(
response.BodyAsObject.ToDictionary(kvp => kvp.Key, kvp => new Uri(kvp.Value)));
}
+3 -3
View File
@@ -8,7 +8,7 @@ namespace Octokit.Http
{
public class ApiConnection<T> : IApiConnection<T>
{
readonly IApiPagination<T> pagination;
readonly IApiPagination<T> _pagination;
public ApiConnection(IConnection connection) : this(connection, new ApiPagination<T>())
{
@@ -20,7 +20,7 @@ namespace Octokit.Http
Ensure.ArgumentNotNull(pagination, "pagination");
Connection = connection;
this.pagination = pagination;
_pagination = pagination;
}
protected IConnection Connection { get; private set; }
@@ -52,7 +52,7 @@ namespace Octokit.Http
{
Ensure.ArgumentNotNull(endpoint, "endpoint");
return await pagination.GetAllPages(async () => await GetPage(endpoint, parameters));
return await _pagination.GetAllPages(async () => await GetPage(endpoint, parameters));
}
public async Task<T> Create(Uri endpoint, object data)
+2 -2
View File
@@ -10,8 +10,8 @@ namespace Octokit.Http
public class ApiInfo
{
public ApiInfo(IDictionary<string, Uri> links,
IList<string> oauthScopes,
IList<string> acceptedOauthScopes,
IEnumerable<string> oauthScopes,
IEnumerable<string> acceptedOauthScopes,
string etag,
int rateLimit,
int rateLimitRemaining)
+4 -4
View File
@@ -16,8 +16,8 @@ namespace Octokit.Http
#endif
readonly Regex linkRelRegex = new Regex("rel=\"(next|prev|first|last)\"", regexOptions);
readonly Regex linkUriRegex = new Regex("<(.+)>", regexOptions);
readonly Regex _linkRelRegex = new Regex("rel=\"(next|prev|first|last)\"", regexOptions);
readonly Regex _linkUriRegex = new Regex("<(.+)>", regexOptions);
public void ParseApiHttpHeaders<T>(IResponse<T> response)
{
@@ -69,10 +69,10 @@ namespace Octokit.Http
var links = response.Headers["Link"].Split(',');
foreach (var link in links)
{
var relMatch = linkRelRegex.Match(link);
var relMatch = _linkRelRegex.Match(link);
if (!relMatch.Success || relMatch.Groups.Count != 2) break;
var uriMatch = linkUriRegex.Match(link);
var uriMatch = _linkUriRegex.Match(link);
if (!uriMatch.Success || uriMatch.Groups.Count != 2) break;
httpLinks.Add(relMatch.Groups[1].Value, new Uri(uriMatch.Groups[1].Value));
+16 -16
View File
@@ -16,10 +16,10 @@ namespace Octokit.Http
static readonly Uri defaultGitHubApiUrl = new Uri("https://api.github.com/");
static readonly ICredentialStore anonymousCredentials = new InMemoryCredentialStore(Credentials.Anonymous);
readonly Authenticator authenticator;
readonly IHttpClient httpClient;
readonly JsonHttpPipeline jsonPipeline;
readonly ApiInfoParser apiInfoParser;
readonly Authenticator _authenticator;
readonly IHttpClient _httpClient;
readonly JsonHttpPipeline _jsonPipeline;
readonly ApiInfoParser _apiInfoParser;
public Connection(string userAgent) : this(userAgent, defaultGitHubApiUrl, anonymousCredentials)
{
@@ -64,10 +64,10 @@ namespace Octokit.Http
UserAgent = userAgent;
BaseAddress = baseAddress;
authenticator = new Authenticator(credentialStore);
this.httpClient = httpClient;
jsonPipeline = new JsonHttpPipeline();
apiInfoParser = new ApiInfoParser();
_authenticator = new Authenticator(credentialStore);
_httpClient = httpClient;
_jsonPipeline = new JsonHttpPipeline();
_apiInfoParser = new ApiInfoParser();
}
public async Task<IResponse<T>> GetAsync<T>(Uri endpoint, IDictionary<string, string> parameters)
@@ -131,7 +131,7 @@ namespace Octokit.Http
request.Headers[header.Key] = header.Value;
}
var response = await RunRequest<T>(request);
jsonPipeline.DeserializeResponse(response);
_jsonPipeline.DeserializeResponse(response);
return response;
}
@@ -172,7 +172,7 @@ namespace Octokit.Http
public ICredentialStore CredentialStore
{
get { return authenticator.CredentialStore; }
get { return _authenticator.CredentialStore; }
}
public Credentials Credentials
@@ -182,7 +182,7 @@ namespace Octokit.Http
set
{
Ensure.ArgumentNotNull(value, "value");
authenticator.CredentialStore = new InMemoryCredentialStore(value);
_authenticator.CredentialStore = new InMemoryCredentialStore(value);
}
}
@@ -194,9 +194,9 @@ namespace Octokit.Http
async Task<IResponse<T>> Run<T>(IRequest request)
{
jsonPipeline.SerializeRequest(request);
_jsonPipeline.SerializeRequest(request);
var response = await RunRequest<T>(request);
jsonPipeline.DeserializeResponse(response);
_jsonPipeline.DeserializeResponse(response);
return response;
}
@@ -204,9 +204,9 @@ namespace Octokit.Http
async Task<IResponse<T>> RunRequest<T>(IRequest request)
{
request.Headers.Add("User-Agent", UserAgent);
authenticator.Apply(request);
var response = await httpClient.Send<T>(request);
apiInfoParser.ParseApiHttpHeaders(response);
_authenticator.Apply(request);
var response = await _httpClient.Send<T>(request);
_apiInfoParser.ParseApiHttpHeaders(response);
HandleErrors(response);
return response;
}
+4 -6
View File
@@ -1,21 +1,19 @@
using System.Threading.Tasks;
namespace Octokit.Http
namespace Octokit.Http
{
public class InMemoryCredentialStore : ICredentialStore
{
readonly Credentials credentials;
readonly Credentials _credentials;
public InMemoryCredentialStore(Credentials credentials)
{
Ensure.ArgumentNotNull(credentials, "credentials");
this.credentials = credentials;
_credentials = credentials;
}
public Credentials GetCredentials()
{
return credentials;
return _credentials;
}
}
}
+7 -7
View File
@@ -6,8 +6,8 @@ namespace Octokit.Http
{
public class ReadOnlyPagedCollection<T> : ReadOnlyCollection<T>, IReadOnlyPagedCollection<T>
{
readonly IConnection connection;
readonly ApiInfo info;
readonly IConnection _connection;
readonly ApiInfo _info;
public ReadOnlyPagedCollection(IResponse<List<T>> response, IConnection connection)
: base(response != null ? response.BodyAsObject : null)
@@ -15,17 +15,17 @@ namespace Octokit.Http
Ensure.ArgumentNotNull(response, "response");
Ensure.ArgumentNotNull(connection, "connection");
this.connection = connection;
info = response.ApiInfo;
_connection = connection;
_info = response.ApiInfo;
}
public async Task<IReadOnlyPagedCollection<T>> GetNextPage()
{
var nextPageUrl = info.GetNextPageUrl();
var nextPageUrl = _info.GetNextPageUrl();
if (nextPageUrl == null) return null;
var response = await connection.GetAsync<List<T>>(nextPageUrl, null);
return new ReadOnlyPagedCollection<T>(response, connection);
var response = await _connection.GetAsync<List<T>>(nextPageUrl, null);
return new ReadOnlyPagedCollection<T>(response, _connection);
}
}
}