Rename to Octokit to be consistent with other API libs

GitHub is naming all of the libraries Octokit for their respective
platforms
This commit is contained in:
Haacked
2013-01-29 14:00:27 -08:00
parent 4370788c34
commit 997e955f38
124 changed files with 225 additions and 226 deletions
+31
View File
@@ -0,0 +1,31 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Threading.Tasks;
namespace Octokit.Http
{
public class ReadOnlyPagedCollection<T> : ReadOnlyCollection<T>, IReadOnlyPagedCollection<T>
{
readonly IConnection connection;
readonly ApiInfo info;
public ReadOnlyPagedCollection(IResponse<List<T>> response, IConnection connection)
: base(response != null ? response.BodyAsObject : null)
{
Ensure.ArgumentNotNull(response, "response");
Ensure.ArgumentNotNull(connection, "connection");
this.connection = connection;
info = response.ApiInfo;
}
public async Task<IReadOnlyPagedCollection<T>> GetNextPage()
{
var nextPageUrl = info.GetNextPageUrl();
if (nextPageUrl == null) return null;
var response = await connection.GetAsync<List<T>>(nextPageUrl);
return new ReadOnlyPagedCollection<T>(response, connection);
}
}
}