diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..856f53f
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,213 @@
+root = true
+
+[*]
+tab_width = 4
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[{*.xml, *.targets, *.props}]
+indent_style = tab
+
+[{*.cs}]
+indent_style = tab
+
+[*.csproj]
+indent_style = tab
+tab_width = 2
+indent_size = 2
+
+[{*.yml, *.yaml}]
+indent_style = space
+
+[*.md]
+indent_style = space
+
+[*.cs]
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_indent_block_contents
+csharp_indent_block_contents = true
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_indent_braces
+csharp_indent_braces = false
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_indent_case_contents
+csharp_indent_case_contents = true
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_indent_labels
+csharp_indent_labels = one_less_than_current
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_indent_switch_labels
+csharp_indent_switch_labels = true
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_new_line_before_catch
+csharp_new_line_before_catch = true
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_new_line_before_else
+csharp_new_line_before_else = true
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_new_line_before_finally
+csharp_new_line_before_finally = true
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_new_line_before_members_in_anonymous_types
+csharp_new_line_before_members_in_anonymous_types = true
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_new_line_before_members_in_object_initializers
+csharp_new_line_before_members_in_object_initializers = true
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_new_line_before_open_brace
+csharp_new_line_before_open_brace = all
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_new_line_between_query_expression_clauses
+csharp_new_line_between_query_expression_clauses = true
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_prefer_braces
+csharp_prefer_braces = true:suggestion
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_prefer_simple_default_expression
+csharp_prefer_simple_default_expression = true:suggestion
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_preserve_single_line_blocks
+csharp_preserve_single_line_blocks = true
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_space_after_cast
+csharp_space_after_cast = false
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_space_after_colon_in_inheritance_clause
+csharp_space_after_colon_in_inheritance_clause = true
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_space_after_comma
+csharp_space_after_comma = true
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_space_after_dot
+csharp_space_after_dot = false
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_space_after_keywords_in_control_flow_statements
+csharp_space_after_keywords_in_control_flow_statements = true
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_space_after_semicolon_in_for_statement
+csharp_space_after_semicolon_in_for_statement = true
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_space_around_binary_operators
+csharp_space_around_binary_operators = before_and_after
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_space_around_declaration_statements
+csharp_space_around_declaration_statements = do_not_ignore
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_space_before_colon_in_inheritance_clause
+csharp_space_before_colon_in_inheritance_clause = true
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_space_before_comma
+csharp_space_before_comma = false
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_space_before_dot
+csharp_space_before_dot = false
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_space_before_open_square_brackets
+csharp_space_before_open_square_brackets = false
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_space_before_semicolon_in_for_statement
+csharp_space_before_semicolon_in_for_statement = false
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_space_between_empty_square_brackets
+csharp_space_between_empty_square_brackets = false
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_space_between_method_call_empty_parameter_list_parentheses
+csharp_space_between_method_call_empty_parameter_list_parentheses = false
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_space_between_method_call_name_and_opening_parenthesis
+csharp_space_between_method_call_name_and_opening_parenthesis = false
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_space_between_method_call_parameter_list_parentheses
+csharp_space_between_method_call_parameter_list_parentheses = false
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_space_between_method_declaration_empty_parameter_list_parentheses
+csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_space_between_method_declaration_name_and_open_parenthesis
+csharp_space_between_method_declaration_name_and_open_parenthesis = false
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_space_between_method_declaration_parameter_list_parentheses
+csharp_space_between_method_declaration_parameter_list_parentheses = false
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_space_between_parentheses
+csharp_space_between_parentheses = none
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_space_between_square_brackets
+csharp_space_between_square_brackets = false
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_style_conditional_delegate_call
+csharp_style_conditional_delegate_call = true:suggestion
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_style_expression_bodied_accessors
+csharp_style_expression_bodied_accessors = true:suggestion
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_style_expression_bodied_constructors
+csharp_style_expression_bodied_constructors = false:suggestion
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_style_expression_bodied_indexers
+csharp_style_expression_bodied_indexers = true:suggestion
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_style_expression_bodied_methods
+csharp_style_expression_bodied_methods = true:suggestion
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_style_expression_bodied_operators
+csharp_style_expression_bodied_operators = true:suggestion
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_style_expression_bodied_properties
+csharp_style_expression_bodied_properties = true:suggestion
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_style_inlined_variable_declaration
+csharp_style_inlined_variable_declaration = true:suggestion
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_style_pattern_matching_over_as_with_null_check
+csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_style_pattern_matching_over_is_with_cast_check
+csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_style_throw_expression
+csharp_style_throw_expression = true:suggestion
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_style_var_elsewhere
+csharp_style_var_elsewhere = true:suggestion
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_style_var_for_built_in_types
+csharp_style_var_for_built_in_types = true:suggestion
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#csharp_style_var_when_type_is_apparent
+csharp_style_var_when_type_is_apparent = true:suggestion
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#dotnet_sort_system_directives_first
+dotnet_sort_system_directives_first = true
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#dotnet_style_coalesce_expression
+dotnet_style_coalesce_expression = true:suggestion
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#dotnet_style_collection_initializer
+dotnet_style_collection_initializer = true:suggestion
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#dotnet_style_explicit_tuple_names
+dotnet_style_explicit_tuple_names = true:suggestion
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#dotnet_style_null_propagation
+dotnet_style_null_propagation = true:suggestion
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#dotnet_style_object_initializer
+dotnet_style_object_initializer = true:suggestion
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#dotnet_style_predefined_type_for_locals_parameters_members
+dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#dotnet_style_predefined_type_for_member_access
+dotnet_style_predefined_type_for_member_access = true:suggestion
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#dotnet_style_qualification_for_event
+dotnet_style_qualification_for_event = false:suggestion
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#dotnet_style_qualification_for_field
+dotnet_style_qualification_for_field = false:suggestion
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#dotnet_style_qualification_for_method
+dotnet_style_qualification_for_method = false:suggestion
+
+# http://kent-boogaart.com/blog/editorconfig-reference-for-c-developers#dotnet_style_qualification_for_property
+dotnet_style_qualification_for_property = false:suggestion
diff --git a/build/header.txt b/build/header.txt
index cceb789..c07642d 100644
--- a/build/header.txt
+++ b/build/header.txt
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright 2015-2018 nventive inc. All rights reserved.
+// Copyright 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -13,4 +13,4 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-// ******************************************************************
\ No newline at end of file
+// ******************************************************************
diff --git a/src/Uno.Core.Build/Uno.Core.Build.csproj b/src/Uno.Core.Build/Uno.Core.Build.csproj
index b24c4bf..4f25ba7 100644
--- a/src/Uno.Core.Build/Uno.Core.Build.csproj
+++ b/src/Uno.Core.Build/Uno.Core.Build.csproj
@@ -19,7 +19,7 @@
https://nv-assets.azurewebsites.net/logos/uno.png
https://github.com/nventive/Uno.Core
A package that includes Uno.Core as a dependency for build tasks and Uno.SourceGeneration binaries.
- Copyright (C) 2015-2018 nventive inc. - all rights reserved
+ Copyright (C) 2015-2020 nventive inc. - all rights reserved
diff --git a/src/Uno.Core.Tests/Collections/ImmutableListFixture.cs b/src/Uno.Core.Tests/Collections/ImmutableListFixture.cs
index 738b9c7..e191e32 100644
--- a/src/Uno.Core.Tests/Collections/ImmutableListFixture.cs
+++ b/src/Uno.Core.Tests/Collections/ImmutableListFixture.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Linq;
using FluentAssertions;
diff --git a/src/Uno.Core.Tests/Collections/ListExtensionsFixture.cs b/src/Uno.Core.Tests/Collections/ListExtensionsFixture.cs
index e87d233..5153307 100644
--- a/src/Uno.Core.Tests/Collections/ListExtensionsFixture.cs
+++ b/src/Uno.Core.Tests/Collections/ListExtensionsFixture.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections;
using System.Collections.Generic;
diff --git a/src/Uno.Core.Tests/Collections/ObservableCollectionExtensionsFixture.cs b/src/Uno.Core.Tests/Collections/ObservableCollectionExtensionsFixture.cs
index 21eb80b..5bde984 100644
--- a/src/Uno.Core.Tests/Collections/ObservableCollectionExtensionsFixture.cs
+++ b/src/Uno.Core.Tests/Collections/ObservableCollectionExtensionsFixture.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
diff --git a/src/Uno.Core.Tests/Collections/SpanExtensionsFixture.cs b/src/Uno.Core.Tests/Collections/SpanExtensionsFixture.cs
index 862f0fb..d59a662 100644
--- a/src/Uno.Core.Tests/Collections/SpanExtensionsFixture.cs
+++ b/src/Uno.Core.Tests/Collections/SpanExtensionsFixture.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
@@ -25,7 +26,7 @@
namespace Uno.Core.Tests.Collections
{
[TestClass]
- public class SpanExtensionsFixture
+ public class SpanExtensionsFixture
{
[TestMethod]
public void When_SelectToSpan()
diff --git a/src/Uno.Core.Tests/Conversions/ConversionExtensionsFixture.cs b/src/Uno.Core.Tests/Conversions/ConversionExtensionsFixture.cs
index 4e62513..f246fce 100644
--- a/src/Uno.Core.Tests/Conversions/ConversionExtensionsFixture.cs
+++ b/src/Uno.Core.Tests/Conversions/ConversionExtensionsFixture.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using CommonServiceLocator;
using Microsoft.VisualStudio.TestTools.UnitTesting;
diff --git a/src/Uno.Core.Tests/Conversions/CustomConversionStrategyFixture.cs b/src/Uno.Core.Tests/Conversions/CustomConversionStrategyFixture.cs
index d933104..920187a 100644
--- a/src/Uno.Core.Tests/Conversions/CustomConversionStrategyFixture.cs
+++ b/src/Uno.Core.Tests/Conversions/CustomConversionStrategyFixture.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using CommonServiceLocator;
using Microsoft.VisualStudio.TestTools.UnitTesting;
diff --git a/src/Uno.Core.Tests/Conversions/DefaultConversionsExtensionsFixture.cs b/src/Uno.Core.Tests/Conversions/DefaultConversionsExtensionsFixture.cs
index 5b1691a..f6edd52 100644
--- a/src/Uno.Core.Tests/Conversions/DefaultConversionsExtensionsFixture.cs
+++ b/src/Uno.Core.Tests/Conversions/DefaultConversionsExtensionsFixture.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Globalization;
using CommonServiceLocator;
diff --git a/src/Uno.Core.Tests/Conversions/EnumConversionStrategyFixture.cs b/src/Uno.Core.Tests/Conversions/EnumConversionStrategyFixture.cs
index 1eb311f..4a02e34 100644
--- a/src/Uno.Core.Tests/Conversions/EnumConversionStrategyFixture.cs
+++ b/src/Uno.Core.Tests/Conversions/EnumConversionStrategyFixture.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using CommonServiceLocator;
using Microsoft.VisualStudio.TestTools.UnitTesting;
diff --git a/src/Uno.Core.Tests/Conversions/FunqAdapter.cs b/src/Uno.Core.Tests/Conversions/FunqAdapter.cs
index f8b6f6b..1716e5d 100644
--- a/src/Uno.Core.Tests/Conversions/FunqAdapter.cs
+++ b/src/Uno.Core.Tests/Conversions/FunqAdapter.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using Funq;
diff --git a/src/Uno.Core.Tests/Conversions/TypeConverterConversionStrategyFixture.cs b/src/Uno.Core.Tests/Conversions/TypeConverterConversionStrategyFixture.cs
index 41451d6..cb572ea 100644
--- a/src/Uno.Core.Tests/Conversions/TypeConverterConversionStrategyFixture.cs
+++ b/src/Uno.Core.Tests/Conversions/TypeConverterConversionStrategyFixture.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using CommonServiceLocator;
using Microsoft.VisualStudio.TestTools.UnitTesting;
diff --git a/src/Uno.Core.Tests/DelegateConditionalWeakTableFixture.cs b/src/Uno.Core.Tests/DelegateConditionalWeakTableFixture.cs
index 1d2474e..6c0f513 100644
--- a/src/Uno.Core.Tests/DelegateConditionalWeakTableFixture.cs
+++ b/src/Uno.Core.Tests/DelegateConditionalWeakTableFixture.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
diff --git a/src/Uno.Core.Tests/DisposableConditionalWeakTableFixture.cs b/src/Uno.Core.Tests/DisposableConditionalWeakTableFixture.cs
index d5f0294..f7f3662 100644
--- a/src/Uno.Core.Tests/DisposableConditionalWeakTableFixture.cs
+++ b/src/Uno.Core.Tests/DisposableConditionalWeakTableFixture.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/src/Uno.Core.Tests/Equality/EqualityComparerExtensionsFixture.cs b/src/Uno.Core.Tests/Equality/EqualityComparerExtensionsFixture.cs
index 37f46e6..a2fa718 100644
--- a/src/Uno.Core.Tests/Equality/EqualityComparerExtensionsFixture.cs
+++ b/src/Uno.Core.Tests/Equality/EqualityComparerExtensionsFixture.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections;
using System.Collections.Generic;
diff --git a/src/Uno.Core.Tests/Equality/KeyEqualityComparerFixture.cs b/src/Uno.Core.Tests/Equality/KeyEqualityComparerFixture.cs
index f9ddcc2..9ef9c25 100644
--- a/src/Uno.Core.Tests/Equality/KeyEqualityComparerFixture.cs
+++ b/src/Uno.Core.Tests/Equality/KeyEqualityComparerFixture.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Uno.Equality;
diff --git a/src/Uno.Core.Tests/Extensions/CollectionExtensionsFixture.DisposableAdd.cs b/src/Uno.Core.Tests/Extensions/CollectionExtensionsFixture.DisposableAdd.cs
index 84fc266..9378545 100644
--- a/src/Uno.Core.Tests/Extensions/CollectionExtensionsFixture.DisposableAdd.cs
+++ b/src/Uno.Core.Tests/Extensions/CollectionExtensionsFixture.DisposableAdd.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/src/Uno.Core.Tests/Extensions/CollectionExtensions_RangeArray_Fixture.cs b/src/Uno.Core.Tests/Extensions/CollectionExtensions_RangeArray_Fixture.cs
index f34111b..b95a1e6 100644
--- a/src/Uno.Core.Tests/Extensions/CollectionExtensions_RangeArray_Fixture.cs
+++ b/src/Uno.Core.Tests/Extensions/CollectionExtensions_RangeArray_Fixture.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
diff --git a/src/Uno.Core.Tests/Extensions/CollectionExtensions_RangeList_Fixture.cs b/src/Uno.Core.Tests/Extensions/CollectionExtensions_RangeList_Fixture.cs
index 83e9a37..5318b01 100644
--- a/src/Uno.Core.Tests/Extensions/CollectionExtensions_RangeList_Fixture.cs
+++ b/src/Uno.Core.Tests/Extensions/CollectionExtensions_RangeList_Fixture.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
diff --git a/src/Uno.Core.Tests/Extensions/DateTimeExtensionsFixture.cs b/src/Uno.Core.Tests/Extensions/DateTimeExtensionsFixture.cs
index 40678af..0f830f2 100644
--- a/src/Uno.Core.Tests/Extensions/DateTimeExtensionsFixture.cs
+++ b/src/Uno.Core.Tests/Extensions/DateTimeExtensionsFixture.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Uno.Extensions;
diff --git a/src/Uno.Core.Tests/Extensions/EnumerableExtensions.FullOuterJoin.cs b/src/Uno.Core.Tests/Extensions/EnumerableExtensions.FullOuterJoin.cs
index 2128563..47ab380 100644
--- a/src/Uno.Core.Tests/Extensions/EnumerableExtensions.FullOuterJoin.cs
+++ b/src/Uno.Core.Tests/Extensions/EnumerableExtensions.FullOuterJoin.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/src/Uno.Core.Tests/Extensions/EnumerableExtensions.SkipLast.cs b/src/Uno.Core.Tests/Extensions/EnumerableExtensions.SkipLast.cs
index f381d01..5e469e1 100644
--- a/src/Uno.Core.Tests/Extensions/EnumerableExtensions.SkipLast.cs
+++ b/src/Uno.Core.Tests/Extensions/EnumerableExtensions.SkipLast.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/src/Uno.Core.Tests/Extensions/ExceptionExtensionsFixture.cs b/src/Uno.Core.Tests/Extensions/ExceptionExtensionsFixture.cs
index 2ba0f82..9783cb0 100644
--- a/src/Uno.Core.Tests/Extensions/ExceptionExtensionsFixture.cs
+++ b/src/Uno.Core.Tests/Extensions/ExceptionExtensionsFixture.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Uno.Extensions;
diff --git a/src/Uno.Core.Tests/Extensions/FormattableExtensionsFixture.cs b/src/Uno.Core.Tests/Extensions/FormattableExtensionsFixture.cs
index 211ff1e..02a0e12 100644
--- a/src/Uno.Core.Tests/Extensions/FormattableExtensionsFixture.cs
+++ b/src/Uno.Core.Tests/Extensions/FormattableExtensionsFixture.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Uno.Extensions;
diff --git a/src/Uno.Core.Tests/Extensions/FuncExtensions.ApplyMemoize.cs b/src/Uno.Core.Tests/Extensions/FuncExtensions.ApplyMemoize.cs
index dec4d16..3b53a10 100644
--- a/src/Uno.Core.Tests/Extensions/FuncExtensions.ApplyMemoize.cs
+++ b/src/Uno.Core.Tests/Extensions/FuncExtensions.ApplyMemoize.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Uno.Extensions;
diff --git a/src/Uno.Core.Tests/Extensions/ObjectExtensionsFixture.cs b/src/Uno.Core.Tests/Extensions/ObjectExtensionsFixture.cs
index 040a881..779cac5 100644
--- a/src/Uno.Core.Tests/Extensions/ObjectExtensionsFixture.cs
+++ b/src/Uno.Core.Tests/Extensions/ObjectExtensionsFixture.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Uno.Extensions;
diff --git a/src/Uno.Core.Tests/Extensions/StreamExtensionsFixture.cs b/src/Uno.Core.Tests/Extensions/StreamExtensionsFixture.cs
new file mode 100644
index 0000000..e2d4885
--- /dev/null
+++ b/src/Uno.Core.Tests/Extensions/StreamExtensionsFixture.cs
@@ -0,0 +1,272 @@
+// ******************************************************************
+// Copyright � 2015-2020 nventive inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// ******************************************************************
+
+using System;
+using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
+using FluentAssertions;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Uno.Extensions;
+
+namespace Uno.Core.Tests.Extensions
+{
+ [TestClass]
+ public class StreamExtensionsFixture
+ {
+ [TestMethod]
+ public void ReadBytes_MemoryStream()
+ {
+ var (sut, originalBytes) = CreateStream(2000);
+
+ var readBytes1 = sut.ReadBytes();
+
+ readBytes1.Should().Equal(originalBytes);
+ }
+
+ [TestMethod]
+ public async Task ReadBytesAsync_MemoryStream()
+ {
+ var (sut, originalBytes) = CreateStream(2000);
+
+ var readBytes1 = await sut.ReadBytesAsync();
+
+ readBytes1.Should().Equal(originalBytes);
+ }
+
+ [TestMethod]
+ public void ReadBytes_UnseekableSyncStream()
+ {
+ var (stream, originalBytes) = CreateStream(50000);
+ var sut = new UnseekableSyncStream(stream);
+
+ var readBytes1 = sut.ReadBytes();
+
+ readBytes1.Should().Equal(originalBytes);
+ }
+
+ [TestMethod]
+ public void ReadBytes_UnseekableSyncStream2()
+ {
+ var (stream, originalBytes) = CreateStream(50000);
+ var sut = new UnseekableSyncStream(stream, true);
+
+ var readBytes1 = sut.ReadBytes();
+
+ readBytes1.Should().Equal(originalBytes);
+ }
+
+ [TestMethod]
+ public async Task ReadBytesAsync_UnseekableSyncStream()
+ {
+ var (stream, originalBytes) = CreateStream(50000);
+ var sut = new UnseekableSyncStream(stream);
+
+ var readBytes1 = await sut.ReadBytesAsync();
+
+ readBytes1.Should().Equal(originalBytes);
+ }
+
+ [TestMethod]
+ public async Task ReadBytesAsync_UnseekableSyncStream2()
+ {
+ var (stream, originalBytes) = CreateStream(50000);
+ var sut = new UnseekableSyncStream(stream, true);
+
+ var readBytes1 = await sut.ReadBytesAsync();
+
+ readBytes1.Should().Equal(originalBytes);
+ }
+
+ [TestMethod]
+ public void ReadBytes_NoLengthStream()
+ {
+ var (sut, _) = CreateStream(0);
+ sut.Length.Should().Be(0);
+
+ var read = sut.ReadBytes();
+ read.Should().BeEmpty();
+ }
+
+ [TestMethod]
+ public async Task ReadBytesAsync_NoLengthStream()
+ {
+ var (sut, _) = CreateStream(0);
+ sut.Length.Should().Be(0);
+
+ var read = await sut.ReadBytesAsync();
+ read.Should().BeEmpty();
+ }
+
+ [TestMethod]
+ public void ReadBytes_NoLengthStream_UnseekableSyncStream()
+ {
+ var (stream, _) = CreateStream(0);
+ var sut = new UnseekableSyncStream(stream);
+
+ var read = sut.ReadBytes();
+ read.Should().BeEmpty();
+ }
+
+ [TestMethod]
+ public async Task ReadBytesAsync_NoLengthStream_UnseekableSyncStream()
+ {
+ var (stream, _) = CreateStream(0);
+ var sut = new UnseekableSyncStream(stream);
+
+ var read = await sut.ReadBytesAsync();
+ read.Should().BeEmpty();
+ }
+
+ [TestMethod]
+ public async Task StartWith()
+ {
+ var (sut, _) = CreateStream(100);
+
+ sut.StartsWith(1, 2, 3, 4, 5).Should().BeTrue();
+ }
+
+ [TestMethod]
+ public void StartWith_Empty()
+ {
+ var (sut, _) = CreateStream(0);
+
+ sut.StartsWith(42, 42, 42, 42, 42).Should().BeFalse();
+ }
+
+ [TestMethod]
+ public void StartWith_Empty2()
+ {
+ var (sut, _) = CreateStream(10);
+
+ sut.StartsWith().Should().BeTrue();
+ }
+
+ [TestMethod]
+ public async Task StartWithAsync_Empty()
+ {
+ var (sut, _) = CreateStream(0);
+
+ (await sut.StartsWithAsync(42, 42, 42, 42, 42)).Should().BeFalse();
+ }
+
+ [TestMethod]
+ public async Task StartWithasync_Empty2()
+ {
+ var (sut, _) = CreateStream(10);
+
+ (await sut.StartsWithAsync()).Should().BeTrue();
+ }
+
+ [TestMethod]
+ public async Task StartWithAsync()
+ {
+ var (sut, _) = CreateStream(100);
+
+ sut.StartsWith(1, 2, 3, 4, 5).Should().BeTrue();
+ }
+
+ [TestMethod]
+ public async Task ReadBytesAsync_NoLengthStream_UnseekableSyncStream2()
+ {
+ var (stream, _) = CreateStream(0);
+ var sut = new UnseekableSyncStream(stream);
+
+ var read = await sut.ReadBytesAsync();
+ read.Should().BeEmpty();
+ }
+
+ [TestMethod]
+ public async Task ToSeekable()
+ {
+ var (stream, expected) = CreateStream(int.MaxValue/50);
+ var unseekable = new UnseekableSyncStream(stream);
+ unseekable.CanSeek.Should().BeFalse();
+
+ var sut = unseekable.ToSeekable();
+
+ sut.CanSeek.Should().BeTrue();
+ (await sut.ReadBytesAsync()).Should().Equal(expected);
+ }
+
+ private static (MemoryStream Stream, byte[] bytes) CreateStream(int length = 2000)
+ {
+ var bytes = Enumerable
+ .Range(1, length)
+ .Select(i =>
+ {
+ unchecked
+ {
+ return (byte) i;
+ }
+ })
+ .ToArray();
+
+ var stream = new MemoryStream(bytes);
+ return (stream, bytes);
+ }
+
+ private class UnseekableSyncStream : Stream
+ {
+ private readonly Stream _stream;
+
+ public UnseekableSyncStream(Stream stream, bool canSeek = false)
+ {
+ _stream = stream;
+ CanSeek = canSeek;
+ }
+
+ public override void Flush()
+ {
+ }
+
+ public override long Seek(long offset, SeekOrigin origin)
+ {
+ throw new NotSupportedException();
+ }
+
+ public override void SetLength(long value)
+ {
+ throw new NotSupportedException();
+ }
+
+ public override int Read(byte[] buffer, int offset, int count)
+ {
+ var newCount = count > 2 ? count / 2 : count;
+ return _stream.Read(buffer, offset, newCount);
+ }
+
+ public override void Write(byte[] buffer, int offset, int count)
+ {
+ throw new NotSupportedException();
+ }
+
+ public override bool CanRead => true;
+ public override bool CanSeek { get; }
+
+ public override bool CanWrite => false;
+
+ public override long Length => throw new NotSupportedException();
+
+ public override long Position
+ {
+ get => throw new NotSupportedException();
+ set => throw new NotSupportedException();
+ }
+ }
+ }
+}
diff --git a/src/Uno.Core.Tests/Extensions/StringExtensionsFixture.cs b/src/Uno.Core.Tests/Extensions/StringExtensionsFixture.cs
index 9b42bac..c28e545 100644
--- a/src/Uno.Core.Tests/Extensions/StringExtensionsFixture.cs
+++ b/src/Uno.Core.Tests/Extensions/StringExtensionsFixture.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,9 +14,12 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Globalization;
using System.Linq;
+using FluentAssertions;
+using FluentAssertions.Execution;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Uno.Extensions;
@@ -28,71 +31,81 @@ public class StringExtensionsFixture
[TestMethod]
public void IsNullOrEmpty()
{
- Assert.IsTrue(((string)null).IsNullOrEmpty());
- Assert.IsTrue("".IsNullOrEmpty());
- Assert.IsFalse("A".IsNullOrEmpty());
+ using var _ = new AssertionScope();
+
+ ((string)null).IsNullOrEmpty().Should().BeTrue();
+ "".IsNullOrEmpty().Should().BeTrue();
+ string.Empty.IsNullOrEmpty().Should().BeTrue();
+ "A".IsNullOrEmpty().Should().BeFalse();
}
[TestMethod]
public void HasValue()
{
- Assert.IsFalse(((string)null).HasValue());
- Assert.IsFalse("".HasValue());
- Assert.IsTrue("A".HasValue());
+ using var _ = new AssertionScope();
+
+ ((string)null).HasValue().Should().BeFalse();
+ "".HasValue().Should().BeFalse();
+ string.Empty.HasValue().Should().BeFalse();
+ "A".HasValue().Should().BeTrue();
}
[TestMethod]
public void IsNumber()
{
- Assert.IsTrue("123".IsNumber());
- Assert.IsTrue("123 ".IsNumber());
- Assert.IsTrue(" 123".IsNumber());
- Assert.IsTrue("\t\t123".IsNumber());
+ using var _ = new AssertionScope();
+
+ "123".IsNumber().Should().BeTrue();
+ "123 ".IsNumber().Should().BeTrue();
+ " 123".IsNumber().Should().BeTrue();
+ "\t\t123".IsNumber().Should().BeTrue();
- Assert.IsTrue("₀₁₂₃₄₅₆₇₈₉".IsNumber(), "subscripts");
- Assert.IsTrue("⁰¹²³⁴⁵⁶⁷⁸⁹".IsNumber(), "superscripts");
+ "₀₁₂₃₄₅₆₇₈₉".IsNumber().Should().BeTrue("subscripts");
+ "⁰¹²³⁴⁵⁶⁷⁸⁹".IsNumber().Should().BeTrue("superscripts");
- Assert.IsTrue("¼½¾".IsNumber(), "fractions 1");
- Assert.IsTrue("⅓⅔⅕⅖⅗⅘⅙⅚⅛⅜⅝⅞".IsNumber(), "fractions 2");
+ "¼½¾".IsNumber().Should().BeTrue("fractions 1");
+ "⅓⅔⅕⅖⅗⅘⅙⅚⅛⅜⅝⅞".IsNumber().Should().BeTrue("fractions 2");
//Assert.IsTrue("⅐⅑⅒".IsNumber()); THOSE ARE NOT SUPPORTED BY .NET!
// Roman numerals http://www.unicode.org/charts/PDF/U2150.pdf
- Assert.IsTrue("ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫⅬⅭⅮⅯ".IsNumber(), "romans upper"); // watch-out, those are not letters! ;-)
- Assert.IsTrue("ⅰⅱⅲⅳⅴⅵⅶⅷⅸⅹⅺⅻⅼⅽⅾⅿ".IsNumber(), "romans lower"); // watch-out, those are not letters! ;-)
+ "ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫⅬⅭⅮⅯ".IsNumber().Should().BeTrue("romans upper"); // watch-out, those are not letters! ;-)
+ "ⅰⅱⅲⅳⅴⅵⅶⅷⅸⅹⅺⅻⅼⅽⅾⅿ".IsNumber().Should().BeTrue("romans lower"); // watch-out, those are not letters! ;-)
// Umbrella are not supporting Aegean numbers, as they are 32bits unicode characters
- Assert.IsTrue("٠١٢٣٤٥٦٧٨٩".IsNumber(), "Eastern Arabic numerals");
- Assert.IsTrue("۰۱۲۳۴۵۶۷۸۹".IsNumber(), "Persian numerals");
+ "٠١٢٣٤٥٦٧٨٩".IsNumber().Should().BeTrue("Eastern Arabic numerals");
+ "۰۱۲۳۴۵۶۷۸۹".IsNumber().Should().BeTrue("Persian numerals");
- Assert.IsFalse("1A2".IsNumber());
- Assert.IsFalse("1A2".IsNumber());
+ "1A2".IsNumber().Should().BeFalse();
+ "1A2".IsNumber().Should().BeFalse();
}
[TestMethod]
public void IsDigit()
{
- Assert.IsTrue("0123456789".IsDigit(), "Normal digits");
- Assert.IsTrue("٠١٢٣٤٥٦٧٨٩".IsDigit(), "Eastern Arabic numerals");
- Assert.IsTrue("۰۱۲۳۴۵۶۷۸۹".IsDigit(), "Persian numerals");
-
- Assert.IsTrue(" 123".IsDigit(), "space before");
- Assert.IsTrue("123 ".IsDigit(), "space after");
- Assert.IsTrue("\t\t123".IsDigit(), "tab before");
-
- Assert.IsFalse("₀₁₂₃₄₅₆₇₈₉".IsDigit());
- Assert.IsFalse("⁰¹²³⁴⁵⁶⁷⁸⁹".IsDigit());
- Assert.IsFalse("¼½¾".IsDigit());
- Assert.IsFalse("⅓⅔⅕⅖⅗⅘⅙⅚⅛⅜⅝⅞".IsDigit());
- Assert.IsFalse("⅐⅑⅒".IsDigit());
- Assert.IsFalse("ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫⅬⅭⅮⅯ".IsDigit()); // watch-out, those are not letters! ;-)
- Assert.IsFalse("ⅰⅱⅲⅳⅴⅵⅶⅷⅸⅹⅺⅻⅼⅽⅾⅿ".IsDigit()); // watch-out, those are not letters! ;-)
+ using var _ = new AssertionScope();
+
+ "0123456789".IsDigit().Should().BeTrue("Normal digits");
+ "٠١٢٣٤٥٦٧٨٩".IsDigit().Should().BeTrue("Eastern Arabic numerals");
+ "۰۱۲۳۴۵۶۷۸۹".IsDigit().Should().BeTrue("Persian numerals");
+
+ " 123".IsDigit().Should().BeTrue("space before");
+ "123 ".IsDigit().Should().BeTrue("space after");
+ "\t\t123".IsDigit().Should().BeTrue("tab before");
+
+ "₀₁₂₃₄₅₆₇₈₉".IsDigit().Should().BeFalse();
+ "⁰¹²³⁴⁵⁶⁷⁸⁹".IsDigit().Should().BeFalse();
+ "¼½¾".IsDigit().Should().BeFalse();
+ "⅓⅔⅕⅖⅗⅘⅙⅚⅛⅜⅝⅞".IsDigit().Should().BeFalse();
+ "⅐⅑⅒".IsDigit().Should().BeFalse();
+ "ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫⅬⅭⅮⅯ".IsDigit().Should().BeFalse(); // watch-out, those are not letters! ;-)
+ "ⅰⅱⅲⅳⅴⅵⅶⅷⅸⅹⅺⅻⅼⅽⅾⅿ".IsDigit().Should().BeFalse(); // watch-out, those are not letters! ;-)
// Full Width digits http://www.unicode.org/charts/PDF/UFF00.pdf
var fullWidthDigits = "\uFF10\uFF11\uFF12\uFF13\uFF14\uFF15\uFF16\uFF17\uFF18\uFF19";
- Assert.IsTrue(fullWidthDigits.IsNumber(), "Full Width Digits");
+ fullWidthDigits.IsNumber().Should().BeTrue("Full Width Digits");
- Assert.IsFalse("1A2".IsDigit());
+ "1A2".IsDigit().Should().BeFalse();
}
[TestMethod]
@@ -126,6 +139,8 @@ public void CustomStringFormatAcceptsOneAndMinusOne()
[TestMethod]
public void StringFormatsAreCompatible()
{
+ using var _ = new AssertionScope();
+
var formats = new[]
{
"{0:+#.#;-#.#;ZERO}",
@@ -139,6 +154,7 @@ public void StringFormatsAreCompatible()
CultureInfo.InvariantCulture,
new CultureInfo("fr-CA"),
new CultureInfo("en-US"),
+ new CultureInfo("ja-JP"),
new CultureInfo("ru")
};
@@ -146,15 +162,13 @@ public void StringFormatsAreCompatible()
{
foreach (var value in values)
{
- Assert.AreEqual(
- string.Format(format, value),
- StringExtensions.Format(format, value));
+ var noCultureFormat = StringExtensions.Format(format, value);
+ noCultureFormat.Should().Be(string.Format(format, value));
foreach (var culture in cultures)
{
- Assert.AreEqual(
- string.Format(culture, format, value),
- StringExtensions.Format(culture, format, value));
+ var cultureFormat = StringExtensions.Format(culture, format, value);
+ cultureFormat.Should().Be(string.Format(culture, format, value));
}
}
}
@@ -163,6 +177,8 @@ public void StringFormatsAreCompatible()
[TestMethod]
public void StringFormatsAreComplementary()
{
+ using var _ = new AssertionScope();
+
var formats = new[]
{
"{0:+#.##;-#.##;ZERO;ONE;MINUS ONE}",
@@ -184,29 +200,26 @@ public void StringFormatsAreComplementary()
{
foreach (var value in identicalValues)
{
- Assert.AreEqual(
- string.Format(format, value),
- StringExtensions.Format(format, value));
+ var identicalValueFormat = StringExtensions.Format(format, value);
+ identicalValueFormat.Should().Be(string.Format(format, value), "using current culture");
foreach (var culture in cultures)
{
- Assert.AreEqual(
- string.Format(culture, format, value),
- StringExtensions.Format(culture, format, value));
+ var identicalValueFormatWithCulture = StringExtensions.Format(culture, format, value);
+ identicalValueFormatWithCulture.Should().Be(string.Format(culture, format, value), "using culture " + culture);
}
}
foreach (var value in differentValues)
{
- Assert.AreNotEqual(
- string.Format(format, value),
- StringExtensions.Format(format, value));
+ var differentValueFormat = StringExtensions.Format(format, value);
+ differentValueFormat.Should().NotBe(string.Format(format, value), "using current culture");
foreach (var culture in cultures)
{
- Assert.AreNotEqual(
- string.Format(culture, format, value),
- StringExtensions.Format(culture, format, value));
+ var differenceValueFOrmatWithCulture = StringExtensions.Format(culture, format, value);
+ differenceValueFOrmatWithCulture
+ .Should().NotBe(string.Format(culture, format, value), "using culture " + culture);
}
}
}
@@ -215,6 +228,8 @@ public void StringFormatsAreComplementary()
[TestMethod]
public void CustomStringFormatIsTolerant()
{
+ using var _ = new AssertionScope();
+
var formats = new[]
{
"This has no value",
@@ -241,13 +256,15 @@ public void CustomStringFormatIsTolerant()
foreach (var pair in formats.Zip(expectedResults, (format, expected) => new { format, expected }))
{
- Assert.AreEqual(StringExtensions.Format(pair.format, 42), pair.expected);
+ StringExtensions.Format(pair.format, 42).Should().Be(pair.expected);
}
}
[TestMethod]
public void StringFormatHasEscapedChars()
{
+ using var _ = new AssertionScope();
+
var formats = new[]
{
@"{0:\;#.##\;;(#.##);\;\-\-\;;\'XXX\'}",
@@ -264,7 +281,7 @@ public void StringFormatHasEscapedChars()
var original = string.Format(format, value);
var custom = StringExtensions.Format(format, value);
- Assert.AreEqual(original, custom);
+ custom.Should().Be(original);
}
}
}
@@ -272,6 +289,8 @@ public void StringFormatHasEscapedChars()
[TestMethod]
public void StringFormatsErrorHandlingAreIdentical()
{
+ using var _ = new AssertionScope();
+
var formats = new[]
{
@"{0:#.##;(#.##);ZERO",
@@ -290,23 +309,24 @@ public void StringFormatsErrorHandlingAreIdentical()
{
var custom = StringExtensions.Format(format, 42);
- Assert.AreEqual(original, custom);
+ custom.Should().Be(original);
}
catch
{
- Assert.Fail($"string.Format did not fail for {format}. StringExtensions.Format shouldn't have failed either.");
+ AssertionScope.Current.FailWith("string.Format did not fail for {0}. StringExtensions.Format shouldn't have failed either.", format);
}
}
- catch
+ catch(Exception originalEx)
{
try
{
StringExtensions.Format(format, 42);
- Assert.Fail($"string.Format failed for {format}. StringExtensions.Format should have failed too.");
+ AssertionScope.Current.FailWith("string.Format failed for {0}. StringExtensions.Format should have failed too.", format);
}
- catch
+ catch(Exception exceptionEx)
{
+ exceptionEx.Should().BeOfType(originalEx.GetType());
}
}
}
@@ -315,15 +335,17 @@ public void StringFormatsErrorHandlingAreIdentical()
[TestMethod]
public void CustomStringFormatsWithMultipleValues()
{
- Assert.AreEqual(
- StringExtensions.Format("For {0} and {1}?", 42, 3.1416),
- "For 42 and 3.1416?");
- Assert.AreEqual(
- StringExtensions.Format("For {0:#.##;(#.##);ZERO} and {1:#.##;(#.##);ZERO}?", 42, 3.1416),
- "For 42 and 3.14?");
- Assert.AreEqual(
- StringExtensions.Format("For {0:#.##;(#.##);ZERO;ONE}, {1:#.##;(#.##);ZERO;ONE} and {2:#.##;(#.##);ZERO;ONE}?", 42, 3.1416, 1.004),
- "For 42, 3.14 and ONE?");
+ using var _ = new AssertionScope();
+
+ StringExtensions
+ .Format("For {0} and {1}?", 42, 3.1416)
+ .Should().Be("For 42 and 3.1416?");
+ StringExtensions
+ .Format("For {0:#.##;(#.##);ZERO} and {1:#.##;(#.##);ZERO}?", 42, 3.1416)
+ .Should().Be("For 42 and 3.14?");
+ StringExtensions
+ .Format("For {0:#.##;(#.##);ZERO;ONE}, {1:#.##;(#.##);ZERO;ONE} and {2:#.##;(#.##);ZERO;ONE}?", 42, 3.1416, 1.004)
+ .Should().Be("For 42, 3.14 and ONE?");
}
}
}
diff --git a/src/Uno.Core.Tests/Extensions/Transactional.ImmutableDictionary.cs b/src/Uno.Core.Tests/Extensions/Transactional.ImmutableDictionary.cs
index a33b146..4790dc5 100644
--- a/src/Uno.Core.Tests/Extensions/Transactional.ImmutableDictionary.cs
+++ b/src/Uno.Core.Tests/Extensions/Transactional.ImmutableDictionary.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Immutable;
using FluentAssertions;
diff --git a/src/Uno.Core.Tests/Extensions/Transactional.ImmutableQueue.cs b/src/Uno.Core.Tests/Extensions/Transactional.ImmutableQueue.cs
index 050c3df..d04e021 100644
--- a/src/Uno.Core.Tests/Extensions/Transactional.ImmutableQueue.cs
+++ b/src/Uno.Core.Tests/Extensions/Transactional.ImmutableQueue.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Immutable;
using System.Linq;
diff --git a/src/Uno.Core.Tests/Extensions/Transactional.Update.cs b/src/Uno.Core.Tests/Extensions/Transactional.Update.cs
index 85142a0..7b99d0a 100644
--- a/src/Uno.Core.Tests/Extensions/Transactional.Update.cs
+++ b/src/Uno.Core.Tests/Extensions/Transactional.Update.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Immutable;
using Microsoft.VisualStudio.TestTools.UnitTesting;
diff --git a/src/Uno.Core.Tests/Extensions/ValueType/ValueSupportFixture.cs b/src/Uno.Core.Tests/Extensions/ValueType/ValueSupportFixture.cs
index 209fceb..bc8498d 100644
--- a/src/Uno.Core.Tests/Extensions/ValueType/ValueSupportFixture.cs
+++ b/src/Uno.Core.Tests/Extensions/ValueType/ValueSupportFixture.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System.Reflection;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Uno.Extensions.ValueType;
diff --git a/src/Uno.Core.Tests/FuncsFixture.cs b/src/Uno.Core.Tests/FuncsFixture.cs
index d1e447b..6d35367 100644
--- a/src/Uno.Core.Tests/FuncsFixture.cs
+++ b/src/Uno.Core.Tests/FuncsFixture.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Threading;
using System.Threading.Tasks;
@@ -50,4 +51,4 @@ public async Task When_AsLockedMemoized_ThenSameInstance()
Assert.IsTrue(object.ReferenceEquals(a.Result, b.Result));
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core.Tests/Given_Predicates.cs b/src/Uno.Core.Tests/Given_Predicates.cs
index 8ab15b9..cf87651 100644
--- a/src/Uno.Core.Tests/Given_Predicates.cs
+++ b/src/Uno.Core.Tests/Given_Predicates.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/src/Uno.Core.Tests/LoggerFixture.cs b/src/Uno.Core.Tests/LoggerFixture.cs
index e8c305e..ad70bcd 100644
--- a/src/Uno.Core.Tests/LoggerFixture.cs
+++ b/src/Uno.Core.Tests/LoggerFixture.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
@@ -49,4 +50,4 @@ public void TestDebug()
this.Log().Debug("Test logging");
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core.Tests/Options/OptionEqualityComparerFixture.cs b/src/Uno.Core.Tests/Options/OptionEqualityComparerFixture.cs
index 300944c..d40a2c4 100644
--- a/src/Uno.Core.Tests/Options/OptionEqualityComparerFixture.cs
+++ b/src/Uno.Core.Tests/Options/OptionEqualityComparerFixture.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
diff --git a/src/Uno.Core.Tests/Properties/AssemblyInfo.cs b/src/Uno.Core.Tests/Properties/AssemblyInfo.cs
index 66f14ae..71938a9 100644
--- a/src/Uno.Core.Tests/Properties/AssemblyInfo.cs
+++ b/src/Uno.Core.Tests/Properties/AssemblyInfo.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
diff --git a/src/Uno.Core.Tests/Reflection/TypeExtensionsFixture.cs b/src/Uno.Core.Tests/Reflection/TypeExtensionsFixture.cs
index c00db03..d8de2a0 100644
--- a/src/Uno.Core.Tests/Reflection/TypeExtensionsFixture.cs
+++ b/src/Uno.Core.Tests/Reflection/TypeExtensionsFixture.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
diff --git a/src/Uno.Core.Tests/Threading/AsyncLockFixture.cs b/src/Uno.Core.Tests/Threading/AsyncLockFixture.cs
index 27368ee..2ea22a1 100644
--- a/src/Uno.Core.Tests/Threading/AsyncLockFixture.cs
+++ b/src/Uno.Core.Tests/Threading/AsyncLockFixture.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
@@ -39,8 +40,8 @@ public class AsyncLockFixture
[TestMethod]
[Timeout(_timeout)]
- [Ignore] // https://github.com/nventive/Uno.Core/issues/48
- public async Task TestUnlockReleaseNextSynchronously()
+ [Ignore] // https://github.com/nventive/Uno.Core/issues/48
+ public async Task TestUnlockReleaseNextSynchronously()
{
Console.WriteLine($"Running on thread {Thread.CurrentThread.ManagedThreadId}");
diff --git a/src/Uno.Core.Tests/Threading/FastTaskCompletionSourceFixture.cs b/src/Uno.Core.Tests/Threading/FastTaskCompletionSourceFixture.cs
index 0e0fc7c..87571b6 100644
--- a/src/Uno.Core.Tests/Threading/FastTaskCompletionSourceFixture.cs
+++ b/src/Uno.Core.Tests/Threading/FastTaskCompletionSourceFixture.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Runtime.ExceptionServices;
using System.Threading;
diff --git a/src/Uno.Core.Tests/TransactionalFixture.ImmutableDictionary.cs b/src/Uno.Core.Tests/TransactionalFixture.ImmutableDictionary.cs
index a32e598..37865e0 100644
--- a/src/Uno.Core.Tests/TransactionalFixture.ImmutableDictionary.cs
+++ b/src/Uno.Core.Tests/TransactionalFixture.ImmutableDictionary.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
diff --git a/src/Uno.Core.Tests/TransactionalFixture.ImmutableList.cs b/src/Uno.Core.Tests/TransactionalFixture.ImmutableList.cs
index 73ff19e..986a064 100644
--- a/src/Uno.Core.Tests/TransactionalFixture.ImmutableList.cs
+++ b/src/Uno.Core.Tests/TransactionalFixture.ImmutableList.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
diff --git a/src/Uno.Core.Tests/TransactionalFixture.cs b/src/Uno.Core.Tests/TransactionalFixture.cs
index 44a42ca..ea9389b 100644
--- a/src/Uno.Core.Tests/TransactionalFixture.cs
+++ b/src/Uno.Core.Tests/TransactionalFixture.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/src/Uno.Core.Tests/Uno.Core.Tests.csproj b/src/Uno.Core.Tests/Uno.Core.Tests.csproj
index 04a77a5..1fc57cd 100644
--- a/src/Uno.Core.Tests/Uno.Core.Tests.csproj
+++ b/src/Uno.Core.Tests/Uno.Core.Tests.csproj
@@ -3,7 +3,7 @@
net46
1701;1702;1705;1998
- 7.3
+ latest
@@ -11,10 +11,11 @@
-
+
+
all
diff --git a/src/Uno.Core.Tests/_TestUtils/AsyncTestContext.cs b/src/Uno.Core.Tests/_TestUtils/AsyncTestContext.cs
index 34ee27d..c9c056d 100644
--- a/src/Uno.Core.Tests/_TestUtils/AsyncTestContext.cs
+++ b/src/Uno.Core.Tests/_TestUtils/AsyncTestContext.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Linq;
using System.Threading;
@@ -51,4 +52,4 @@ public void Validate()
Assert.AreEqual(this, _context.Value);
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core.Tests/_TestUtils/AsyncTestRunner.cs b/src/Uno.Core.Tests/_TestUtils/AsyncTestRunner.cs
index 767a907..f4eb436 100644
--- a/src/Uno.Core.Tests/_TestUtils/AsyncTestRunner.cs
+++ b/src/Uno.Core.Tests/_TestUtils/AsyncTestRunner.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
@@ -352,4 +353,4 @@ public SyncFlag(int position)
public void Canceled() => _task.TrySetCanceled();
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core.Tests/_TestUtils/SchedulerExtensions.cs b/src/Uno.Core.Tests/_TestUtils/SchedulerExtensions.cs
index 88a8356..2227bd4 100644
--- a/src/Uno.Core.Tests/_TestUtils/SchedulerExtensions.cs
+++ b/src/Uno.Core.Tests/_TestUtils/SchedulerExtensions.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Linq;
using System.Reactive;
diff --git a/src/Uno.Core.sln b/src/Uno.Core.sln
index 9be4532..e4a6c18 100644
--- a/src/Uno.Core.sln
+++ b/src/Uno.Core.sln
@@ -1,14 +1,22 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.27009.1
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30709.64
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Uno.Core.Tests", "Uno.Core.Tests\Uno.Core.Tests.csproj", "{B554D7E4-17FC-4909-BA06-80B5B2FB0BD1}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Uno.Core.Tests", "Uno.Core.Tests\Uno.Core.Tests.csproj", "{B554D7E4-17FC-4909-BA06-80B5B2FB0BD1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Uno.Core", "Uno.Core\Uno.Core.csproj", "{ABB4F177-6966-4C24-A465-A5E941A70680}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Uno.Core.Build", "Uno.Core.Build\Uno.Core.Build.csproj", "{E414AC61-1BED-458E-A78C-868514DDA1A2}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{1D12D059-9984-473D-9A9A-2D4FCDC0355E}"
+ ProjectSection(SolutionItems) = preProject
+ ..\.azure-pipelines.yml = ..\.azure-pipelines.yml
+ ..\build\build.ps1 = ..\build\build.ps1
+ ..\build\header.txt = ..\build\header.txt
+ ..\Readme.md = ..\Readme.md
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
diff --git a/src/Uno.Core/ActionAsync.cs b/src/Uno.Core/ActionAsync.cs
index 89c56c0..de74048 100644
--- a/src/Uno.Core/ActionAsync.cs
+++ b/src/Uno.Core/ActionAsync.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Text;
@@ -22,7 +23,7 @@
namespace Uno
{
- public delegate Task ActionAsync(CancellationToken ct);
+ public delegate Task ActionAsync(CancellationToken ct);
public delegate Task ActionAsync(CancellationToken ct, T1 value);
public delegate Task ActionAsync(CancellationToken ct, T1 t1, T2 t2);
public delegate Task ActionAsync(CancellationToken ct, T1 t1, T2 t2, T3 t3);
diff --git a/src/Uno.Core/Actions.Generic.cs b/src/Uno.Core/Actions.Generic.cs
index 623d5db..7a5d015 100644
--- a/src/Uno.Core/Actions.Generic.cs
+++ b/src/Uno.Core/Actions.Generic.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
namespace Uno
@@ -47,4 +48,4 @@ public static class Actions
///
public static readonly ActionAsync NullAsync = (_, __, ___) => Actions.NullTask;
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core/Actions.cs b/src/Uno.Core/Actions.cs
index fd31d5f..667ad8c 100644
--- a/src/Uno.Core/Actions.cs
+++ b/src/Uno.Core/Actions.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Threading;
using System.Threading.Tasks;
@@ -23,60 +24,60 @@
namespace Uno
{
- public static class Actions
- {
- ///
- /// An action which does nothing.
- ///
- public static readonly Action Null = () => { };
+ public static class Actions
+ {
+ ///
+ /// An action which does nothing.
+ ///
+ public static readonly Action Null = () => { };
- ///
- /// An ActionAsync which does nothing.
- ///
- public static readonly ActionAsync NullAsync = _ => NullTask;
- internal static readonly Task NullTask = _Task.FromResult(true);
+ ///
+ /// An ActionAsync which does nothing.
+ ///
+ public static readonly ActionAsync NullAsync = _ => NullTask;
+ internal static readonly Task NullTask = _Task.FromResult(true);
- public static Action Create(Action action)
- {
- return action;
- }
+ public static Action Create(Action action)
+ {
+ return action;
+ }
- public static ActionAsync CreateAsync(ActionAsync action)
- {
- return action;
- }
+ public static ActionAsync CreateAsync(ActionAsync action)
+ {
+ return action;
+ }
- public static Action Create(Action action)
- {
- return action;
- }
+ public static Action Create(Action action)
+ {
+ return action;
+ }
- public static ActionAsync CreateAsync(ActionAsync action)
- {
- return action;
- }
+ public static ActionAsync CreateAsync(ActionAsync action)
+ {
+ return action;
+ }
- ///
- /// Creates an action that will only execute once the provided action, even if called multiple times. This is Thread Safe.
- ///
- /// The action to be executed once
- /// An action.
- public static Action CreateOnce(Action action)
- {
- var once = 0;
+ ///
+ /// Creates an action that will only execute once the provided action, even if called multiple times. This is Thread Safe.
+ ///
+ /// The action to be executed once
+ /// An action.
+ public static Action CreateOnce(Action action)
+ {
+ var once = 0;
- return () =>
- {
- if (Interlocked.Exchange(ref once, 1) == 0)
- {
- action();
- }
- };
- }
+ return () =>
+ {
+ if (Interlocked.Exchange(ref once, 1) == 0)
+ {
+ action();
+ }
+ };
+ }
- public static IDisposable ToDisposable(Action action)
- {
- return action.ToDisposable();
- }
- }
-}
\ No newline at end of file
+ public static IDisposable ToDisposable(Action action)
+ {
+ return action.ToDisposable();
+ }
+ }
+}
diff --git a/src/Uno.Core/Async/ActionService.cs b/src/Uno.Core/Async/ActionService.cs
index 14e636e..ab33abc 100644
--- a/src/Uno.Core/Async/ActionService.cs
+++ b/src/Uno.Core/Async/ActionService.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/src/Uno.Core/Async/AsyncResult.cs b/src/Uno.Core/Async/AsyncResult.cs
index 8fc5024..9577241 100644
--- a/src/Uno.Core/Async/AsyncResult.cs
+++ b/src/Uno.Core/Async/AsyncResult.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Net;
diff --git a/src/Uno.Core/Async/AsyncResultDecorator.cs b/src/Uno.Core/Async/AsyncResultDecorator.cs
index 715647e..b9fff08 100644
--- a/src/Uno.Core/Async/AsyncResultDecorator.cs
+++ b/src/Uno.Core/Async/AsyncResultDecorator.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/src/Uno.Core/Async/IActionService.cs b/src/Uno.Core/Async/IActionService.cs
index 4536ed1..b3fc013 100644
--- a/src/Uno.Core/Async/IActionService.cs
+++ b/src/Uno.Core/Async/IActionService.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Security.Principal;
diff --git a/src/Uno.Core/Async/IAsyncService.cs b/src/Uno.Core/Async/IAsyncService.cs
index ea68289..2fb77a2 100644
--- a/src/Uno.Core/Async/IAsyncService.cs
+++ b/src/Uno.Core/Async/IAsyncService.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/src/Uno.Core/Async/SyncService.cs b/src/Uno.Core/Async/SyncService.cs
index 402ae3d..1a04d2e 100644
--- a/src/Uno.Core/Async/SyncService.cs
+++ b/src/Uno.Core/Async/SyncService.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/src/Uno.Core/Async/TaskExtensions.cs b/src/Uno.Core/Async/TaskExtensions.cs
index 9963c5a..1215538 100644
--- a/src/Uno.Core/Async/TaskExtensions.cs
+++ b/src/Uno.Core/Async/TaskExtensions.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/src/Uno.Core/Async/TaskUtilities.cs b/src/Uno.Core/Async/TaskUtilities.cs
index ba2116b..d797dab 100644
--- a/src/Uno.Core/Async/TaskUtilities.cs
+++ b/src/Uno.Core/Async/TaskUtilities.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/src/Uno.Core/Builder/BuilderContext.cs b/src/Uno.Core/Builder/BuilderContext.cs
index be8c023..2573611 100644
--- a/src/Uno.Core/Builder/BuilderContext.cs
+++ b/src/Uno.Core/Builder/BuilderContext.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using Uno.Collections;
using System;
using System.Collections.Generic;
diff --git a/src/Uno.Core/Builder/IBuilder.cs b/src/Uno.Core/Builder/IBuilder.cs
index f35ab25..6ee45c2 100644
--- a/src/Uno.Core/Builder/IBuilder.cs
+++ b/src/Uno.Core/Builder/IBuilder.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/src/Uno.Core/CachedTuple.cs b/src/Uno.Core/CachedTuple.cs
index bc3c32b..586e00f 100644
--- a/src/Uno.Core/CachedTuple.cs
+++ b/src/Uno.Core/CachedTuple.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Text;
@@ -23,8 +24,8 @@ namespace Uno
///
/// A tuple implementation that caches the GetHashCode value for faster lookup performance.
///
- public class CachedTuple
- {
+ public class CachedTuple
+ {
///
/// Creates a tuple with two values.
///
diff --git a/src/Uno.Core/Cancellable.cs b/src/Uno.Core/Cancellable.cs
index 6747dc7..a3cb752 100644
--- a/src/Uno.Core/Cancellable.cs
+++ b/src/Uno.Core/Cancellable.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Threading;
using Uno.Extensions;
@@ -30,7 +31,7 @@ public Cancellable(Action onCancel)
_onCancel = onCancel.Validation().NotNull("onCancel");
}
- public bool IsCancelled { get { return _isCancelled != 0; } }
+ public bool IsCancelled => _isCancelled != 0;
public void Cancel()
{
diff --git a/src/Uno.Core/Collections/CollectionAdapter.cs b/src/Uno.Core/Collections/CollectionAdapter.cs
index 2c7d45c..d86f5d2 100644
--- a/src/Uno.Core/Collections/CollectionAdapter.cs
+++ b/src/Uno.Core/Collections/CollectionAdapter.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections;
using System.Collections.Generic;
@@ -140,4 +141,4 @@ IEnumerator IEnumerable.GetEnumerator()
#endregion
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core/Collections/CollectionDecorator.cs b/src/Uno.Core/Collections/CollectionDecorator.cs
index 1976071..f202994 100644
--- a/src/Uno.Core/Collections/CollectionDecorator.cs
+++ b/src/Uno.Core/Collections/CollectionDecorator.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System.Collections;
using System.Collections.Generic;
using Uno.Decorator;
@@ -81,4 +82,4 @@ IEnumerator IEnumerable.GetEnumerator()
#endregion
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core/Collections/CollectionExtensions.cs b/src/Uno.Core/Collections/CollectionExtensions.cs
index b64b2d5..595b204 100644
--- a/src/Uno.Core/Collections/CollectionExtensions.cs
+++ b/src/Uno.Core/Collections/CollectionExtensions.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
@@ -400,4 +401,4 @@ public static List ToRangeList(this List source, int
return output;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core/Collections/ConcatenatingDictionary.cs b/src/Uno.Core/Collections/ConcatenatingDictionary.cs
index bbe9492..7d7715b 100644
--- a/src/Uno.Core/Collections/ConcatenatingDictionary.cs
+++ b/src/Uno.Core/Collections/ConcatenatingDictionary.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/src/Uno.Core/Collections/ConditionalWeakTableSlow.cs b/src/Uno.Core/Collections/ConditionalWeakTableSlow.cs
index deb2464..ff5e2e4 100644
--- a/src/Uno.Core/Collections/ConditionalWeakTableSlow.cs
+++ b/src/Uno.Core/Collections/ConditionalWeakTableSlow.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/src/Uno.Core/Collections/DictionaryExtensions.cs b/src/Uno.Core/Collections/DictionaryExtensions.cs
index 5e4b4f6..6baf816 100644
--- a/src/Uno.Core/Collections/DictionaryExtensions.cs
+++ b/src/Uno.Core/Collections/DictionaryExtensions.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
@@ -38,8 +39,8 @@ public static TValue FindOrCreate(this IDictionary i
}
public static TValue FindOrCreate(this SynchronizedDictionary items, TKey key, Func factory)
- {
- TValue value = default(TValue);
+ {
+ TValue value = default(TValue);
using (items.Lock.CreateWriterScope())
{
@@ -50,21 +51,21 @@ public static TValue FindOrCreate(this SynchronizedDictionary(this ISynchronizable> items, TKey key, Func factory)
- {
- TValue value = default(TValue);
+ {
+ TValue value = default(TValue);
- items.Lock.Write(d => d.TryGetValue(key, out value), d => d.Add(key, value = factory()));
+ items.Lock.Write(d => d.TryGetValue(key, out value), d => d.Add(key, value = factory()));
- return value;
- }
+ return value;
+ }
public static KeyValuePair[] ToArrayLocked(this ISynchronizable> items)
- {
- return items.Lock.Read(d => d.ToArray());
- }
+ {
+ return items.Lock.Read(d => d.ToArray());
+ }
///
/// Gets the value associated with the specified key, or a default value.
@@ -129,4 +130,4 @@ public static TValue GetValueOrDefaultAndRemove(this IDictionary>
item => item);
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core/Collections/ImmutableList.cs b/src/Uno.Core/Collections/ImmutableList.cs
index 623f5a2..17a62c1 100644
--- a/src/Uno.Core/Collections/ImmutableList.cs
+++ b/src/Uno.Core/Collections/ImmutableList.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections;
using System.Collections.Generic;
diff --git a/src/Uno.Core/Collections/LazyList.cs b/src/Uno.Core/Collections/LazyList.cs
index 377f753..abcaf66 100644
--- a/src/Uno.Core/Collections/LazyList.cs
+++ b/src/Uno.Core/Collections/LazyList.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
@@ -45,4 +46,4 @@ public override ICollection Target
set { base.Target = value; }
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core/Collections/ListAdapter.cs b/src/Uno.Core/Collections/ListAdapter.cs
index 9376815..7cdd635 100644
--- a/src/Uno.Core/Collections/ListAdapter.cs
+++ b/src/Uno.Core/Collections/ListAdapter.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
@@ -75,4 +76,4 @@ public U this[int index]
#endregion
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core/Collections/ListDecorator.cs b/src/Uno.Core/Collections/ListDecorator.cs
index 2899a73..dc8a6e5 100644
--- a/src/Uno.Core/Collections/ListDecorator.cs
+++ b/src/Uno.Core/Collections/ListDecorator.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System.Collections;
using System.Collections.Generic;
using Uno.Decorator;
@@ -61,4 +62,4 @@ public virtual T this[int index]
#endregion
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core/Collections/ListExtensions.cs b/src/Uno.Core/Collections/ListExtensions.cs
index 34892c6..9a11062 100644
--- a/src/Uno.Core/Collections/ListExtensions.cs
+++ b/src/Uno.Core/Collections/ListExtensions.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
@@ -324,4 +325,4 @@ public static bool SequenceKeyEqual(this IList first, IList second)
return true;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core/Collections/MemoryExtensions.cs b/src/Uno.Core/Collections/MemoryExtensions.cs
index 550a794..1fc95b3 100644
--- a/src/Uno.Core/Collections/MemoryExtensions.cs
+++ b/src/Uno.Core/Collections/MemoryExtensions.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/src/Uno.Core/Collections/ObservableCollectionExtensions.Update.cs b/src/Uno.Core/Collections/ObservableCollectionExtensions.Update.cs
index 72dc45c..aa64ec8 100644
--- a/src/Uno.Core/Collections/ObservableCollectionExtensions.Update.cs
+++ b/src/Uno.Core/Collections/ObservableCollectionExtensions.Update.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
diff --git a/src/Uno.Core/Collections/ObservableCollectionUpdateResults.cs b/src/Uno.Core/Collections/ObservableCollectionUpdateResults.cs
index 3406890..c730da1 100644
--- a/src/Uno.Core/Collections/ObservableCollectionUpdateResults.cs
+++ b/src/Uno.Core/Collections/ObservableCollectionUpdateResults.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System.Collections.Generic;
namespace Uno.Extensions
diff --git a/src/Uno.Core/Collections/QueueExtensions.cs b/src/Uno.Core/Collections/QueueExtensions.cs
index 5d527c7..a3353ad 100644
--- a/src/Uno.Core/Collections/QueueExtensions.cs
+++ b/src/Uno.Core/Collections/QueueExtensions.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
@@ -46,4 +47,4 @@ public static T DequeueOrDefault(this Queue queue)
: default(T);
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core/Collections/StackExtensions.cs b/src/Uno.Core/Collections/StackExtensions.cs
index 6cfc31c..c813673 100644
--- a/src/Uno.Core/Collections/StackExtensions.cs
+++ b/src/Uno.Core/Collections/StackExtensions.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
@@ -33,4 +34,4 @@ public static IDisposable Subscribe(this Stack stack, T value)
return Actions.Create(() => stack.Pop()).ToDisposable();
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core/Collections/SynchronizedDictionary.cs b/src/Uno.Core/Collections/SynchronizedDictionary.cs
index b1c2b34..0000053 100644
--- a/src/Uno.Core/Collections/SynchronizedDictionary.cs
+++ b/src/Uno.Core/Collections/SynchronizedDictionary.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System.Collections;
using System.Collections.Generic;
using System.Linq;
@@ -267,4 +268,4 @@ public bool TryRemove(TKey key, out TValue value)
}
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core/Collections/UnsafeWeakAttachedDictionary.cs b/src/Uno.Core/Collections/UnsafeWeakAttachedDictionary.cs
index 145377f..ead9651 100644
--- a/src/Uno.Core/Collections/UnsafeWeakAttachedDictionary.cs
+++ b/src/Uno.Core/Collections/UnsafeWeakAttachedDictionary.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/src/Uno.Core/Collections/WeakAttachedDictionary.cs b/src/Uno.Core/Collections/WeakAttachedDictionary.cs
index a57ad1b..3c48f28 100644
--- a/src/Uno.Core/Collections/WeakAttachedDictionary.cs
+++ b/src/Uno.Core/Collections/WeakAttachedDictionary.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/src/Uno.Core/Comparison/FastTypeComparer.cs b/src/Uno.Core/Comparison/FastTypeComparer.cs
index 96f1b0b..d7af5d9 100644
--- a/src/Uno.Core/Comparison/FastTypeComparer.cs
+++ b/src/Uno.Core/Comparison/FastTypeComparer.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/src/Uno.Core/Comparison/FuncComparer.cs b/src/Uno.Core/Comparison/FuncComparer.cs
index a648853..3dc26e2 100644
--- a/src/Uno.Core/Comparison/FuncComparer.cs
+++ b/src/Uno.Core/Comparison/FuncComparer.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
@@ -50,4 +51,4 @@ public int Compare(T x, T y)
return _compare(x, y);
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core/CompositionType.cs b/src/Uno.Core/CompositionType.cs
index 359110c..5d53212 100644
--- a/src/Uno.Core/CompositionType.cs
+++ b/src/Uno.Core/CompositionType.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,14 +14,15 @@
// limitations under the License.
//
// ******************************************************************
+
namespace Uno
{
- ///
- /// Represets the type of composition.
- ///
- public enum CompositionType
- {
- And,
- Or
- }
-}
\ No newline at end of file
+ ///
+ /// Represents the type of composition.
+ ///
+ public enum CompositionType
+ {
+ And,
+ Or
+ }
+}
diff --git a/src/Uno.Core/Conversion/ConversionExtensionPoint.cs b/src/Uno.Core/Conversion/ConversionExtensionPoint.cs
index b8dd70c..3ee4325 100644
--- a/src/Uno.Core/Conversion/ConversionExtensionPoint.cs
+++ b/src/Uno.Core/Conversion/ConversionExtensionPoint.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using Uno.Extensions;
namespace Uno.Conversion
@@ -25,4 +26,4 @@ public ConversionExtensionPoint(object value)
{
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core/Conversion/ConversionExtensions.cs b/src/Uno.Core/Conversion/ConversionExtensions.cs
index 833cea5..bf2e712 100644
--- a/src/Uno.Core/Conversion/ConversionExtensions.cs
+++ b/src/Uno.Core/Conversion/ConversionExtensions.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using Uno.Conversion;
using System.Globalization;
@@ -47,4 +48,4 @@ public static object To(this ConversionExtensionPoint extensionPoint, Type toTyp
return Extensions.To(extensionPoint, toType, culture);
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core/Conversion/CustomConversionStrategy.cs b/src/Uno.Core/Conversion/CustomConversionStrategy.cs
index 0361145..b328bc6 100644
--- a/src/Uno.Core/Conversion/CustomConversionStrategy.cs
+++ b/src/Uno.Core/Conversion/CustomConversionStrategy.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Globalization;
using Uno.Extensions;
@@ -40,4 +41,4 @@ public object Convert(object value, Type toType, CultureInfo culture = null)
return _conversion((TFrom)value, culture);
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core/Conversion/CustomCulturelessConversionStrategy.cs b/src/Uno.Core/Conversion/CustomCulturelessConversionStrategy.cs
index 832c0ce..5f717e1 100644
--- a/src/Uno.Core/Conversion/CustomCulturelessConversionStrategy.cs
+++ b/src/Uno.Core/Conversion/CustomCulturelessConversionStrategy.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Globalization;
using Uno.Extensions;
@@ -40,4 +41,4 @@ public object Convert(object value, Type toType, CultureInfo culture = null)
return _conversion((TFrom)value);
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core/Conversion/DefaultConversionExtensions.cs b/src/Uno.Core/Conversion/DefaultConversionExtensions.cs
index 0e6636a..dc3c9cd 100644
--- a/src/Uno.Core/Conversion/DefaultConversionExtensions.cs
+++ b/src/Uno.Core/Conversion/DefaultConversionExtensions.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
@@ -95,4 +96,4 @@ private IConversionStrategy GetConversionStrategy(object value, Type toType, Cul
.FirstOrDefault(item => item.CanConvert(value, toType, culture));
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core/Conversion/EnumConversionStrategy.cs b/src/Uno.Core/Conversion/EnumConversionStrategy.cs
index 52cca87..2c42758 100644
--- a/src/Uno.Core/Conversion/EnumConversionStrategy.cs
+++ b/src/Uno.Core/Conversion/EnumConversionStrategy.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.ComponentModel;
using System.Globalization;
@@ -156,4 +157,4 @@ private static string SourceFindValue(Type enumType, string text, CultureInfo cu
return unkownFieldInfo == null ? null : unkownFieldInfo.Name;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core/Conversion/IConversionExtensions.cs b/src/Uno.Core/Conversion/IConversionExtensions.cs
index 37474e7..cfcdb83 100644
--- a/src/Uno.Core/Conversion/IConversionExtensions.cs
+++ b/src/Uno.Core/Conversion/IConversionExtensions.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.ComponentModel;
using System.Globalization;
@@ -106,4 +107,4 @@ public static T To(this IConversionExtensions conversionExtensions, Conversio
//public static IConversionExtensions RegisterStrategy
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core/Conversion/IConversionStrategy.cs b/src/Uno.Core/Conversion/IConversionStrategy.cs
index 40b33ca..d9c678f 100644
--- a/src/Uno.Core/Conversion/IConversionStrategy.cs
+++ b/src/Uno.Core/Conversion/IConversionStrategy.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Globalization;
@@ -33,4 +34,4 @@ public interface IConversionStrategy
/// result
object Convert(object value, Type toType, CultureInfo culture = null);
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core/Conversion/PrimitiveConversionStrategy.cs b/src/Uno.Core/Conversion/PrimitiveConversionStrategy.cs
index 1bbb3a0..4a8738d 100644
--- a/src/Uno.Core/Conversion/PrimitiveConversionStrategy.cs
+++ b/src/Uno.Core/Conversion/PrimitiveConversionStrategy.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Globalization;
diff --git a/src/Uno.Core/Conversion/TypeConverterConversionStrategy.cs b/src/Uno.Core/Conversion/TypeConverterConversionStrategy.cs
index f79a96f..0d4df1a 100644
--- a/src/Uno.Core/Conversion/TypeConverterConversionStrategy.cs
+++ b/src/Uno.Core/Conversion/TypeConverterConversionStrategy.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.ComponentModel;
using System.Globalization;
diff --git a/src/Uno.Core/DataStatus.cs b/src/Uno.Core/DataStatus.cs
index 799ebba..f98456e 100644
--- a/src/Uno.Core/DataStatus.cs
+++ b/src/Uno.Core/DataStatus.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
@@ -22,23 +23,23 @@
namespace Uno
{
- [DataContract(Namespace = "Uno.Contract")]
- [Flags]
- public enum DataStatus
- {
- [EnumMember]
- NotInitialized = 0,
- [EnumMember]
- Unchanged = 1,
- [EnumMember]
- Created = 2,
- [EnumMember]
- Updated = 4,
- [EnumMember]
- Deleted = 8,
- [EnumMember]
- Added = 16,
- [EnumMember]
- Removed = 32
- }
+ [DataContract(Namespace = "Uno.Contract")]
+ [Flags]
+ public enum DataStatus
+ {
+ [EnumMember]
+ NotInitialized = 0,
+ [EnumMember]
+ Unchanged = 1,
+ [EnumMember]
+ Created = 2,
+ [EnumMember]
+ Updated = 4,
+ [EnumMember]
+ Deleted = 8,
+ [EnumMember]
+ Added = 16,
+ [EnumMember]
+ Removed = 32
+ }
}
diff --git a/src/Uno.Core/DateTimeUnit.cs b/src/Uno.Core/DateTimeUnit.cs
index 7f6951a..6a876fb 100644
--- a/src/Uno.Core/DateTimeUnit.cs
+++ b/src/Uno.Core/DateTimeUnit.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,25 +14,26 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
namespace Uno
{
- [Flags]
- public enum DateTimeUnit
- {
- Year = 1,
- Month = 2,
- Day = 4,
- Hour = 8,
- Minute = 16,
- Second = 32,
- Millisecond = 64,
- ToMonth = Year | Month,
- ToDay = ToMonth | Day,
- ToHour = ToDay | Hour,
- ToMinute = ToHour | Minute,
- ToSecond = ToMinute | Second,
- ToMillisecond = ToSecond | Millisecond
- }
-}
\ No newline at end of file
+ [Flags]
+ public enum DateTimeUnit
+ {
+ Year = 1,
+ Month = 2,
+ Day = 4,
+ Hour = 8,
+ Minute = 16,
+ Second = 32,
+ Millisecond = 64,
+ ToMonth = Year | Month,
+ ToDay = ToMonth | Day,
+ ToHour = ToDay | Hour,
+ ToMinute = ToHour | Minute,
+ ToSecond = ToMinute | Second,
+ ToMillisecond = ToSecond | Millisecond
+ }
+}
diff --git a/src/Uno.Core/Decorator/Decorator.cs b/src/Uno.Core/Decorator/Decorator.cs
index 6af6553..ead9f7f 100644
--- a/src/Uno.Core/Decorator/Decorator.cs
+++ b/src/Uno.Core/Decorator/Decorator.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,7 +14,6 @@
// limitations under the License.
//
// ******************************************************************
-using System;
namespace Uno.Decorator
{
@@ -52,4 +51,4 @@ public Decorator(T target)
#endregion
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core/Decorator/IDecorator.cs b/src/Uno.Core/Decorator/IDecorator.cs
index 99a2f5b..a168198 100644
--- a/src/Uno.Core/Decorator/IDecorator.cs
+++ b/src/Uno.Core/Decorator/IDecorator.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
namespace Uno.Decorator
{
///
@@ -27,4 +28,4 @@ public interface IDecorator
///
T Target { get; set; }
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core/DelegateConditionalWeakTable.cs b/src/Uno.Core/DelegateConditionalWeakTable.cs
index 4fd3952..50b75bd 100644
--- a/src/Uno.Core/DelegateConditionalWeakTable.cs
+++ b/src/Uno.Core/DelegateConditionalWeakTable.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
diff --git a/src/Uno.Core/DisposableAction.cs b/src/Uno.Core/DisposableAction.cs
index 848bf02..332d693 100644
--- a/src/Uno.Core/DisposableAction.cs
+++ b/src/Uno.Core/DisposableAction.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
@@ -21,22 +22,22 @@
namespace Uno
{
- public class DisposableAction : IDisposable
- {
- public DisposableAction(Action action)
- {
- Action = action;
- }
+ public class DisposableAction : IDisposable
+ {
+ public DisposableAction(Action action)
+ {
+ Action = action;
+ }
- public Action Action { get; private set; }
+ public Action Action { get; private set; }
- #region IDisposable Members
+ #region IDisposable Members
- public void Dispose()
- {
- Action();
- }
+ public void Dispose()
+ {
+ Action();
+ }
- #endregion
- }
+ #endregion
+ }
}
diff --git a/src/Uno.Core/DisposableConditionalWeakTable.cs b/src/Uno.Core/DisposableConditionalWeakTable.cs
index e01ced8..632cde4 100644
--- a/src/Uno.Core/DisposableConditionalWeakTable.cs
+++ b/src/Uno.Core/DisposableConditionalWeakTable.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
diff --git a/src/Uno.Core/Disposables/AnonymousDisposable.cs b/src/Uno.Core/Disposables/AnonymousDisposable.cs
index df47963..6e90da7 100644
--- a/src/Uno.Core/Disposables/AnonymousDisposable.cs
+++ b/src/Uno.Core/Disposables/AnonymousDisposable.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Threading;
@@ -56,4 +57,4 @@ public void Dispose()
}
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core/Disposables/CancellationDisposable.cs b/src/Uno.Core/Disposables/CancellationDisposable.cs
index 23a08ca..e3ea848 100644
--- a/src/Uno.Core/Disposables/CancellationDisposable.cs
+++ b/src/Uno.Core/Disposables/CancellationDisposable.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Threading;
@@ -71,4 +72,4 @@ public bool IsDisposed
get { return _cts.IsCancellationRequested; }
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core/Disposables/CompositeDisposable.cs b/src/Uno.Core/Disposables/CompositeDisposable.cs
index 93aa102..4fd2586 100644
--- a/src/Uno.Core/Disposables/CompositeDisposable.cs
+++ b/src/Uno.Core/Disposables/CompositeDisposable.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
@@ -288,4 +289,4 @@ public bool IsDisposed
get { return _disposed; }
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core/Disposables/CompositeDisposableExtensions.cs b/src/Uno.Core/Disposables/CompositeDisposableExtensions.cs
index 3c39f8a..debe133 100644
--- a/src/Uno.Core/Disposables/CompositeDisposableExtensions.cs
+++ b/src/Uno.Core/Disposables/CompositeDisposableExtensions.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/src/Uno.Core/Disposables/ConditionalDisposable.cs b/src/Uno.Core/Disposables/ConditionalDisposable.cs
index e61b597..6bb0a3a 100644
--- a/src/Uno.Core/Disposables/ConditionalDisposable.cs
+++ b/src/Uno.Core/Disposables/ConditionalDisposable.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
diff --git a/src/Uno.Core/Disposables/DefaultDisposable.cs b/src/Uno.Core/Disposables/DefaultDisposable.cs
index 7ef3ecd..2e1c480 100644
--- a/src/Uno.Core/Disposables/DefaultDisposable.cs
+++ b/src/Uno.Core/Disposables/DefaultDisposable.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
namespace Uno.Disposables
diff --git a/src/Uno.Core/Disposables/Disposable.cs b/src/Uno.Core/Disposables/Disposable.cs
index 05ccb37..00545bf 100644
--- a/src/Uno.Core/Disposables/Disposable.cs
+++ b/src/Uno.Core/Disposables/Disposable.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
namespace Uno.Disposables
diff --git a/src/Uno.Core/Disposables/DisposableExtensions.cs b/src/Uno.Core/Disposables/DisposableExtensions.cs
index 557ad48..2e245f0 100644
--- a/src/Uno.Core/Disposables/DisposableExtensions.cs
+++ b/src/Uno.Core/Disposables/DisposableExtensions.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/src/Uno.Core/Disposables/ICancelable.cs b/src/Uno.Core/Disposables/ICancelable.cs
index 13f75ca..4ef93b8 100644
--- a/src/Uno.Core/Disposables/ICancelable.cs
+++ b/src/Uno.Core/Disposables/ICancelable.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
namespace Uno.Disposables
diff --git a/src/Uno.Core/Disposables/IExtensibleDisposable.cs b/src/Uno.Core/Disposables/IExtensibleDisposable.cs
index f073458..8d19c9f 100644
--- a/src/Uno.Core/Disposables/IExtensibleDisposable.cs
+++ b/src/Uno.Core/Disposables/IExtensibleDisposable.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/src/Uno.Core/Disposables/SerialDisposable.cs b/src/Uno.Core/Disposables/SerialDisposable.cs
index 2097be1..ddd2204 100644
--- a/src/Uno.Core/Disposables/SerialDisposable.cs
+++ b/src/Uno.Core/Disposables/SerialDisposable.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
namespace Uno.Disposables
@@ -100,4 +101,4 @@ public void Dispose()
old.Dispose();
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core/EnumUtilities.cs b/src/Uno.Core/EnumUtilities.cs
index 41beb91..b04df3a 100644
--- a/src/Uno.Core/EnumUtilities.cs
+++ b/src/Uno.Core/EnumUtilities.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Globalization;
@@ -103,7 +104,7 @@ public static bool TryParse(Type enumType, string value, bool ignoreCase, out ob
}
result = null;
- return false;
+ return false;
}
public static System.Tuple[] GetValues(Type enumType, bool ignoreCase)
@@ -117,7 +118,7 @@ public static System.Tuple[] GetValues(Type enumType, bo
var enumParsedValue = Enum.Parse(enumType, info.Name, ignoreCase);
var enumUnderlyingValue = Convert.ChangeType(enumValue, Enum.GetUnderlyingType(enumValue.GetType()), CultureInfo.InvariantCulture);
return System.Tuple.Create(info.Name, enumParsedValue, enumUnderlyingValue);
- })
+ })
.ToArray();
}
diff --git a/src/Uno.Core/Equality/CollectionEqualityComparer.cs b/src/Uno.Core/Equality/CollectionEqualityComparer.cs
index 772a93e..575e65c 100644
--- a/src/Uno.Core/Equality/CollectionEqualityComparer.cs
+++ b/src/Uno.Core/Equality/CollectionEqualityComparer.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
diff --git a/src/Uno.Core/Equality/EqualityComparerExtensions.cs b/src/Uno.Core/Equality/EqualityComparerExtensions.cs
index 72bfe0e..1eb3019 100644
--- a/src/Uno.Core/Equality/EqualityComparerExtensions.cs
+++ b/src/Uno.Core/Equality/EqualityComparerExtensions.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections;
using System.Collections.Generic;
diff --git a/src/Uno.Core/Equality/EqualityExtensionPoint.cs b/src/Uno.Core/Equality/EqualityExtensionPoint.cs
index 3aa7c0e..76a554e 100644
--- a/src/Uno.Core/Equality/EqualityExtensionPoint.cs
+++ b/src/Uno.Core/Equality/EqualityExtensionPoint.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using Uno.Extensions;
namespace Uno.Equality
@@ -42,4 +43,4 @@ public override bool Equals(object obj)
}
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core/Equality/EqualityExtensions.cs b/src/Uno.Core/Equality/EqualityExtensions.cs
index 402e973..63ab833 100644
--- a/src/Uno.Core/Equality/EqualityExtensions.cs
+++ b/src/Uno.Core/Equality/EqualityExtensions.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections;
using System.Collections.Generic;
diff --git a/src/Uno.Core/Equality/FuncEqualityComparer.cs b/src/Uno.Core/Equality/FuncEqualityComparer.cs
index f018538..519f675 100644
--- a/src/Uno.Core/Equality/FuncEqualityComparer.cs
+++ b/src/Uno.Core/Equality/FuncEqualityComparer.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.ComponentModel;
@@ -182,4 +183,4 @@ public int GetHashCode(T obj)
return _valueEqualityComparer.GetHashCode(value);
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core/Equality/IKeyEquatable.cs b/src/Uno.Core/Equality/IKeyEquatable.cs
index 5c2ffbe..5ccea51 100644
--- a/src/Uno.Core/Equality/IKeyEquatable.cs
+++ b/src/Uno.Core/Equality/IKeyEquatable.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Text;
diff --git a/src/Uno.Core/Equality/KeyEqualityComparer.cs b/src/Uno.Core/Equality/KeyEqualityComparer.cs
index 1a6efa1..7e5761f 100644
--- a/src/Uno.Core/Equality/KeyEqualityComparer.cs
+++ b/src/Uno.Core/Equality/KeyEqualityComparer.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections;
using System.Collections.Generic;
diff --git a/src/Uno.Core/Equality/WeakReferenceEqualityComparer.cs b/src/Uno.Core/Equality/WeakReferenceEqualityComparer.cs
index 8dbd6be..5623364 100644
--- a/src/Uno.Core/Equality/WeakReferenceEqualityComparer.cs
+++ b/src/Uno.Core/Equality/WeakReferenceEqualityComparer.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System.Linq;
using System;
using System.Collections.Generic;
@@ -56,4 +57,4 @@ public int GetHashCode(System.WeakReference w)
: -1;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Uno.Core/Events/EventHandlerConverter.cs b/src/Uno.Core/Events/EventHandlerConverter.cs
index cacebdf..9911d29 100644
--- a/src/Uno.Core/Events/EventHandlerConverter.cs
+++ b/src/Uno.Core/Events/EventHandlerConverter.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
diff --git a/src/Uno.Core/Expressions/Builder/IPredicateBuilder.cs b/src/Uno.Core/Expressions/Builder/IPredicateBuilder.cs
index 56090b9..da5b0dd 100644
--- a/src/Uno.Core/Expressions/Builder/IPredicateBuilder.cs
+++ b/src/Uno.Core/Expressions/Builder/IPredicateBuilder.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,14 +14,15 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Linq.Expressions;
namespace Uno.Expressions.Builder
{
- //TODO
- public interface IPredicateBuilder
- {
- Expression> ToExpression();
- }
-}
\ No newline at end of file
+ //TODO
+ public interface IPredicateBuilder
+ {
+ Expression> ToExpression();
+ }
+}
diff --git a/src/Uno.Core/Expressions/EditableBinaryExpression.cs b/src/Uno.Core/Expressions/EditableBinaryExpression.cs
index fcfe1b7..cdd1859 100644
--- a/src/Uno.Core/Expressions/EditableBinaryExpression.cs
+++ b/src/Uno.Core/Expressions/EditableBinaryExpression.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,37 +14,38 @@
// limitations under the License.
//
// ******************************************************************
+
using System.Collections.Generic;
using System.Linq.Expressions;
using Uno.Extensions;
namespace Uno.Expressions
{
- public class EditableBinaryExpression : EditableExpression
- {
- public EditableBinaryExpression(BinaryExpression expression)
- : base(expression)
- {
- Left = expression.Left.Edit();
- Right = expression.Right.Edit();
- }
+ public class EditableBinaryExpression : EditableExpression
+ {
+ public EditableBinaryExpression(BinaryExpression expression)
+ : base(expression)
+ {
+ Left = expression.Left.Edit();
+ Right = expression.Right.Edit();
+ }
- public IEditableExpression Left { get; set; }
+ public IEditableExpression Left { get; set; }
- public IEditableExpression Right { get; set; }
+ public IEditableExpression Right { get; set; }
- public override IEnumerable Nodes
- {
- get
- {
- yield return Left;
- yield return Right;
- }
- }
+ public override IEnumerable Nodes
+ {
+ get
+ {
+ yield return Left;
+ yield return Right;
+ }
+ }
- public override BinaryExpression DoToExpression()
- {
- return Expression.MakeBinary(NodeType, Left.ToExpression(), Right.ToExpression());
- }
- }
-}
\ No newline at end of file
+ public override BinaryExpression DoToExpression()
+ {
+ return Expression.MakeBinary(NodeType, Left.ToExpression(), Right.ToExpression());
+ }
+ }
+}
diff --git a/src/Uno.Core/Expressions/EditableConditionalExpression.cs b/src/Uno.Core/Expressions/EditableConditionalExpression.cs
index f3b2b63..382d9a6 100644
--- a/src/Uno.Core/Expressions/EditableConditionalExpression.cs
+++ b/src/Uno.Core/Expressions/EditableConditionalExpression.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,41 +14,42 @@
// limitations under the License.
//
// ******************************************************************
+
using System.Collections.Generic;
using System.Linq.Expressions;
using Uno.Extensions;
namespace Uno.Expressions
{
- public class EditableConditionalExpression : EditableExpression
- {
- public EditableConditionalExpression(ConditionalExpression expression)
- : base(expression)
- {
- Test = expression.Test.Edit();
- IfTrue = expression.IfTrue.Edit();
- IfFalse = expression.IfFalse.Edit();
- }
+ public class EditableConditionalExpression : EditableExpression
+ {
+ public EditableConditionalExpression(ConditionalExpression expression)
+ : base(expression)
+ {
+ Test = expression.Test.Edit();
+ IfTrue = expression.IfTrue.Edit();
+ IfFalse = expression.IfFalse.Edit();
+ }
- public IEditableExpression Test { get; set; }
+ public IEditableExpression Test { get; set; }
- public IEditableExpression IfTrue { get; set; }
+ public IEditableExpression IfTrue { get; set; }
- public IEditableExpression IfFalse { get; set; }
+ public IEditableExpression IfFalse { get; set; }
- public override IEnumerable Nodes
- {
- get
- {
- yield return Test;
- yield return IfTrue;
- yield return IfFalse;
- }
- }
+ public override IEnumerable Nodes
+ {
+ get
+ {
+ yield return Test;
+ yield return IfTrue;
+ yield return IfFalse;
+ }
+ }
- public override ConditionalExpression DoToExpression()
- {
- return Expression.Condition(Test.ToExpression(), IfTrue.ToExpression(), IfFalse.ToExpression());
- }
- }
-}
\ No newline at end of file
+ public override ConditionalExpression DoToExpression()
+ {
+ return Expression.Condition(Test.ToExpression(), IfTrue.ToExpression(), IfFalse.ToExpression());
+ }
+ }
+}
diff --git a/src/Uno.Core/Expressions/EditableConstantExpression.cs b/src/Uno.Core/Expressions/EditableConstantExpression.cs
index f8c8eb1..7f6649d 100644
--- a/src/Uno.Core/Expressions/EditableConstantExpression.cs
+++ b/src/Uno.Core/Expressions/EditableConstantExpression.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,23 +14,24 @@
// limitations under the License.
//
// ******************************************************************
+
using System.Linq.Expressions;
namespace Uno.Expressions
{
- public class EditableConstantExpression : EditableExpression
- {
- public EditableConstantExpression(ConstantExpression expression)
- : base(expression, false)
- {
- Value = expression.Value;
- }
+ public class EditableConstantExpression : EditableExpression
+ {
+ public EditableConstantExpression(ConstantExpression expression)
+ : base(expression, false)
+ {
+ Value = expression.Value;
+ }
- public object Value { get; set; }
+ public object Value { get; set; }
- public override ConstantExpression DoToExpression()
- {
- return Expression.Constant(Value);
- }
- }
-}
\ No newline at end of file
+ public override ConstantExpression DoToExpression()
+ {
+ return Expression.Constant(Value);
+ }
+ }
+}
diff --git a/src/Uno.Core/Expressions/EditableElementInit.cs b/src/Uno.Core/Expressions/EditableElementInit.cs
index 31681df..8a45921 100644
--- a/src/Uno.Core/Expressions/EditableElementInit.cs
+++ b/src/Uno.Core/Expressions/EditableElementInit.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,31 +14,32 @@
// limitations under the License.
//
// ******************************************************************
+
using System.Linq.Expressions;
using System.Reflection;
namespace Uno.Expressions
{
- public class EditableElementInit
- {
- private readonly EditableExpressionCollection arguments;
+ public class EditableElementInit
+ {
+ private readonly EditableExpressionCollection arguments;
- public EditableElementInit(ElementInit elementInit)
- {
- AddMethod = elementInit.AddMethod;
- arguments = new EditableExpressionCollection(elementInit.Arguments);
- }
+ public EditableElementInit(ElementInit elementInit)
+ {
+ AddMethod = elementInit.AddMethod;
+ arguments = new EditableExpressionCollection(elementInit.Arguments);
+ }
- public MethodInfo AddMethod { get; set; }
+ public MethodInfo AddMethod { get; set; }
- public EditableExpressionCollection Arguments
- {
- get { return arguments; }
- }
+ public EditableExpressionCollection Arguments
+ {
+ get { return arguments; }
+ }
- public ElementInit ToElementInit()
- {
- return Expression.ElementInit(AddMethod, Arguments.ToExpression());
- }
- }
-}
\ No newline at end of file
+ public ElementInit ToElementInit()
+ {
+ return Expression.ElementInit(AddMethod, Arguments.ToExpression());
+ }
+ }
+}
diff --git a/src/Uno.Core/Expressions/EditableExpression.cs b/src/Uno.Core/Expressions/EditableExpression.cs
index 9b81bd9..17bfb11 100644
--- a/src/Uno.Core/Expressions/EditableExpression.cs
+++ b/src/Uno.Core/Expressions/EditableExpression.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,107 +14,108 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
namespace Uno.Expressions
{
- public abstract class EditableExpression : IEditableExpression
- where T : Expression
- {
- private readonly bool nodeTypeEditable;
- private readonly T originalExpression;
- private Expression expressionOverride;
- private ExpressionType nodeType;
-
- // TODO: convert to protected
- public EditableExpression(T expression)
- : this(expression, true)
- {
- }
-
- // TODO: convert to protected
- public EditableExpression(T expression, bool nodeTypeEditable)
- {
- //TODO Validate expression != null
- originalExpression = expression;
- nodeType = expression.NodeType;
- this.nodeTypeEditable = nodeTypeEditable;
- }
-
- #region IEditableExpression Members
-
- public Expression OriginalExpression
- {
- get { return originalExpression; }
- }
-
- public virtual ExpressionType NodeType
- {
- get { return nodeType; }
- set
- {
- if (!nodeTypeEditable)
- {
- throw new InvalidOperationException("Cannot change NodeType!");
- }
- nodeType = value;
- }
- }
-
- public Type ExpressionType
- {
- get { return typeof (T); }
- }
-
- Expression IEditableExpression.ToExpression()
- {
- return ToExpression();
- }
-
- public virtual IEnumerable Nodes
- {
- get { return new IEditableExpression[0]; }
- }
-
- public virtual void Use(Expression expression)
- {
- if (ShouldUse(expression))
- {
- expressionOverride = expression;
- }
- }
-
- #endregion
-
- public virtual T ToExpression()
- {
- if (expressionOverride == null)
- {
- return DoToExpression();
- }
- return expressionOverride as T;
- }
-
- public abstract T DoToExpression();
-
- protected virtual bool ShouldUse(Expression expression)
- {
- if (expression.NodeType == NodeType &&
- expression is T)
- {
- var castedExpression = expression as T;
-
- return ShouldUse(castedExpression);
- }
-
- return false;
- }
-
- protected virtual bool ShouldUse(T expression)
- {
- return true;
- }
- }
-}
\ No newline at end of file
+ public abstract class EditableExpression : IEditableExpression
+ where T : Expression
+ {
+ private readonly bool nodeTypeEditable;
+ private readonly T originalExpression;
+ private Expression expressionOverride;
+ private ExpressionType nodeType;
+
+ // TODO: convert to protected
+ public EditableExpression(T expression)
+ : this(expression, true)
+ {
+ }
+
+ // TODO: convert to protected
+ public EditableExpression(T expression, bool nodeTypeEditable)
+ {
+ //TODO Validate expression != null
+ originalExpression = expression;
+ nodeType = expression.NodeType;
+ this.nodeTypeEditable = nodeTypeEditable;
+ }
+
+ #region IEditableExpression Members
+
+ public Expression OriginalExpression
+ {
+ get { return originalExpression; }
+ }
+
+ public virtual ExpressionType NodeType
+ {
+ get { return nodeType; }
+ set
+ {
+ if (!nodeTypeEditable)
+ {
+ throw new InvalidOperationException("Cannot change NodeType!");
+ }
+ nodeType = value;
+ }
+ }
+
+ public Type ExpressionType
+ {
+ get { return typeof (T); }
+ }
+
+ Expression IEditableExpression.ToExpression()
+ {
+ return ToExpression();
+ }
+
+ public virtual IEnumerable Nodes
+ {
+ get { return new IEditableExpression[0]; }
+ }
+
+ public virtual void Use(Expression expression)
+ {
+ if (ShouldUse(expression))
+ {
+ expressionOverride = expression;
+ }
+ }
+
+ #endregion
+
+ public virtual T ToExpression()
+ {
+ if (expressionOverride == null)
+ {
+ return DoToExpression();
+ }
+ return expressionOverride as T;
+ }
+
+ public abstract T DoToExpression();
+
+ protected virtual bool ShouldUse(Expression expression)
+ {
+ if (expression.NodeType == NodeType &&
+ expression is T)
+ {
+ var castedExpression = expression as T;
+
+ return ShouldUse(castedExpression);
+ }
+
+ return false;
+ }
+
+ protected virtual bool ShouldUse(T expression)
+ {
+ return true;
+ }
+ }
+}
diff --git a/src/Uno.Core/Expressions/EditableExpressionCollection.cs b/src/Uno.Core/Expressions/EditableExpressionCollection.cs
index 7eefff0..05f9957 100644
--- a/src/Uno.Core/Expressions/EditableExpressionCollection.cs
+++ b/src/Uno.Core/Expressions/EditableExpressionCollection.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
@@ -21,30 +22,30 @@
namespace Uno.Expressions
{
- public class EditableExpressionCollection
- where T : Expression
- {
- private readonly IList> items;
+ public class EditableExpressionCollection
+ where T : Expression
+ {
+ private readonly IList> items;
- public EditableExpressionCollection(IEnumerable items)
- {
- this.items = new List>(items.Edit().Cast>());
- }
+ public EditableExpressionCollection(IEnumerable items)
+ {
+ this.items = new List>(items.Edit().Cast>());
+ }
- // TODO parameter can be type IEnumerable
- public EditableExpressionCollection(IEnumerable items)
- : this(items.Cast())
- {
- }
+ // TODO parameter can be type IEnumerable
+ public EditableExpressionCollection(IEnumerable items)
+ : this(items.Cast())
+ {
+ }
- public IList> Items
- {
- get { return items; }
- }
+ public IList> Items
+ {
+ get { return items; }
+ }
- public virtual T[] ToExpression()
- {
- return items.Select(item => item.DoToExpression()).ToArray();
- }
- }
-}
\ No newline at end of file
+ public virtual T[] ToExpression()
+ {
+ return items.Select(item => item.DoToExpression()).ToArray();
+ }
+ }
+}
diff --git a/src/Uno.Core/Expressions/EditableExpressionExtensions.cs b/src/Uno.Core/Expressions/EditableExpressionExtensions.cs
index 73e2ca9..6592106 100644
--- a/src/Uno.Core/Expressions/EditableExpressionExtensions.cs
+++ b/src/Uno.Core/Expressions/EditableExpressionExtensions.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
@@ -21,125 +22,125 @@
namespace Uno.Extensions
{
- public static class EditableExpressionExtensions
- {
- public static EditableLambdaExpression Edit(this Expression expression)
- {
- return new EditableLambdaExpression(expression);
- }
-
- public static EditableConstantExpression Edit(this ConstantExpression expression)
- {
- return new EditableConstantExpression(expression);
- }
-
- public static EditableBinaryExpression Edit(this BinaryExpression expression)
- {
- return new EditableBinaryExpression(expression);
- }
-
- public static EditableConditionalExpression Edit(this ConditionalExpression expression)
- {
- return new EditableConditionalExpression(expression);
- }
-
- public static EditableInvocationExpression Edit(this InvocationExpression expression)
- {
- return new EditableInvocationExpression(expression);
- }
-
- public static EditableLambdaExpression Edit(this LambdaExpression expression)
- {
- return new EditableLambdaExpression(expression);
- }
-
- public static EditableParameterExpression Edit(this ParameterExpression expression)
- {
- return new EditableParameterExpression(expression);
- }
-
- public static EditableListInitExpression Edit(this ListInitExpression expression)
- {
- return new EditableListInitExpression(expression);
- }
-
- public static EditableMemberExpression Edit(this MemberExpression expression)
- {
- return new EditableMemberExpression(expression);
- }
-
- public static EditableMemberInitExpression Edit(this MemberInitExpression expression)
- {
- return new EditableMemberInitExpression(expression);
- }
-
- public static EditableMethodCallExpression Edit(this MethodCallExpression expression)
- {
- return new EditableMethodCallExpression(expression);
- }
-
- public static EditableNewArrayExpression Edit(this NewArrayExpression expression)
- {
- return new EditableNewArrayExpression(expression);
- }
-
- public static EditableNewExpression Edit(this NewExpression expression)
- {
- return new EditableNewExpression(expression);
- }
-
- public static EditableTypeBinaryExpression Edit(this TypeBinaryExpression expression)
- {
- return new EditableTypeBinaryExpression(expression);
- }
-
- public static EditableUnaryExpression Edit(this UnaryExpression expression)
- {
- return new EditableUnaryExpression(expression);
- }
-
- public static IEditableExpression Edit(this Expression expression)
- {
- if (expression is ConstantExpression) return Edit(expression as ConstantExpression);
- if (expression is BinaryExpression) return Edit(expression as BinaryExpression);
- if (expression is ConditionalExpression) return Edit(expression as ConditionalExpression);
- if (expression is InvocationExpression) return Edit(expression as InvocationExpression);
- if (expression is LambdaExpression) return Edit(expression as LambdaExpression);
- if (expression is ParameterExpression) return Edit(expression as ParameterExpression);
- if (expression is ListInitExpression) return Edit(expression as ListInitExpression);
- if (expression is MemberExpression) return Edit(expression as MemberExpression);
- if (expression is MemberInitExpression) return Edit(expression as MemberInitExpression);
- if (expression is MethodCallExpression) return Edit(expression as MethodCallExpression);
- if (expression is NewArrayExpression) return Edit(expression as NewArrayExpression);
- if (expression is NewExpression) return Edit(expression as NewExpression);
- if (expression is TypeBinaryExpression) return Edit(expression as TypeBinaryExpression);
- if (expression is UnaryExpression) return Edit(expression as UnaryExpression);
- return null;
- }
-
- public static IEnumerable Edit(this IEnumerable expressions)
- {
- return expressions.Select(Edit);
- }
-
- public static IEnumerable AllNodes(this IEditableExpression expression)
- {
- foreach (IEditableExpression node in expression.Nodes.SelectMany(item => item.AllNodes()))
- {
- yield return node;
- }
-
- yield return expression;
- }
-
- public static void Use(this IEditableExpression editableExpression, Expression expression)
- {
- editableExpression.AllNodes().ForEach(item => item.Use(expression));
- }
-
- public static void Use(this IEditableExpression editableExpression, IEnumerable expressions)
- {
- expressions.ForEach(item => Use(editableExpression, item));
- }
- }
-}
\ No newline at end of file
+ public static class EditableExpressionExtensions
+ {
+ public static EditableLambdaExpression Edit(this Expression expression)
+ {
+ return new EditableLambdaExpression(expression);
+ }
+
+ public static EditableConstantExpression Edit(this ConstantExpression expression)
+ {
+ return new EditableConstantExpression(expression);
+ }
+
+ public static EditableBinaryExpression Edit(this BinaryExpression expression)
+ {
+ return new EditableBinaryExpression(expression);
+ }
+
+ public static EditableConditionalExpression Edit(this ConditionalExpression expression)
+ {
+ return new EditableConditionalExpression(expression);
+ }
+
+ public static EditableInvocationExpression Edit(this InvocationExpression expression)
+ {
+ return new EditableInvocationExpression(expression);
+ }
+
+ public static EditableLambdaExpression Edit(this LambdaExpression expression)
+ {
+ return new EditableLambdaExpression(expression);
+ }
+
+ public static EditableParameterExpression Edit(this ParameterExpression expression)
+ {
+ return new EditableParameterExpression(expression);
+ }
+
+ public static EditableListInitExpression Edit(this ListInitExpression expression)
+ {
+ return new EditableListInitExpression(expression);
+ }
+
+ public static EditableMemberExpression Edit(this MemberExpression expression)
+ {
+ return new EditableMemberExpression(expression);
+ }
+
+ public static EditableMemberInitExpression Edit(this MemberInitExpression expression)
+ {
+ return new EditableMemberInitExpression(expression);
+ }
+
+ public static EditableMethodCallExpression Edit(this MethodCallExpression expression)
+ {
+ return new EditableMethodCallExpression(expression);
+ }
+
+ public static EditableNewArrayExpression Edit(this NewArrayExpression expression)
+ {
+ return new EditableNewArrayExpression(expression);
+ }
+
+ public static EditableNewExpression Edit(this NewExpression expression)
+ {
+ return new EditableNewExpression(expression);
+ }
+
+ public static EditableTypeBinaryExpression Edit(this TypeBinaryExpression expression)
+ {
+ return new EditableTypeBinaryExpression(expression);
+ }
+
+ public static EditableUnaryExpression Edit(this UnaryExpression expression)
+ {
+ return new EditableUnaryExpression(expression);
+ }
+
+ public static IEditableExpression Edit(this Expression expression)
+ {
+ if (expression is ConstantExpression) return Edit(expression as ConstantExpression);
+ if (expression is BinaryExpression) return Edit(expression as BinaryExpression);
+ if (expression is ConditionalExpression) return Edit(expression as ConditionalExpression);
+ if (expression is InvocationExpression) return Edit(expression as InvocationExpression);
+ if (expression is LambdaExpression) return Edit(expression as LambdaExpression);
+ if (expression is ParameterExpression) return Edit(expression as ParameterExpression);
+ if (expression is ListInitExpression) return Edit(expression as ListInitExpression);
+ if (expression is MemberExpression) return Edit(expression as MemberExpression);
+ if (expression is MemberInitExpression) return Edit(expression as MemberInitExpression);
+ if (expression is MethodCallExpression) return Edit(expression as MethodCallExpression);
+ if (expression is NewArrayExpression) return Edit(expression as NewArrayExpression);
+ if (expression is NewExpression) return Edit(expression as NewExpression);
+ if (expression is TypeBinaryExpression) return Edit(expression as TypeBinaryExpression);
+ if (expression is UnaryExpression) return Edit(expression as UnaryExpression);
+ return null;
+ }
+
+ public static IEnumerable Edit(this IEnumerable expressions)
+ {
+ return expressions.Select(Edit);
+ }
+
+ public static IEnumerable AllNodes(this IEditableExpression expression)
+ {
+ foreach (IEditableExpression node in expression.Nodes.SelectMany(item => item.AllNodes()))
+ {
+ yield return node;
+ }
+
+ yield return expression;
+ }
+
+ public static void Use(this IEditableExpression editableExpression, Expression expression)
+ {
+ editableExpression.AllNodes().ForEach(item => item.Use(expression));
+ }
+
+ public static void Use(this IEditableExpression editableExpression, IEnumerable expressions)
+ {
+ expressions.ForEach(item => Use(editableExpression, item));
+ }
+ }
+}
diff --git a/src/Uno.Core/Expressions/EditableInvocationExpression.cs b/src/Uno.Core/Expressions/EditableInvocationExpression.cs
index 08544f1..22bf965 100644
--- a/src/Uno.Core/Expressions/EditableInvocationExpression.cs
+++ b/src/Uno.Core/Expressions/EditableInvocationExpression.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
@@ -21,32 +22,32 @@
namespace Uno.Expressions
{
- public class EditableInvocationExpression : EditableExpression
- {
- private readonly EditableExpressionCollection arguments;
+ public class EditableInvocationExpression : EditableExpression
+ {
+ private readonly EditableExpressionCollection arguments;
- public EditableInvocationExpression(InvocationExpression expression)
- : base(expression, false)
- {
- Expression = expression.Expression.Edit();
- arguments = new EditableExpressionCollection(expression.Arguments);
- }
+ public EditableInvocationExpression(InvocationExpression expression)
+ : base(expression, false)
+ {
+ Expression = expression.Expression.Edit();
+ arguments = new EditableExpressionCollection(expression.Arguments);
+ }
- public EditableExpressionCollection Arguments
- {
- get { return arguments; }
- }
+ public EditableExpressionCollection Arguments
+ {
+ get { return arguments; }
+ }
- public IEditableExpression Expression { get; set; }
+ public IEditableExpression Expression { get; set; }
- public override IEnumerable Nodes
- {
- get { return Arguments.Items.Cast(); }
- }
+ public override IEnumerable Nodes
+ {
+ get { return Arguments.Items.Cast(); }
+ }
- public override InvocationExpression DoToExpression()
- {
- return System.Linq.Expressions.Expression.Invoke(Expression.ToExpression(), Arguments.ToExpression());
- }
- }
-}
\ No newline at end of file
+ public override InvocationExpression DoToExpression()
+ {
+ return System.Linq.Expressions.Expression.Invoke(Expression.ToExpression(), Arguments.ToExpression());
+ }
+ }
+}
diff --git a/src/Uno.Core/Expressions/EditableLambdaExpression.Generic.cs b/src/Uno.Core/Expressions/EditableLambdaExpression.Generic.cs
index 81513af..dad03cb 100644
--- a/src/Uno.Core/Expressions/EditableLambdaExpression.Generic.cs
+++ b/src/Uno.Core/Expressions/EditableLambdaExpression.Generic.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,45 +14,46 @@
// limitations under the License.
//
// ******************************************************************
+
using System.Collections.Generic;
using System.Linq.Expressions;
using Uno.Extensions;
namespace Uno.Expressions
{
- public class EditableLambdaExpression : EditableExpression>
- {
- private readonly EditableParameterExpressionCollection parameters;
+ public class EditableLambdaExpression : EditableExpression>
+ {
+ private readonly EditableParameterExpressionCollection parameters;
- public EditableLambdaExpression(Expression expression)
- : base(expression, false)
- {
- Body = expression.Body.Edit();
- parameters = new EditableParameterExpressionCollection(Body, expression.Parameters);
- }
+ public EditableLambdaExpression(Expression expression)
+ : base(expression, false)
+ {
+ Body = expression.Body.Edit();
+ parameters = new EditableParameterExpressionCollection(Body, expression.Parameters);
+ }
- public IEditableExpression Body { get; set; }
+ public IEditableExpression Body { get; set; }
- public EditableParameterExpressionCollection Parameters
- {
- get { return parameters; }
- }
+ public EditableParameterExpressionCollection Parameters
+ {
+ get { return parameters; }
+ }
- public override IEnumerable Nodes
- {
- get
- {
- yield return Body;
- foreach (var item in Parameters.Items)
- {
- yield return item;
- }
- }
- }
+ public override IEnumerable Nodes
+ {
+ get
+ {
+ yield return Body;
+ foreach (var item in Parameters.Items)
+ {
+ yield return item;
+ }
+ }
+ }
- public override Expression DoToExpression()
- {
- return Expression.Lambda(Body.ToExpression(), Parameters.ToExpression());
- }
- }
-}
\ No newline at end of file
+ public override Expression DoToExpression()
+ {
+ return Expression.Lambda(Body.ToExpression(), Parameters.ToExpression());
+ }
+ }
+}
diff --git a/src/Uno.Core/Expressions/EditableLambdaExpression.cs b/src/Uno.Core/Expressions/EditableLambdaExpression.cs
index c243e15..6e7648f 100644
--- a/src/Uno.Core/Expressions/EditableLambdaExpression.cs
+++ b/src/Uno.Core/Expressions/EditableLambdaExpression.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,45 +14,46 @@
// limitations under the License.
//
// ******************************************************************
+
using System.Collections.Generic;
using System.Linq.Expressions;
using Uno.Extensions;
namespace Uno.Expressions
{
- public class EditableLambdaExpression : EditableExpression
- {
- private readonly EditableParameterExpressionCollection parameters;
+ public class EditableLambdaExpression : EditableExpression
+ {
+ private readonly EditableParameterExpressionCollection parameters;
- public EditableLambdaExpression(LambdaExpression expression)
- : base(expression, false)
- {
- Body = expression.Body.Edit();
- parameters = new EditableParameterExpressionCollection(Body, expression.Parameters);
- }
+ public EditableLambdaExpression(LambdaExpression expression)
+ : base(expression, false)
+ {
+ Body = expression.Body.Edit();
+ parameters = new EditableParameterExpressionCollection(Body, expression.Parameters);
+ }
- public IEditableExpression Body { get; set; }
+ public IEditableExpression Body { get; set; }
- public EditableParameterExpressionCollection Parameters
- {
- get { return parameters; }
- }
+ public EditableParameterExpressionCollection Parameters
+ {
+ get { return parameters; }
+ }
- public override IEnumerable Nodes
- {
- get
- {
- yield return Body;
- foreach (var item in Parameters.Items)
- {
- yield return item;
- }
- }
- }
+ public override IEnumerable Nodes
+ {
+ get
+ {
+ yield return Body;
+ foreach (var item in Parameters.Items)
+ {
+ yield return item;
+ }
+ }
+ }
- public override LambdaExpression DoToExpression()
- {
- return Expression.Lambda(OriginalExpression.Type, Body.ToExpression(), Parameters.ToExpression());
- }
- }
-}
\ No newline at end of file
+ public override LambdaExpression DoToExpression()
+ {
+ return Expression.Lambda(OriginalExpression.Type, Body.ToExpression(), Parameters.ToExpression());
+ }
+ }
+}
diff --git a/src/Uno.Core/Expressions/EditableListInitExpression.cs b/src/Uno.Core/Expressions/EditableListInitExpression.cs
index 420e9d6..a483401 100644
--- a/src/Uno.Core/Expressions/EditableListInitExpression.cs
+++ b/src/Uno.Core/Expressions/EditableListInitExpression.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
@@ -21,40 +22,40 @@
namespace Uno.Expressions
{
- public class EditableListInitExpression : EditableExpression
- {
- private readonly List initializers;
+ public class EditableListInitExpression : EditableExpression
+ {
+ private readonly List initializers;
- public EditableListInitExpression(ListInitExpression expression)
- : base(expression, false)
- {
- initializers = new List(expression.Initializers.Select(item => new EditableElementInit(item)));
- NewExpression = expression.NewExpression.Edit();
- }
+ public EditableListInitExpression(ListInitExpression expression)
+ : base(expression, false)
+ {
+ initializers = new List(expression.Initializers.Select(item => new EditableElementInit(item)));
+ NewExpression = expression.NewExpression.Edit();
+ }
- public EditableNewExpression NewExpression { get; set; }
+ public EditableNewExpression NewExpression { get; set; }
- public IList Initializers
- {
- get { return initializers; }
- }
+ public IList Initializers
+ {
+ get { return initializers; }
+ }
- public override IEnumerable Nodes
- {
- get
- {
- yield return NewExpression;
- foreach (var init in Initializers.SelectMany(item => item.Arguments.Items).Cast())
- {
- yield return init;
- }
- }
- }
+ public override IEnumerable Nodes
+ {
+ get
+ {
+ yield return NewExpression;
+ foreach (var init in Initializers.SelectMany(item => item.Arguments.Items).Cast())
+ {
+ yield return init;
+ }
+ }
+ }
- public override ListInitExpression DoToExpression()
- {
- return Expression.ListInit(NewExpression.DoToExpression(),
- initializers.Select(item => item.ToElementInit()).ToArray());
- }
- }
-}
\ No newline at end of file
+ public override ListInitExpression DoToExpression()
+ {
+ return Expression.ListInit(NewExpression.DoToExpression(),
+ initializers.Select(item => item.ToElementInit()).ToArray());
+ }
+ }
+}
diff --git a/src/Uno.Core/Expressions/EditableMemberExpression.cs b/src/Uno.Core/Expressions/EditableMemberExpression.cs
index 38aae30..508c60f 100644
--- a/src/Uno.Core/Expressions/EditableMemberExpression.cs
+++ b/src/Uno.Core/Expressions/EditableMemberExpression.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Reflection;
@@ -21,27 +22,27 @@
namespace Uno.Expressions
{
- public class EditableMemberExpression : EditableExpression
- {
- public EditableMemberExpression(MemberExpression expression)
- : base(expression, false)
- {
- Member = expression.Member;
- Expression = expression.Expression.Edit();
- }
+ public class EditableMemberExpression : EditableExpression
+ {
+ public EditableMemberExpression(MemberExpression expression)
+ : base(expression, false)
+ {
+ Member = expression.Member;
+ Expression = expression.Expression.Edit();
+ }
- public MemberInfo Member { get; set; }
+ public MemberInfo Member { get; set; }
- public IEditableExpression Expression { get; set; }
+ public IEditableExpression Expression { get; set; }
- public override IEnumerable Nodes
- {
- get { yield return Expression; }
- }
+ public override IEnumerable Nodes
+ {
+ get { yield return Expression; }
+ }
- public override MemberExpression DoToExpression()
- {
- return System.Linq.Expressions.Expression.MakeMemberAccess(Expression.ToExpression(), Member);
- }
- }
-}
\ No newline at end of file
+ public override MemberExpression DoToExpression()
+ {
+ return System.Linq.Expressions.Expression.MakeMemberAccess(Expression.ToExpression(), Member);
+ }
+ }
+}
diff --git a/src/Uno.Core/Expressions/EditableMemberInitExpression.cs b/src/Uno.Core/Expressions/EditableMemberInitExpression.cs
index 7d94b82..5890ae0 100644
--- a/src/Uno.Core/Expressions/EditableMemberInitExpression.cs
+++ b/src/Uno.Core/Expressions/EditableMemberInitExpression.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,38 +14,39 @@
// limitations under the License.
//
// ******************************************************************
+
using System.Collections.Generic;
using System.Linq.Expressions;
using Uno.Extensions;
namespace Uno.Expressions
{
- public class EditableMemberInitExpression : EditableExpression
- {
- private readonly List bindings;
+ public class EditableMemberInitExpression : EditableExpression
+ {
+ private readonly List bindings;
- public EditableMemberInitExpression(MemberInitExpression expression)
- : base(expression, false)
- {
- NewExpression = expression.NewExpression.Edit();
- bindings = new List(expression.Bindings);
- }
+ public EditableMemberInitExpression(MemberInitExpression expression)
+ : base(expression, false)
+ {
+ NewExpression = expression.NewExpression.Edit();
+ bindings = new List(expression.Bindings);
+ }
- public EditableNewExpression NewExpression { get; set; }
+ public EditableNewExpression NewExpression { get; set; }
- public IList Bindings
- {
- get { return bindings; }
- }
+ public IList Bindings
+ {
+ get { return bindings; }
+ }
- public override IEnumerable Nodes
- {
- get { yield return NewExpression; }
- }
+ public override IEnumerable Nodes
+ {
+ get { yield return NewExpression; }
+ }
- public override MemberInitExpression DoToExpression()
- {
- return Expression.MemberInit(NewExpression.DoToExpression(), Bindings);
- }
- }
-}
\ No newline at end of file
+ public override MemberInitExpression DoToExpression()
+ {
+ return Expression.MemberInit(NewExpression.DoToExpression(), Bindings);
+ }
+ }
+}
diff --git a/src/Uno.Core/Expressions/EditableMethodCallExpression.cs b/src/Uno.Core/Expressions/EditableMethodCallExpression.cs
index 62f69f0..ee3c299 100644
--- a/src/Uno.Core/Expressions/EditableMethodCallExpression.cs
+++ b/src/Uno.Core/Expressions/EditableMethodCallExpression.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Reflection;
@@ -21,42 +22,42 @@
namespace Uno.Expressions
{
- public class EditableMethodCallExpression : EditableExpression
- {
- private readonly EditableExpressionCollection arguments;
-
- public EditableMethodCallExpression(MethodCallExpression expression)
- : base(expression, false)
- {
- Method = expression.Method;
- Object = expression.Object.Edit();
- arguments = new EditableExpressionCollection(expression.Arguments);
- }
-
- public MethodInfo Method { get; set; }
-
- public IEditableExpression Object { get; set; }
-
- public EditableExpressionCollection Arguments
- {
- get { return arguments; }
- }
-
- public override IEnumerable Nodes
- {
- get
- {
- yield return Object;
- foreach (var item in Arguments.Items)
- {
- yield return item;
- }
- }
- }
-
- public override MethodCallExpression DoToExpression()
- {
- return Expression.Call(Object.ToExpression(), Method, arguments.ToExpression());
- }
- }
-}
\ No newline at end of file
+ public class EditableMethodCallExpression : EditableExpression
+ {
+ private readonly EditableExpressionCollection arguments;
+
+ public EditableMethodCallExpression(MethodCallExpression expression)
+ : base(expression, false)
+ {
+ Method = expression.Method;
+ Object = expression.Object.Edit();
+ arguments = new EditableExpressionCollection(expression.Arguments);
+ }
+
+ public MethodInfo Method { get; set; }
+
+ public IEditableExpression Object { get; set; }
+
+ public EditableExpressionCollection Arguments
+ {
+ get { return arguments; }
+ }
+
+ public override IEnumerable Nodes
+ {
+ get
+ {
+ yield return Object;
+ foreach (var item in Arguments.Items)
+ {
+ yield return item;
+ }
+ }
+ }
+
+ public override MethodCallExpression DoToExpression()
+ {
+ return Expression.Call(Object.ToExpression(), Method, arguments.ToExpression());
+ }
+ }
+}
diff --git a/src/Uno.Core/Expressions/EditableNewArrayExpression.cs b/src/Uno.Core/Expressions/EditableNewArrayExpression.cs
index 2a7dd57..2431cf3 100644
--- a/src/Uno.Core/Expressions/EditableNewArrayExpression.cs
+++ b/src/Uno.Core/Expressions/EditableNewArrayExpression.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq;
@@ -21,62 +22,62 @@
namespace Uno.Expressions
{
- public class EditableNewArrayExpression : EditableExpression
- {
- private readonly EditableExpressionCollection expressions;
+ public class EditableNewArrayExpression : EditableExpression
+ {
+ private readonly EditableExpressionCollection expressions;
- public EditableNewArrayExpression(NewArrayExpression expression)
- : base(expression)
- {
- Type = expression.Type;
- expressions = new EditableExpressionCollection(expression.Expressions);
- }
+ public EditableNewArrayExpression(NewArrayExpression expression)
+ : base(expression)
+ {
+ Type = expression.Type;
+ expressions = new EditableExpressionCollection(expression.Expressions);
+ }
- public override ExpressionType NodeType
- {
- get { return base.NodeType; }
- set
- {
- switch (value)
- {
- case System.Linq.Expressions.ExpressionType.NewArrayInit:
- case System.Linq.Expressions.ExpressionType.NewArrayBounds:
- base.NodeType = value;
- break;
+ public override ExpressionType NodeType
+ {
+ get { return base.NodeType; }
+ set
+ {
+ switch (value)
+ {
+ case System.Linq.Expressions.ExpressionType.NewArrayInit:
+ case System.Linq.Expressions.ExpressionType.NewArrayBounds:
+ base.NodeType = value;
+ break;
- default:
- throw new InvalidOperationException(
- "NodeType for NewArrayExpression must be ExpressionType.NewArrayInit or ExpressionType.NewArrayBounds");
- }
- }
- }
+ default:
+ throw new InvalidOperationException(
+ "NodeType for NewArrayExpression must be ExpressionType.NewArrayInit or ExpressionType.NewArrayBounds");
+ }
+ }
+ }
- public Type Type { get; set; }
+ public Type Type { get; set; }
- public EditableExpressionCollection Expressions
- {
- get { return expressions; }
- }
+ public EditableExpressionCollection Expressions
+ {
+ get { return expressions; }
+ }
- public override IEnumerable Nodes
- {
- get { return Expressions.Items.Cast(); }
- }
+ public override IEnumerable Nodes
+ {
+ get { return Expressions.Items.Cast(); }
+ }
- public override NewArrayExpression DoToExpression()
- {
- switch (NodeType)
- {
- case System.Linq.Expressions.ExpressionType.NewArrayInit:
- return Expression.NewArrayInit(Type, expressions.ToExpression());
+ public override NewArrayExpression DoToExpression()
+ {
+ switch (NodeType)
+ {
+ case System.Linq.Expressions.ExpressionType.NewArrayInit:
+ return Expression.NewArrayInit(Type, expressions.ToExpression());
- case System.Linq.Expressions.ExpressionType.NewArrayBounds:
- return Expression.NewArrayBounds(Type, expressions.ToExpression());
+ case System.Linq.Expressions.ExpressionType.NewArrayBounds:
+ return Expression.NewArrayBounds(Type, expressions.ToExpression());
- default:
- throw new InvalidOperationException(
- "NodeType for NewArrayExpression must be ExpressionType.NewArrayInit or ExpressionType.NewArrayBounds");
- }
- }
- }
-}
\ No newline at end of file
+ default:
+ throw new InvalidOperationException(
+ "NodeType for NewArrayExpression must be ExpressionType.NewArrayInit or ExpressionType.NewArrayBounds");
+ }
+ }
+ }
+}
diff --git a/src/Uno.Core/Expressions/EditableNewExpression.cs b/src/Uno.Core/Expressions/EditableNewExpression.cs
index e5bb799..58ae68c 100644
--- a/src/Uno.Core/Expressions/EditableNewExpression.cs
+++ b/src/Uno.Core/Expressions/EditableNewExpression.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
@@ -21,32 +22,32 @@
namespace Uno.Expressions
{
- public class EditableNewExpression : EditableExpression
- {
- private readonly EditableExpressionCollection arguments;
+ public class EditableNewExpression : EditableExpression
+ {
+ private readonly EditableExpressionCollection arguments;
- public EditableNewExpression(NewExpression expression)
- : base(expression, false)
- {
- arguments = new EditableExpressionCollection(expression.Arguments);
- Constructor = expression.Constructor;
- }
+ public EditableNewExpression(NewExpression expression)
+ : base(expression, false)
+ {
+ arguments = new EditableExpressionCollection(expression.Arguments);
+ Constructor = expression.Constructor;
+ }
- public ConstructorInfo Constructor { get; set; }
+ public ConstructorInfo Constructor { get; set; }
- public EditableExpressionCollection Arguments
- {
- get { return arguments; }
- }
+ public EditableExpressionCollection Arguments
+ {
+ get { return arguments; }
+ }
- public override IEnumerable Nodes
- {
- get { return Arguments.Items.Cast(); }
- }
+ public override IEnumerable Nodes
+ {
+ get { return Arguments.Items.Cast(); }
+ }
- public override NewExpression DoToExpression()
- {
- return Expression.New(Constructor, arguments.ToExpression());
- }
- }
-}
\ No newline at end of file
+ public override NewExpression DoToExpression()
+ {
+ return Expression.New(Constructor, arguments.ToExpression());
+ }
+ }
+}
diff --git a/src/Uno.Core/Expressions/EditableParameterExpression.cs b/src/Uno.Core/Expressions/EditableParameterExpression.cs
index 9ed6911..f59e55d 100644
--- a/src/Uno.Core/Expressions/EditableParameterExpression.cs
+++ b/src/Uno.Core/Expressions/EditableParameterExpression.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,34 +14,35 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Linq.Expressions;
namespace Uno.Expressions
{
- public class EditableParameterExpression : EditableExpression
- {
- public EditableParameterExpression(ParameterExpression expression)
- : base(expression, false)
- {
- Type = expression.Type;
- Name = expression.Name;
- }
+ public class EditableParameterExpression : EditableExpression
+ {
+ public EditableParameterExpression(ParameterExpression expression)
+ : base(expression, false)
+ {
+ Type = expression.Type;
+ Name = expression.Name;
+ }
- public Type Type { get; set; }
+ public Type Type { get; set; }
- public string Name { get; set; }
+ public string Name { get; set; }
- public override ParameterExpression DoToExpression()
- {
- return Expression.Parameter(Type, Name);
- }
+ public override ParameterExpression DoToExpression()
+ {
+ return Expression.Parameter(Type, Name);
+ }
- protected override bool ShouldUse(ParameterExpression expression)
- {
- return expression.Type == Type /* &&
- expression.Name == Name*/;
- //TODO Support Name, Index strategies to compare parameters (Require Parent Collection for index?)
- }
- }
-}
\ No newline at end of file
+ protected override bool ShouldUse(ParameterExpression expression)
+ {
+ return expression.Type == Type /* &&
+ expression.Name == Name*/;
+ //TODO Support Name, Index strategies to compare parameters (Require Parent Collection for index?)
+ }
+ }
+}
diff --git a/src/Uno.Core/Expressions/EditableParameterExpressionCollection.cs b/src/Uno.Core/Expressions/EditableParameterExpressionCollection.cs
index 0039c5e..aceede3 100644
--- a/src/Uno.Core/Expressions/EditableParameterExpressionCollection.cs
+++ b/src/Uno.Core/Expressions/EditableParameterExpressionCollection.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
@@ -21,51 +22,51 @@
namespace Uno.Expressions
{
- public class EditableParameterExpressionCollection : EditableExpressionCollection
- {
- private readonly IEditableExpression body;
- private IEnumerable parametersOverride;
+ public class EditableParameterExpressionCollection : EditableExpressionCollection
+ {
+ private readonly IEditableExpression body;
+ private IEnumerable parametersOverride;
- public EditableParameterExpressionCollection(IEditableExpression body, IEnumerable items)
- : base(items)
- {
- this.body = body;
- }
+ public EditableParameterExpressionCollection(IEditableExpression body, IEnumerable items)
+ : base(items)
+ {
+ this.body = body;
+ }
- public IEnumerable Parameters
- {
- get { return Items.Cast(); }
- }
+ public IEnumerable Parameters
+ {
+ get { return Items.Cast(); }
+ }
- public void Use(IEnumerable parameters)
- {
- parametersOverride = parameters;
- }
+ public void Use(IEnumerable parameters)
+ {
+ parametersOverride = parameters;
+ }
- public override ParameterExpression[] ToExpression()
- {
- var expressions = new List();
+ public override ParameterExpression[] ToExpression()
+ {
+ var expressions = new List();
- if (parametersOverride == null)
- {
- var bodyParams = body.AllNodes().OfType();
+ if (parametersOverride == null)
+ {
+ var bodyParams = body.AllNodes().OfType();
- foreach (var param in Parameters)
- {
- // TODO: Closure problem - Do we want closure?
- var param1 = param;
- //TODO Check if more than one param matches?
- var bodyParam = bodyParams.FirstOrDefault(item => item.Type == param1.Type && item.Name == param1.Name);
+ foreach (var param in Parameters)
+ {
+ // TODO: Closure problem - Do we want closure?
+ var param1 = param;
+ //TODO Check if more than one param matches?
+ var bodyParam = bodyParams.FirstOrDefault(item => item.Type == param1.Type && item.Name == param1.Name);
- expressions.Add((bodyParam ?? param).DoToExpression());
- }
- }
- else
- {
- expressions.AddRange(parametersOverride);
- }
+ expressions.Add((bodyParam ?? param).DoToExpression());
+ }
+ }
+ else
+ {
+ expressions.AddRange(parametersOverride);
+ }
- return expressions.ToArray();
- }
- }
-}
\ No newline at end of file
+ return expressions.ToArray();
+ }
+ }
+}
diff --git a/src/Uno.Core/Expressions/EditableTypeBinaryExpression.cs b/src/Uno.Core/Expressions/EditableTypeBinaryExpression.cs
index a751dab..d14b897 100644
--- a/src/Uno.Core/Expressions/EditableTypeBinaryExpression.cs
+++ b/src/Uno.Core/Expressions/EditableTypeBinaryExpression.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
@@ -21,27 +22,27 @@
namespace Uno.Expressions
{
- public class EditableTypeBinaryExpression : EditableExpression
- {
- public EditableTypeBinaryExpression(TypeBinaryExpression expression)
- : base(expression, false)
- {
- TypeOperand = expression.TypeOperand;
- Expression = expression.Expression.Edit();
- }
+ public class EditableTypeBinaryExpression : EditableExpression
+ {
+ public EditableTypeBinaryExpression(TypeBinaryExpression expression)
+ : base(expression, false)
+ {
+ TypeOperand = expression.TypeOperand;
+ Expression = expression.Expression.Edit();
+ }
- public Type TypeOperand { get; set; }
+ public Type TypeOperand { get; set; }
- public IEditableExpression Expression { get; set; }
+ public IEditableExpression Expression { get; set; }
- public override IEnumerable Nodes
- {
- get { yield return Expression; }
- }
+ public override IEnumerable Nodes
+ {
+ get { yield return Expression; }
+ }
- public override TypeBinaryExpression DoToExpression()
- {
- return System.Linq.Expressions.Expression.TypeIs(Expression.ToExpression(), TypeOperand);
- }
- }
-}
\ No newline at end of file
+ public override TypeBinaryExpression DoToExpression()
+ {
+ return System.Linq.Expressions.Expression.TypeIs(Expression.ToExpression(), TypeOperand);
+ }
+ }
+}
diff --git a/src/Uno.Core/Expressions/EditableUnaryExpression.cs b/src/Uno.Core/Expressions/EditableUnaryExpression.cs
index 47c30e2..042d69e 100644
--- a/src/Uno.Core/Expressions/EditableUnaryExpression.cs
+++ b/src/Uno.Core/Expressions/EditableUnaryExpression.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
@@ -21,27 +22,27 @@
namespace Uno.Expressions
{
- public class EditableUnaryExpression : EditableExpression
- {
- public EditableUnaryExpression(UnaryExpression expression)
- : base(expression)
- {
- Type = expression.Type;
- Operand = expression.Operand.Edit();
- }
+ public class EditableUnaryExpression : EditableExpression
+ {
+ public EditableUnaryExpression(UnaryExpression expression)
+ : base(expression)
+ {
+ Type = expression.Type;
+ Operand = expression.Operand.Edit();
+ }
- public Type Type { get; set; }
+ public Type Type { get; set; }
- public IEditableExpression Operand { get; set; }
+ public IEditableExpression Operand { get; set; }
- public override IEnumerable Nodes
- {
- get { yield return Operand; }
- }
+ public override IEnumerable Nodes
+ {
+ get { yield return Operand; }
+ }
- public override UnaryExpression DoToExpression()
- {
- return Expression.MakeUnary(NodeType, Operand.ToExpression(), Type);
- }
- }
-}
\ No newline at end of file
+ public override UnaryExpression DoToExpression()
+ {
+ return Expression.MakeUnary(NodeType, Operand.ToExpression(), Type);
+ }
+ }
+}
diff --git a/src/Uno.Core/Expressions/ExpressionExtensions.cs b/src/Uno.Core/Expressions/ExpressionExtensions.cs
index 9e46073..09568c9 100644
--- a/src/Uno.Core/Expressions/ExpressionExtensions.cs
+++ b/src/Uno.Core/Expressions/ExpressionExtensions.cs
@@ -1,5 +1,5 @@
// ******************************************************************
-// Copyright � 2015-2018 nventive inc. All rights reserved.
+// Copyright � 2015-2020 nventive inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
// limitations under the License.
//
// ******************************************************************
+
using System;
using System.Linq;
using System.Linq.Expressions;
@@ -21,138 +22,138 @@
namespace Uno.Extensions
{
- public static class ExpressionExtensions
- {
- public static string GetMemberName(this Expression> selector)
- {
- var member = selector.FindMember();
-
- return member == null ? null : member.Name;
- }
-
- public static MemberInfo FindMember(this Expression> selector)
- {
- var memberExpression = selector.Body as MemberExpression;
-
- if (memberExpression == null)
- {
- selector.Body.Maybe(u => memberExpression = u.Operand as MemberExpression);
- }
-
- if (memberExpression == null)
- {
- return null;
- }
- else
- {
- return memberExpression.Member;
- }
- }
-
- public static string GetSelectedMemberName(this Expression> selector)
- {
- if (selector == null)
- {
- return null;
- }
- else
- {
- if (selector.Body is MemberExpression)
- {
- var memberExpression = selector.Body as MemberExpression;
- return memberExpression.Member.Name;
- }
- else if (selector.Body is UnaryExpression)
- {
- var unaryExpression = selector.Body as UnaryExpression;
- return (unaryExpression.Operand as MemberExpression).Member.Name;
- }
- return null;
-
- }
- }
-
- public static Expression> And(this Expression> left,
- params Expression>[] items)
- {
- var result = left;
-
- items.ForEach(item => result = Binary(CompositionType.And, result, item));
-
- return result;
- }
-
- public static Expression> Or(this Expression> left,
- params Expression>[] items)
- {
- var result = left;
-
- items.ForEach(item => result = Binary(CompositionType.Or, result, item));
-
- return result;
- }
-
- public static Expression> Not(this Expression> expression)
- {
- return Expression.Lambda>(Expression.Not(expression.Body), expression.Parameters);
- }
-
- public static Expression> And(this Expression> left, params Expression>[] items)
- {
- var result = left;
-
- items.ForEach(item => result = Binary(CompositionType.And, result, item));
-
- return result;
- }
-
- public static Expression> Or(this Expression> left, params Expression>[] items)
- {
- var result = left;
-
- items.ForEach(item => result = Binary(CompositionType.Or, result, item));
-
- return result;
- }
-
- public static Expression> Not(this Expression> expression)
- {
- return Expression.Lambda>(Expression.Not(expression.Body), expression.Parameters);
- }
-
- private static Expression Binary(CompositionType type, Expression left, Expression right)
- {
- if (left == null)
- {
- return right;
- }
-
- if (right == null)
- {
- return left;
- }
-
- right = ReplaceParameters(left, right);
-
- var newBody = Binary(type, left.Body, right.Body);
-
- return Expression.Lambda