Commit 3910c2e
Guard APIs for .NET Standard 2.1 (#3167)
* Initial guard APIs added
* Added EqualTo and NotEqualTo APIs
* Added more Guard APIs
* New interval Guard APIs added
* Added Guard APIs for IEnumerable<T> values
* Renamed APIs
* Added Guard APIs for Stream values
* Added Guard APIs for ReadOnlySpan<T> values
* Added Guard APIs for ReadOnlyMemory<T> values
* Code refactoring
* Minor code refactoring
* Added Guard.IsBitwiseEqualTo<T> API
* Added Guard.IsNull API
* Code refactoring and optimizations
* Code refactoring
* Added Guard.HasSizeNotEqualTo<T> API
* Added Guard size API overloads for the string type
* Added Guard size API overloads for T[] arrays
* Code refactoring
* Removed unnecessary using directives
* Added Guard reference check APIs
* Added new Guaard APIs for string values
* Improved Guard.IsBitwiseEqualTo<T> API
* Improved Guard.IsNull APIs
* Added new size APIs for copy operations
* Added new type test APIs, minor code tweaks
* Minor bug fixes
* Added Guard APIs for Task values
* Minor code tweak
* Added new Guard.IsEmpty APIs
* Refactored code to remove unsafe requirement
* Added Guard.IsInRange<T> APIs
* Added missing type checks in Guard.IsBitwiseEqualTo API
* Added ValueTypeExtensions.ToHexString API
* Code refactoring
* Added ValueTypeExtensions tests
* Added general Guard tests
* Bug fixes in the Guard class
* Minor speed improvements
* Code refactoring
* Removed unnecessary using directives
* More speed improvements and API refactoring
* Refactored/fixed some Guard APIs
* More bug fixes
* Added Guard tests for array APIs
* Fixed the Guard.IsNotEmpty<T> array API
* Moved exception throwers to separate class
* Moved general Guard throwers to separate class
* Disabled warning for XML overload resolution
* Moved array Guard throwers to separate class
* Moved stream Guard throwers to separate class
* Fixed some XML docs
* Moved enumerable Guard throwers to separate class
* Moved task Guard throwers to separate class
* Added new Guard APIs for tasks
* Moved string Guard throwers to separate class
* Moved ReadOnlySpan<T> Guard throwers to separate class
* Added Span<T> APIs to the Guard class
* Moved ReadOnlyMemory<T> Guard throwers to separate class
* Added Memory<T> APIs to the Guard class
* Minor code refactoring
* Update file headers
* Removed unnecessary methods
* Added TypeExtensions.ToTypeString extension
* Improved error messages for general Guard APIs
* Improved error messages for Enumerable Guard APIs
* Improved error messages for stream Guard APIs
* Improved error messages for array Guard APIs
* Improved error messages for string Guard APIs
* Improved error messages for task Guard APIs
* Improved error messages for span Guard APIs
* Improved error messages for memory Guard APIs
* Improved type string for nullable types
* Improved type string for value tuple types
* Minor performance improvement
* Added numeric comparison T4 file
* Updated .gitignore to skip generated files
* Moved comparison Guard APIs to separate file
* Renamed template file, fixed incorrect XML doc
* Fixed missing blank line
* Removed unnecessary type parameters
* Moved enumerable Guard APIs to separate file
* Code refactoring in the enumerable T4 template
* Renamed a file
* Added empty template for ThrowHelper.Collection
* Code refactoring in the T4 templates
* Switched collection throw helpers to T4 generation
* Code refactoring
* Removed incorrect file header
* Added new Guard.IsInRangeFor API
* Updated .gitignore, added generated files to source control
* Added tests for Guard.IsInRangeFor
* Improved formatting of values in error messages
* Improved error messages
* More improvements to the error messages
* Minor code tweaks
* Added Guard.IsNotOfType APIs
* Added Guard.IsNotAssignableToType APIs
* Added Guard.IsDefault<T> APIs
* Fixed some XML docs
* Added missing [Pure] attribute
* Fixed typo in a comment
* Removed unnecessary comment after code changes
* Added XML comment for the T4 service
* Added more comments to ToHexString
* Suppressed an incorrect code style warning
* Added more tests for Guard.IsInRange
* Added Guard.IsNotInRangeFor APIs
* Added readme file for the T4 templates
* Changed generated files extension to .g.cs to avoid conflicts
* Added Guard.IsCloseTo and Guard.IsNotCloseTo APIs
* Added tests for IsCloseTo
* Updated ".g.cs" extension for generated files
Co-Authored-By: Michael Hawker MSFT (XAML Llama) <[email protected]>
* Removed extra space (typo)
Co-Authored-By: Michael Hawker MSFT (XAML Llama) <[email protected]>
* More tweakes to the Guard.md file
* Excluded TypeInfo.g.cs file from .ttinclude from checkout
* Added more info about target ranges for some APIs
* Added IsCloseTo overloads for long type
* Minor code tweaks
* Added comment to describe (uint) cast range check trick
* Added a nore about the .g.cs files being checked in
* Added .NET Standard 2.1 target, adjusted imported packages
* Added [NotNull] attributes when needed
* Added flow attributes to bool Guard APIs
* Added missing Guard APIs for the string type
* Added shared main unit test project
* Removed duplicate files from UWP unit test project
* Refactored UWP unit tests project (can't be in same folder as .shproj)
* Moved markdown tests back into UWP project
* Added UnitTests.NetCore project
* Fixed some styling issues in test projects
* Added .editorconfig file to UniTests.NetCore project too
* Moved .editorconfig file to Shared project folder
* Removed NetCore Tests compilation for Native Configuration.
* Update Windows Community Toolkit.sln
* Updated multiline comments style
* Renamed some Guard APIs
* Fixed collections tests, moved to shared project
* Removed unnecessary [SuppressMessage] attributes
* Added internal [NotNull] and [DoesNotReturnIf] attributes
* Removed build warnings
* Removed leftover compiler directives
* Added Guard.IsTrue/False overloads with custom message
* Fixed test file location after merge
* Fixed Span<T> and Unsafe package references
Co-authored-by: Michael Hawker MSFT (XAML Llama) <[email protected]>
Co-authored-by: Alexandre Zollinger Chohfi <[email protected]>
Co-authored-by: Alexandre Zollinger Chohfi <[email protected]>
Co-authored-by: Michael Hawker MSFT (XAML Llama) <[email protected]>1 parent 01075ff commit 3910c2e
File tree
105 files changed
+566
-225
lines changed- Microsoft.Toolkit.Parsers/Markdown/Blocks
- Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/Properties
- Microsoft.Toolkit.Uwp.UI.Controls/Properties
- Microsoft.Toolkit
- Diagnostics
- Attributes
- Generated
- Extensions
- UnitTests
- UnitTests.NetCore
- UnitTests.UWP
- Assets
- Samples
- Converters
- Extensions
- Helpers
- Helpers
- Markdown
- Parse
- Properties
- UI
- Controls
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
105 files changed
+566
-225
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
Lines changed: 35 additions & 36 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
94 | 93 | | |
95 | 94 | | |
96 | 95 | | |
97 | | - | |
| 96 | + | |
98 | 97 | | |
99 | 98 | | |
100 | 99 | | |
101 | | - | |
| 100 | + | |
102 | 101 | | |
103 | 102 | | |
104 | 103 | | |
| |||
111 | 110 | | |
112 | 111 | | |
113 | 112 | | |
114 | | - | |
| 113 | + | |
115 | 114 | | |
116 | 115 | | |
117 | 116 | | |
118 | | - | |
| 117 | + | |
119 | 118 | | |
120 | 119 | | |
121 | 120 | | |
| |||
296 | 295 | | |
297 | 296 | | |
298 | 297 | | |
299 | | - | |
| 298 | + | |
300 | 299 | | |
301 | 300 | | |
302 | 301 | | |
303 | | - | |
| 302 | + | |
304 | 303 | | |
305 | 304 | | |
306 | 305 | | |
| |||
313 | 312 | | |
314 | 313 | | |
315 | 314 | | |
316 | | - | |
| 315 | + | |
317 | 316 | | |
318 | 317 | | |
319 | 318 | | |
320 | | - | |
| 319 | + | |
321 | 320 | | |
322 | 321 | | |
323 | 322 | | |
| |||
498 | 497 | | |
499 | 498 | | |
500 | 499 | | |
501 | | - | |
| 500 | + | |
502 | 501 | | |
503 | 502 | | |
504 | 503 | | |
505 | | - | |
| 504 | + | |
506 | 505 | | |
507 | 506 | | |
508 | 507 | | |
| |||
515 | 514 | | |
516 | 515 | | |
517 | 516 | | |
518 | | - | |
| 517 | + | |
519 | 518 | | |
520 | 519 | | |
521 | 520 | | |
522 | | - | |
| 521 | + | |
523 | 522 | | |
524 | 523 | | |
525 | 524 | | |
| |||
700 | 699 | | |
701 | 700 | | |
702 | 701 | | |
703 | | - | |
| 702 | + | |
704 | 703 | | |
705 | 704 | | |
706 | 705 | | |
707 | | - | |
| 706 | + | |
708 | 707 | | |
709 | 708 | | |
710 | 709 | | |
| |||
717 | 716 | | |
718 | 717 | | |
719 | 718 | | |
720 | | - | |
| 719 | + | |
721 | 720 | | |
722 | 721 | | |
723 | 722 | | |
724 | | - | |
| 723 | + | |
725 | 724 | | |
726 | 725 | | |
727 | 726 | | |
| |||
902 | 901 | | |
903 | 902 | | |
904 | 903 | | |
905 | | - | |
| 904 | + | |
906 | 905 | | |
907 | 906 | | |
908 | 907 | | |
909 | | - | |
| 908 | + | |
910 | 909 | | |
911 | 910 | | |
912 | 911 | | |
| |||
919 | 918 | | |
920 | 919 | | |
921 | 920 | | |
922 | | - | |
| 921 | + | |
923 | 922 | | |
924 | 923 | | |
925 | 924 | | |
926 | | - | |
| 925 | + | |
927 | 926 | | |
928 | 927 | | |
929 | 928 | | |
| |||
1104 | 1103 | | |
1105 | 1104 | | |
1106 | 1105 | | |
1107 | | - | |
| 1106 | + | |
1108 | 1107 | | |
1109 | 1108 | | |
1110 | 1109 | | |
1111 | | - | |
| 1110 | + | |
1112 | 1111 | | |
1113 | 1112 | | |
1114 | 1113 | | |
| |||
1121 | 1120 | | |
1122 | 1121 | | |
1123 | 1122 | | |
1124 | | - | |
| 1123 | + | |
1125 | 1124 | | |
1126 | 1125 | | |
1127 | 1126 | | |
1128 | | - | |
| 1127 | + | |
1129 | 1128 | | |
1130 | 1129 | | |
1131 | 1130 | | |
| |||
1306 | 1305 | | |
1307 | 1306 | | |
1308 | 1307 | | |
1309 | | - | |
| 1308 | + | |
1310 | 1309 | | |
1311 | 1310 | | |
1312 | 1311 | | |
1313 | | - | |
| 1312 | + | |
1314 | 1313 | | |
1315 | 1314 | | |
1316 | 1315 | | |
| |||
1323 | 1322 | | |
1324 | 1323 | | |
1325 | 1324 | | |
1326 | | - | |
| 1325 | + | |
1327 | 1326 | | |
1328 | 1327 | | |
1329 | 1328 | | |
1330 | | - | |
| 1329 | + | |
1331 | 1330 | | |
1332 | 1331 | | |
1333 | 1332 | | |
| |||
1508 | 1507 | | |
1509 | 1508 | | |
1510 | 1509 | | |
1511 | | - | |
| 1510 | + | |
1512 | 1511 | | |
1513 | 1512 | | |
1514 | 1513 | | |
1515 | | - | |
| 1514 | + | |
1516 | 1515 | | |
1517 | 1516 | | |
1518 | 1517 | | |
| |||
1525 | 1524 | | |
1526 | 1525 | | |
1527 | 1526 | | |
1528 | | - | |
| 1527 | + | |
1529 | 1528 | | |
1530 | 1529 | | |
1531 | 1530 | | |
1532 | | - | |
| 1531 | + | |
1533 | 1532 | | |
1534 | 1533 | | |
1535 | 1534 | | |
| |||
0 commit comments