mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-21 06:35:11 +00:00
down with compatibility shims!
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Octokit.Reactive
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reactive.Threading.Tasks;
|
||||
|
||||
namespace Octokit.Reactive
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
#if NETFX_CORE
|
||||
using System.Collections.Generic;
|
||||
#endif
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Octokit
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
#if NETFX_CORE
|
||||
using System.Collections.Generic;
|
||||
#endif
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Octokit
|
||||
|
||||
@@ -1,114 +0,0 @@
|
||||
// ----------------------------------------------------
|
||||
// THIS WHOLE File CAN GO AWAY WHEN WE TARGET 4.5 ONLY
|
||||
// ----------------------------------------------------
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Octokit
|
||||
{
|
||||
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")]
|
||||
[SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")]
|
||||
public interface IReadOnlyDictionary<TKey, TValue> : IReadOnlyCollection<KeyValuePair<TKey, TValue>>
|
||||
{
|
||||
bool ContainsKey(TKey key);
|
||||
bool TryGetValue(TKey key, out TValue value);
|
||||
|
||||
TValue this[TKey key] { get; }
|
||||
IEnumerable<TKey> Keys { get; }
|
||||
IEnumerable<TValue> Values { get; }
|
||||
}
|
||||
|
||||
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")]
|
||||
public interface IReadOnlyList<out TItem> : IReadOnlyCollection<TItem>
|
||||
{
|
||||
TItem this[int index] { get; }
|
||||
}
|
||||
|
||||
public interface IReadOnlyCollection<out T> : IEnumerable<T>
|
||||
{
|
||||
int Count { get; }
|
||||
}
|
||||
|
||||
public class ReadOnlyCollection<TItem> : IReadOnlyList<TItem>
|
||||
{
|
||||
readonly List<TItem> _source;
|
||||
|
||||
public ReadOnlyCollection(IList<TItem> source)
|
||||
{
|
||||
_source = new List<TItem>(source);
|
||||
}
|
||||
|
||||
public IEnumerator<TItem> GetEnumerator()
|
||||
{
|
||||
return _source.GetEnumerator();
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
|
||||
public int Count
|
||||
{
|
||||
get { return _source.Count; }
|
||||
}
|
||||
|
||||
public TItem this[int index]
|
||||
{
|
||||
get { return _source[index]; }
|
||||
}
|
||||
}
|
||||
|
||||
[SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")]
|
||||
[SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")]
|
||||
public class ReadOnlyDictionary<TKey, TValue> : IReadOnlyDictionary<TKey, TValue>
|
||||
{
|
||||
readonly IDictionary<TKey, TValue> _source;
|
||||
|
||||
public ReadOnlyDictionary(IDictionary<TKey, TValue> source)
|
||||
{
|
||||
_source = new Dictionary<TKey, TValue>(source);
|
||||
}
|
||||
|
||||
public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
|
||||
{
|
||||
return _source.GetEnumerator();
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
|
||||
public int Count
|
||||
{
|
||||
get { return _source.Count; }
|
||||
}
|
||||
|
||||
public bool ContainsKey(TKey key)
|
||||
{
|
||||
return _source.ContainsKey(key);
|
||||
}
|
||||
|
||||
public bool TryGetValue(TKey key, out TValue value)
|
||||
{
|
||||
return _source.TryGetValue(key, out value);
|
||||
}
|
||||
|
||||
public TValue this[TKey key]
|
||||
{
|
||||
get { return _source[key]; }
|
||||
}
|
||||
|
||||
public IEnumerable<TKey> Keys
|
||||
{
|
||||
get { return _source.Keys; }
|
||||
}
|
||||
|
||||
public IEnumerable<TValue> Values
|
||||
{
|
||||
get { return _source.Values; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -117,7 +117,6 @@
|
||||
<Compile Include="Exceptions\LoginAttemptsExceededException.cs" />
|
||||
<Compile Include="Exceptions\RateLimitExceededException.cs" />
|
||||
<Compile Include="Helpers\CollectionExtensions.cs" />
|
||||
<Compile Include="Helpers\Net45CompatibilityShim.cs" />
|
||||
<Compile Include="Helpers\UriExtensions.cs" />
|
||||
<Compile Include="Http\ApiConnection.cs" />
|
||||
<Compile Include="Http\IApiConnection.cs" />
|
||||
@@ -211,4 +210,4 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user