From db2fae206cd11b9126ca7ae09ea2753f179ce8fb Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Thu, 31 Oct 2013 15:01:31 +1100 Subject: [PATCH] down with compatibility shims! --- .../Clients/IObservableMiscellaneousClient.cs | 1 + .../Clients/ObservableMiscellaneousClient.cs | 1 + Octokit/Clients/CommitStatusClient.cs | 4 +- Octokit/Clients/ICommitStatusClient.cs | 4 +- Octokit/Helpers/Net45CompatibilityShim.cs | 114 ------------------ Octokit/Octokit.csproj | 3 +- 6 files changed, 5 insertions(+), 122 deletions(-) delete mode 100644 Octokit/Helpers/Net45CompatibilityShim.cs diff --git a/Octokit.Reactive/Clients/IObservableMiscellaneousClient.cs b/Octokit.Reactive/Clients/IObservableMiscellaneousClient.cs index 9c216adb..ecf58209 100644 --- a/Octokit.Reactive/Clients/IObservableMiscellaneousClient.cs +++ b/Octokit.Reactive/Clients/IObservableMiscellaneousClient.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; namespace Octokit.Reactive diff --git a/Octokit.Reactive/Clients/ObservableMiscellaneousClient.cs b/Octokit.Reactive/Clients/ObservableMiscellaneousClient.cs index d18d4c12..702e7ee1 100644 --- a/Octokit.Reactive/Clients/ObservableMiscellaneousClient.cs +++ b/Octokit.Reactive/Clients/ObservableMiscellaneousClient.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Reactive.Threading.Tasks; namespace Octokit.Reactive diff --git a/Octokit/Clients/CommitStatusClient.cs b/Octokit/Clients/CommitStatusClient.cs index a9fb46cf..d743c237 100644 --- a/Octokit/Clients/CommitStatusClient.cs +++ b/Octokit/Clients/CommitStatusClient.cs @@ -1,6 +1,4 @@ -#if NETFX_CORE -using System.Collections.Generic; -#endif +using System.Collections.Generic; using System.Threading.Tasks; namespace Octokit diff --git a/Octokit/Clients/ICommitStatusClient.cs b/Octokit/Clients/ICommitStatusClient.cs index 41842253..30f15d13 100644 --- a/Octokit/Clients/ICommitStatusClient.cs +++ b/Octokit/Clients/ICommitStatusClient.cs @@ -1,6 +1,4 @@ -#if NETFX_CORE -using System.Collections.Generic; -#endif +using System.Collections.Generic; using System.Threading.Tasks; namespace Octokit diff --git a/Octokit/Helpers/Net45CompatibilityShim.cs b/Octokit/Helpers/Net45CompatibilityShim.cs deleted file mode 100644 index 7037a88c..00000000 --- a/Octokit/Helpers/Net45CompatibilityShim.cs +++ /dev/null @@ -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 : IReadOnlyCollection> - { - bool ContainsKey(TKey key); - bool TryGetValue(TKey key, out TValue value); - - TValue this[TKey key] { get; } - IEnumerable Keys { get; } - IEnumerable Values { get; } - } - - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")] - public interface IReadOnlyList : IReadOnlyCollection - { - TItem this[int index] { get; } - } - - public interface IReadOnlyCollection : IEnumerable - { - int Count { get; } - } - - public class ReadOnlyCollection : IReadOnlyList - { - readonly List _source; - - public ReadOnlyCollection(IList source) - { - _source = new List(source); - } - - public IEnumerator 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 : IReadOnlyDictionary - { - readonly IDictionary _source; - - public ReadOnlyDictionary(IDictionary source) - { - _source = new Dictionary(source); - } - - public IEnumerator> 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 Keys - { - get { return _source.Keys; } - } - - public IEnumerable Values - { - get { return _source.Values; } - } - } -} diff --git a/Octokit/Octokit.csproj b/Octokit/Octokit.csproj index ec45f73d..03b85f2d 100644 --- a/Octokit/Octokit.csproj +++ b/Octokit/Octokit.csproj @@ -117,7 +117,6 @@ - @@ -211,4 +210,4 @@ --> - + \ No newline at end of file