Commit Graph

30 Commits

Author SHA1 Message Date
Vincent 50b0e556a3 Merge branch 'master' into u/vgromfeld/removeUnusedFields 2020-03-16 08:51:49 +01:00
Sergio Pedri 8acc8b7308 Guard APIs (#3131)
* 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) <michael.hawker@outlook.com>

* Removed extra space (typo)

Co-Authored-By: Michael Hawker MSFT (XAML Llama) <michael.hawker@outlook.com>

* 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

* Fixed IsCloseTo tests

* Fixed IsNull tests

Co-authored-by: Michael Hawker MSFT (XAML Llama) <michael.hawker@outlook.com>
2020-03-14 18:13:04 -07:00
Vincent Gromfeld 5424cf709d remove unused fields 2020-02-28 15:15:14 +01:00
michael-hawker 4ed955e13f Move ToFileSizeString to new Convert static class. 2019-10-24 15:24:48 -07:00
michael-hawker ad63343636 Move needed graph Dependencies to Microsoft.Toolkit and Microsoft.Toolkit.Uwp.UI
FileSize String Extension and Converter
Centralize Usage in other places from OneDrive and SharePoint
2019-10-21 00:47:27 -07:00
Lucas Rojas 8ff9dbfd0b Remove extra space 2019-02-05 19:05:27 -03:00
marianstdt b1f33ef79e Added the StringExtension.cs file 2019-02-01 11:48:45 -03:00
Nikola Metulev 1af1e3f283 Merge branch 'master' into RegexUpdate 2018-10-12 10:26:35 -07:00
Daniel Chalmers c15735acc7 Update ArrayExtensions.cs 2018-10-03 18:51:11 -05:00
Daniel Chalmers d6dc1cde07 Update ArrayExtensions.cs 2018-10-02 20:59:10 -05:00
Daniel Chalmers aa361ab710 Update ArrayExtensions.cs 2018-10-02 20:23:13 -05:00
Daniel Chalmers a8ae09b92e Update ArrayExtensions xml docs 2018-10-02 20:21:09 -05:00
Daniel Chalmers 82a134b722 Update StringExtensions xml docs 2018-10-02 20:19:34 -05:00
AVK Naidu 2fc85930bd Updated regex based on feedback. 2018-09-26 12:49:17 -04:00
AVK Naidu 6d5d50664e Removed old regex based on review. 2018-07-13 13:25:35 +05:30
AVK Naidu 6c0c37441b Update Regex to support multiple formats. 2018-07-12 14:01:16 -04:00
Nikola Metulev 2f1b010c0c updated header 2018-05-23 15:12:18 -07:00
mhawker 9a16405a12 Merge branch 'master' into mhawker/uniformgrid-as-grid
# Conflicts:
#	Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj
#	UnitTests/UnitTestApp.xaml.cs
2018-04-12 00:24:29 -07:00
mhawker 2f6a9291b8 Move Column/Row Definition Setup to Helper Method and add Unit Tests. 2018-04-09 23:29:16 -07:00
mhawker c9221d807b Add initial Unit Tests for GetFreeSpots method on UniformGrid. 2018-04-06 22:41:47 -07:00
mhawker 36100a6c77 Split UniformGrid code, Start Unit Tests for Array.Fill 2018-04-06 20:59:40 -07:00
AVK Naidu d2aa89a238 Updated Headers 2018-02-14 16:19:52 -05:00
AVK 80d0b150ae Merge branch 'master' into Extensions 2018-02-14 18:24:53 +05:30
William Bradley b188662df3 -Fixed naming and descriptions of StringExtensions.
-Added Backtick and Code language tests for Code Block.
2018-02-14 14:12:33 +13:00
William Bradley 90b4e22953 -Moved Extension methods to StringExtensions.
-Gave StringValueAttribute a better description.

-Added OrdinalIgnoreCase to Common.IndexOf.

-Fixed general feedback.
2018-02-13 19:56:33 +13:00
AVK Naidu 8ddf86d948 Regex to TryParse 2018-02-13 05:45:13 +05:30
AVK Naidu f20a2c29fd Fixed typos and corrected headers 2018-02-12 15:31:46 -05:00
AVK Naidu 55d728b816 Cleanup Methods based on comments 2018-02-12 15:14:44 -05:00
AVK Naidu 4da16b36e6 Improving TextboxRegex to use StringExtensions 2018-02-12 17:47:08 +05:30
AVK Naidu c7a63a1a28 Moving String Extensions to Micorosoft.Toolkit as suggesred 2018-02-10 17:22:20 +05:30