Skip to content

Commit

Permalink
move types out of the global namespace (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp authored Aug 9, 2024
1 parent af492df commit 3e0072a
Show file tree
Hide file tree
Showing 59 changed files with 65 additions and 10 deletions.
3 changes: 2 additions & 1 deletion contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ Example:

#if FeatureMemory && (NETFRAMEWORK || NETSTANDARD2_0 || NETCOREAPP2_0)

namespace Polyfills;
using System;
using System.Buffers;
using System.IO;
Expand Down Expand Up @@ -306,7 +307,7 @@ static partial class Polyfill
}
#endif
```
<sup><a href='/src/Polyfill/Polyfill_TextWriter.cs#L1-L119' title='Snippet source file'>snippet source</a> | <a href='#snippet-Polyfill_TextWriter.cs' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Polyfill/Polyfill_TextWriter.cs#L1-L120' title='Snippet source file'>snippet source</a> | <a href='#snippet-Polyfill_TextWriter.cs' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/EnumPolyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// <auto-generated />
#pragma warning disable

namespace Polyfills;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
Expand Down
2 changes: 1 addition & 1 deletion src/Polyfill/GuidPolyfill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// ReSharper disable RedundantUsingDirective
// ReSharper disable PartialTypeWithSinglePart

namespace Polyfills;
using System;
using System.Collections.Generic;
using System.Diagnostics;
Expand Down
5 changes: 2 additions & 3 deletions src/Polyfill/Nullability/NullabilityInfoContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

#nullable enable


namespace System.Reflection;
using System.Linq;
using System.Diagnostics.CodeAnalysis;

Expand All @@ -14,9 +16,6 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;

namespace System.Reflection;

using System.Linq;
using System.Diagnostics.CodeAnalysis;
using System.Collections.Generic;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Nullability/NullabilityInfoExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#nullable enable

namespace Polyfills;
using System;
using System.Collections.Concurrent;
using System.Reflection;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Numbers/BytePolyfill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// ReSharper disable RedundantUsingDirective
// ReSharper disable PartialTypeWithSinglePart

namespace Polyfills;
using System;
using System.Collections.Generic;
using System.Diagnostics;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Numbers/DoublePolyfill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// ReSharper disable RedundantUsingDirective
// ReSharper disable PartialTypeWithSinglePart

namespace Polyfills;
using System;
using System.Collections.Generic;
using System.Diagnostics;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Numbers/IntPolyfill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// ReSharper disable RedundantUsingDirective
// ReSharper disable PartialTypeWithSinglePart

namespace Polyfills;
using System;
using System.Collections.Generic;
using System.Diagnostics;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Numbers/LongPolyfill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// ReSharper disable RedundantUsingDirective
// ReSharper disable PartialTypeWithSinglePart

namespace Polyfills;
using System;
using System.Collections.Generic;
using System.Diagnostics;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Numbers/SBytePolyfill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// ReSharper disable RedundantUsingDirective
// ReSharper disable PartialTypeWithSinglePart

namespace Polyfills;
using System;
using System.Collections.Generic;
using System.Diagnostics;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Numbers/ShortPolyfill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// ReSharper disable RedundantUsingDirective
// ReSharper disable PartialTypeWithSinglePart

namespace Polyfills;
using System;
using System.Collections.Generic;
using System.Diagnostics;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Numbers/UIntPolyfill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// ReSharper disable RedundantUsingDirective
// ReSharper disable PartialTypeWithSinglePart

namespace Polyfills;
using System;
using System.Collections.Generic;
using System.Diagnostics;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Numbers/ULongPolyfill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// ReSharper disable RedundantUsingDirective
// ReSharper disable PartialTypeWithSinglePart

namespace Polyfills;
using System;
using System.Collections.Generic;
using System.Diagnostics;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Numbers/UShortPolyfill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// ReSharper disable RedundantUsingDirective
// ReSharper disable PartialTypeWithSinglePart

namespace Polyfills;
using System;
using System.Collections.Generic;
using System.Diagnostics;
Expand Down
3 changes: 3 additions & 0 deletions src/Polyfill/Polyfill.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// <auto-generated />
#pragma warning disable
global using global::Polyfills;

namespace Polyfills;

using System.ComponentModel;
using System.Diagnostics;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_CancellationToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#nullable enable

namespace Polyfills;
using System;
using System.Threading;
using Link = System.ComponentModel.DescriptionAttribute;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_CancellationTokenSource.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// <auto-generated />
#pragma warning disable

namespace Polyfills;
using System;
using System.Reflection;
using System.Threading;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_ConcurrentDictionary.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// <auto-generated />
#pragma warning disable

namespace Polyfills;
using System;
using System.Collections.Generic;
using System.Collections.Concurrent;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_Dictionary.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// <auto-generated />
#pragma warning disable

namespace Polyfills;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_HashSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#if NET46X || NET47 || NET471 || NETSTANDARD2_0

namespace Polyfills;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_HttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#if ((NETFRAMEWORK && FetureHttp) || NETSTANDARD || NETCOREAPP2X || NETCOREAPP3X)

namespace Polyfills;
using System;
using System.IO;
using System.Net.Http;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_HttpContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#if ((NETFRAMEWORK && FetureHttp) || NETSTANDARD || NETCOREAPP2X || NETCOREAPP3X)

namespace Polyfills;
using System.IO;
using System.Net.Http;
using System.Threading;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_IEnumerable.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// <auto-generated />
#pragma warning disable

namespace Polyfills;
using System;
using System.Collections;
using System.Collections.Generic;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_IEnumerable_AggregateBy.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// <auto-generated />
#pragma warning disable

namespace Polyfills;
using System;
using System.Collections.Generic;
using Link = System.ComponentModel.DescriptionAttribute;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_IEnumerable_Chunk.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// <auto-generated />
#pragma warning disable

namespace Polyfills;
using System;
using System.Collections;
using System.Collections.Generic;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_IEnumerable_CountBy.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// <auto-generated />
#pragma warning disable

namespace Polyfills;
using System;
using System.Collections.Generic;
using Link = System.ComponentModel.DescriptionAttribute;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_IEnumerable_DistinctBy.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// <auto-generated />
#pragma warning disable

namespace Polyfills;
using System;
using System.Collections;
using System.Collections.Generic;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_IEnumerable_ElementAt.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// <auto-generated />
#pragma warning disable

namespace Polyfills;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_IEnumerable_Except.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// <auto-generated />
#pragma warning disable

namespace Polyfills;
using System;
using System.Collections;
using System.Collections.Generic;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_IEnumerable_FirstOrDefault.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// <auto-generated />
#pragma warning disable

namespace Polyfills;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_IEnumerable_LastOrDefault.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// <auto-generated />
#pragma warning disable

namespace Polyfills;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_IEnumerable_MaxBy.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// <auto-generated />
#pragma warning disable

namespace Polyfills;
using System;
using System.Collections;
using System.Collections.Generic;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_IEnumerable_MinBy.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// <auto-generated />
#pragma warning disable

namespace Polyfills;
using System;
using System.Collections;
using System.Collections.Generic;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_IEnumerable_SingleOrDefault.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// <auto-generated />
#pragma warning disable

namespace Polyfills;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_IEnumerable_Zip.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// <auto-generated />
#pragma warning disable

namespace Polyfills;
using System;
using System.Collections;
using System.Collections.Generic;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_IReadOnlyDictionary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#if NETFRAMEWORK || NETSTANDARD2_0

namespace Polyfills;
using System;
using System.Collections.Generic;
using Link = System.ComponentModel.DescriptionAttribute;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_KeyValuePair.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#if NETFRAMEWORK || NETSTANDARD2_0

namespace Polyfills;
using System;
using System.Collections.Generic;
using Link = System.ComponentModel.DescriptionAttribute;
Expand Down
2 changes: 1 addition & 1 deletion src/Polyfill/Polyfill_List.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// <auto-generated />
#pragma warning disable


namespace Polyfills;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_Memory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#if FeatureMemory

namespace Polyfills;
using System;
using System.Collections.Generic;
using System.Text;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_MicroNanosecond.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// <auto-generated />
#pragma warning disable

namespace Polyfills;
using System;
using Link = System.ComponentModel.DescriptionAttribute;

Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_MicroNanosecondAdd.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// <auto-generated />
#pragma warning disable

namespace Polyfills;
using System;
using Link = System.ComponentModel.DescriptionAttribute;

Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_Process.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#if !NET5_0_OR_GREATER

namespace Polyfills;
using System;
using System.Diagnostics;
using System.Threading;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_Random.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// <auto-generated />
#pragma warning disable

namespace Polyfills;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_SortedList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#if !NET7_0_OR_GREATER

namespace Polyfills;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_Stream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#if FeatureValueTask && (NETFRAMEWORK || NETSTANDARD2_0 || NETCOREAPP2_0)

namespace Polyfills;
using System;
using System.IO;
using System.Runtime.InteropServices;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_String.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// <auto-generated />
#pragma warning disable

namespace Polyfills;
using System;
using Link = System.ComponentModel.DescriptionAttribute;
using System.Text;
Expand Down
1 change: 1 addition & 0 deletions src/Polyfill/Polyfill_StringBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// <auto-generated />
#pragma warning disable

namespace Polyfills;
using System;
using System.ComponentModel;
using System.IO;
Expand Down
Loading

0 comments on commit 3e0072a

Please sign in to comment.