From 4e7b0bbd6b905a3279cd6912fa75340f6d28a7f2 Mon Sep 17 00:00:00 2001 From: dukesta3 Date: Sun, 21 Apr 2019 07:59:30 -0500 Subject: [PATCH 01/24] =?UTF-8?q?housekeeping:=20updated=20docs=20to=20Ana?= =?UTF-8?q?=C3=AFs=20Betters=20(#2003)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit did a search for betts and updated README.md, and multiple *.build.props folders. --- README.md | 4 ++-- directory.build.props | 2 +- integrationtests/Directory.Build.props | 2 +- src/Directory.build.props | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e4abfa895e..67f335b236 100644 --- a/README.md +++ b/README.md @@ -349,9 +349,9 @@ The following have been core team members in the past.

London, United Kingdom

- +
- Paul Betts + Anaïs Betts

San Francisco, USA

diff --git a/directory.build.props b/directory.build.props index 6caac2ea90..1d4ece3727 100644 --- a/directory.build.props +++ b/directory.build.props @@ -5,7 +5,7 @@ MIT https://reactiveui.net https://github.com/reactiveui/styleguide/blob/master/logo/main.png?raw=true - xpaulbettsx;ghuntley + xanaisbettsx;ghuntley ReactiveUI ($(TargetFramework)) mvvm;reactiveui;rx;reactive extensions;observable;LINQ;events;frp;xamarin;android;ios;mac;forms;monodroid;monotouch;xamarin.android;xamarin.ios;xamarin.forms;xamarin.mac;xamarin.tvos;wpf;net;netstandard;net461;uwp;tizen https://github.com/reactiveui/ReactiveUI/releases diff --git a/integrationtests/Directory.Build.props b/integrationtests/Directory.Build.props index 87a8c6860e..771ccf8e11 100644 --- a/integrationtests/Directory.Build.props +++ b/integrationtests/Directory.Build.props @@ -4,7 +4,7 @@ https://reactiveui.net https://i.imgur.com/7WDbqSy.png .NET Foundation and Contributors - xpaulbettsx;ghuntley + xanaisbettsx;ghuntley ReactiveUI Integration Tests ($(TargetFramework)) mvvm;reactiveui;rx;reactive extensions;observable;LINQ;events;frp;xamarin;android;ios;mac;forms;monodroid;monotouch;xamarin.android;xamarin.ios;xamarin.forms;xamarin.mac;xamarin.tvos;wpf;net;netstandard;net461;uwp;tizen https://reactiveui.net/blog/ diff --git a/src/Directory.build.props b/src/Directory.build.props index 91fde9e2d4..e6dff6f4db 100644 --- a/src/Directory.build.props +++ b/src/Directory.build.props @@ -1,6 +1,6 @@ - xpaulbettsx;ghuntley + xanaisbettsx;ghuntley mvvm;reactiveui;rx;reactive extensions;observable;LINQ;events;frp;xamarin;android;ios;mac;forms;monodroid;monotouch;xamarin.android;xamarin.ios;xamarin.forms;xamarin.mac;xamarin.tvos;wpf;net;netstandard;net461;uwp;tizen https://reactiveui.net/blog/ true From 25f99e6ed8e89cff0035deb65f6d7062bc33a58d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 26 Apr 2019 10:30:46 +1000 Subject: [PATCH 02/24] build(deps): bump FodyPackaging from 4.2.1 to 5.0.1 (#2009) Bumps [FodyPackaging](https://github.com/Fody/Fody) from 4.2.1 to 5.0.1. - [Release notes](https://github.com/Fody/Fody/releases) - [Commits](https://github.com/Fody/Fody/commits) Signed-off-by: dependabot[bot] --- src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj b/src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj index e04eb05f6a..b269573000 100644 --- a/src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj +++ b/src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj @@ -15,7 +15,7 @@ - + From 93b144620149e1c440c769d9e709f37da41dae56 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 26 Apr 2019 10:44:55 +1000 Subject: [PATCH 03/24] build(deps): bump Fody from 4.2.1 to 5.0.1 (#2011) Bumps [Fody](https://github.com/Fody/Fody) from 4.2.1 to 5.0.1. - [Release notes](https://github.com/Fody/Fody/releases) - [Commits](https://github.com/Fody/Fody/commits) Signed-off-by: dependabot[bot] --- src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj b/src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj index b269573000..635467e930 100644 --- a/src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj +++ b/src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj @@ -14,7 +14,7 @@ - + From a3b4eba0cf2737c3e1447329e80550461a4880e1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 26 Apr 2019 10:45:16 +1000 Subject: [PATCH 04/24] build(deps): bump FodyHelpers from 4.2.1 to 5.0.1 (#2010) Bumps [FodyHelpers](https://github.com/Fody/Fody) from 4.2.1 to 5.0.1. - [Release notes](https://github.com/Fody/Fody/releases) - [Commits](https://github.com/Fody/Fody/commits) Signed-off-by: dependabot[bot] --- src/ReactiveUI.Fody/ReactiveUI.Fody.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ReactiveUI.Fody/ReactiveUI.Fody.csproj b/src/ReactiveUI.Fody/ReactiveUI.Fody.csproj index 1b19d2be2f..cc8a633788 100644 --- a/src/ReactiveUI.Fody/ReactiveUI.Fody.csproj +++ b/src/ReactiveUI.Fody/ReactiveUI.Fody.csproj @@ -7,6 +7,6 @@ - + \ No newline at end of file From 09cdaefae18d8f83ba2851ffe723bd4a2d3c0697 Mon Sep 17 00:00:00 2001 From: Glenn Watson <5834289+glennawatson@users.noreply.github.com> Date: Fri, 26 Apr 2019 19:37:59 +1000 Subject: [PATCH 05/24] housekeeping: further convert some more projects --- .../MasterDetail/MasterDetail/MasterDetail.csproj | 4 ++-- .../xamarin-forms/MasterDetail/iOS/MasterDetail.iOS.csproj | 2 +- src/EventBuilder/Platforms/XamForms.cs | 2 +- .../ReactiveUI.Events.XamForms.csproj | 2 +- version.json | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/samples/xamarin-forms/MasterDetail/MasterDetail/MasterDetail.csproj b/samples/xamarin-forms/MasterDetail/MasterDetail/MasterDetail.csproj index 8bf04bab70..53ad9b729b 100644 --- a/samples/xamarin-forms/MasterDetail/MasterDetail/MasterDetail.csproj +++ b/samples/xamarin-forms/MasterDetail/MasterDetail/MasterDetail.csproj @@ -6,7 +6,7 @@ - - + + \ No newline at end of file diff --git a/samples/xamarin-forms/MasterDetail/iOS/MasterDetail.iOS.csproj b/samples/xamarin-forms/MasterDetail/iOS/MasterDetail.iOS.csproj index 58b713d01f..ef81ce12d8 100644 --- a/samples/xamarin-forms/MasterDetail/iOS/MasterDetail.iOS.csproj +++ b/samples/xamarin-forms/MasterDetail/iOS/MasterDetail.iOS.csproj @@ -149,7 +149,7 @@ - + diff --git a/src/EventBuilder/Platforms/XamForms.cs b/src/EventBuilder/Platforms/XamForms.cs index f5ea59a080..35f7378d8b 100644 --- a/src/EventBuilder/Platforms/XamForms.cs +++ b/src/EventBuilder/Platforms/XamForms.cs @@ -21,7 +21,7 @@ public class XamForms : BasePlatform { private readonly PackageIdentity[] _packageNames = new[] { - new PackageIdentity("Xamarin.Forms", new NuGetVersion("3.5.0.129452")), + new PackageIdentity("Xamarin.Forms", new NuGetVersion("4.0.0.346134-pre9")), }; /// diff --git a/src/ReactiveUI.Events.XamForms/ReactiveUI.Events.XamForms.csproj b/src/ReactiveUI.Events.XamForms/ReactiveUI.Events.XamForms.csproj index 1e51832966..7b3eb7cb11 100644 --- a/src/ReactiveUI.Events.XamForms/ReactiveUI.Events.XamForms.csproj +++ b/src/ReactiveUI.Events.XamForms/ReactiveUI.Events.XamForms.csproj @@ -16,7 +16,7 @@ - + \ No newline at end of file diff --git a/version.json b/version.json index 983607298e..7eb1ba704e 100644 --- a/version.json +++ b/version.json @@ -1,8 +1,8 @@ { - "version": "9.13", + "version": "10.0.1-xamarin-forms4-preview.{height}", "publicReleaseRefSpec": [ "^refs/heads/master$", // we release out of master - "^refs/heads/develop$", // we release out of develop + "^refs/heads/preview/.*", // we release previews "^refs/heads/rel/\\d+\\.\\d+\\.\\d+" // we also release branches starting with rel/N.N.N ], "nugetPackageVersion":{ From b91bb7c406b48afb4a3a9e99ea40fdd2fa7a23f6 Mon Sep 17 00:00:00 2001 From: Glenn Watson <5834289+glennawatson@users.noreply.github.com> Date: Fri, 26 Apr 2019 19:55:00 +1000 Subject: [PATCH 06/24] Revert "housekeeping: further convert some more projects" This reverts commit 09cdaefae18d8f83ba2851ffe723bd4a2d3c0697. --- .../MasterDetail/MasterDetail/MasterDetail.csproj | 4 ++-- .../xamarin-forms/MasterDetail/iOS/MasterDetail.iOS.csproj | 2 +- src/EventBuilder/Platforms/XamForms.cs | 2 +- .../ReactiveUI.Events.XamForms.csproj | 2 +- version.json | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/samples/xamarin-forms/MasterDetail/MasterDetail/MasterDetail.csproj b/samples/xamarin-forms/MasterDetail/MasterDetail/MasterDetail.csproj index 53ad9b729b..8bf04bab70 100644 --- a/samples/xamarin-forms/MasterDetail/MasterDetail/MasterDetail.csproj +++ b/samples/xamarin-forms/MasterDetail/MasterDetail/MasterDetail.csproj @@ -6,7 +6,7 @@ - - + + \ No newline at end of file diff --git a/samples/xamarin-forms/MasterDetail/iOS/MasterDetail.iOS.csproj b/samples/xamarin-forms/MasterDetail/iOS/MasterDetail.iOS.csproj index ef81ce12d8..58b713d01f 100644 --- a/samples/xamarin-forms/MasterDetail/iOS/MasterDetail.iOS.csproj +++ b/samples/xamarin-forms/MasterDetail/iOS/MasterDetail.iOS.csproj @@ -149,7 +149,7 @@ - + diff --git a/src/EventBuilder/Platforms/XamForms.cs b/src/EventBuilder/Platforms/XamForms.cs index 35f7378d8b..f5ea59a080 100644 --- a/src/EventBuilder/Platforms/XamForms.cs +++ b/src/EventBuilder/Platforms/XamForms.cs @@ -21,7 +21,7 @@ public class XamForms : BasePlatform { private readonly PackageIdentity[] _packageNames = new[] { - new PackageIdentity("Xamarin.Forms", new NuGetVersion("4.0.0.346134-pre9")), + new PackageIdentity("Xamarin.Forms", new NuGetVersion("3.5.0.129452")), }; /// diff --git a/src/ReactiveUI.Events.XamForms/ReactiveUI.Events.XamForms.csproj b/src/ReactiveUI.Events.XamForms/ReactiveUI.Events.XamForms.csproj index 7b3eb7cb11..1e51832966 100644 --- a/src/ReactiveUI.Events.XamForms/ReactiveUI.Events.XamForms.csproj +++ b/src/ReactiveUI.Events.XamForms/ReactiveUI.Events.XamForms.csproj @@ -16,7 +16,7 @@ - + \ No newline at end of file diff --git a/version.json b/version.json index 7eb1ba704e..983607298e 100644 --- a/version.json +++ b/version.json @@ -1,8 +1,8 @@ { - "version": "10.0.1-xamarin-forms4-preview.{height}", + "version": "9.13", "publicReleaseRefSpec": [ "^refs/heads/master$", // we release out of master - "^refs/heads/preview/.*", // we release previews + "^refs/heads/develop$", // we release out of develop "^refs/heads/rel/\\d+\\.\\d+\\.\\d+" // we also release branches starting with rel/N.N.N ], "nugetPackageVersion":{ From 612f46888b88b3f56bb3891949c3889a7b8d6f03 Mon Sep 17 00:00:00 2001 From: Glenn Watson <5834289+glennawatson@users.noreply.github.com> Date: Fri, 26 Apr 2019 20:11:27 +1000 Subject: [PATCH 07/24] remove uap from tests for the moment --- src/ReactiveUI.Tests/ReactiveUI.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ReactiveUI.Tests/ReactiveUI.Tests.csproj b/src/ReactiveUI.Tests/ReactiveUI.Tests.csproj index abe76aaa88..486a6cddc3 100644 --- a/src/ReactiveUI.Tests/ReactiveUI.Tests.csproj +++ b/src/ReactiveUI.Tests/ReactiveUI.Tests.csproj @@ -2,7 +2,7 @@ netcoreapp2.0 - $(TargetFrameworks);net461;uap10.0.17763 + $(TargetFrameworks);net461 From a1cb284e2119a705dfc80315bf340df505d66503 Mon Sep 17 00:00:00 2001 From: Glenn <5834289+glennawatson@users.noreply.github.com> Date: Sat, 27 Apr 2019 16:44:24 +1000 Subject: [PATCH 08/24] housekeeping: Update to MSBuild.Sdk.Extras v2.0.24 and output API differences on DevOps builds. (#2012) --- .../ReactiveUI.Events.WPF.csproj | 2 +- .../ReactiveUI.Events.Winforms.csproj | 2 +- .../ReactiveUI.Events.csproj | 6 ---- .../ApiApprovalTests.Wpf.net461.approved.txt | 12 -------- .../Utilities/ApiApprovalBase.cs | 30 ++++++++++++++++++- .../ReactiveUI.Winforms.csproj | 2 +- src/ReactiveUI.Wpf/ReactiveUI.Wpf.csproj | 2 +- src/global.json | 2 +- 8 files changed, 34 insertions(+), 24 deletions(-) diff --git a/src/ReactiveUI.Events.WPF/ReactiveUI.Events.WPF.csproj b/src/ReactiveUI.Events.WPF/ReactiveUI.Events.WPF.csproj index 7d9a98a948..db7b5c8bf9 100644 --- a/src/ReactiveUI.Events.WPF/ReactiveUI.Events.WPF.csproj +++ b/src/ReactiveUI.Events.WPF/ReactiveUI.Events.WPF.csproj @@ -4,7 +4,7 @@ ReactiveUI.Events Provides Observable-based events API for WPF UI controls/eventhandlers. The contents of this package is automatically generated, please target pull-requests to the code generator. ReactiveUI.Events.WPF - true + true $(NoWarn);CS1570;CA1812 diff --git a/src/ReactiveUI.Events.Winforms/ReactiveUI.Events.Winforms.csproj b/src/ReactiveUI.Events.Winforms/ReactiveUI.Events.Winforms.csproj index 181920cb2d..86291fd3bf 100644 --- a/src/ReactiveUI.Events.Winforms/ReactiveUI.Events.Winforms.csproj +++ b/src/ReactiveUI.Events.Winforms/ReactiveUI.Events.Winforms.csproj @@ -5,7 +5,7 @@ ReactiveUI.Events Provides Observable-based events API for Winforms UI controls/eventhandlers. The contents of this package is automatically generated, please target pull-requests to the code generator. ReactiveUI.Events.Winforms - true + true $(NoWarn);CS1570;CA1812 diff --git a/src/ReactiveUI.Events/ReactiveUI.Events.csproj b/src/ReactiveUI.Events/ReactiveUI.Events.csproj index c82e5f0318..3b7cac72a4 100644 --- a/src/ReactiveUI.Events/ReactiveUI.Events.csproj +++ b/src/ReactiveUI.Events/ReactiveUI.Events.csproj @@ -18,12 +18,6 @@ - - Windows Desktop Extensions for the UWP - - - Windows Mobile Extensions for the UWP - diff --git a/src/ReactiveUI.Tests/Platforms/wpf/API/ApiApprovalTests.Wpf.net461.approved.txt b/src/ReactiveUI.Tests/Platforms/wpf/API/ApiApprovalTests.Wpf.net461.approved.txt index 61423593e4..1fd8a824c2 100644 --- a/src/ReactiveUI.Tests/Platforms/wpf/API/ApiApprovalTests.Wpf.net461.approved.txt +++ b/src/ReactiveUI.Tests/Platforms/wpf/API/ApiApprovalTests.Wpf.net461.approved.txt @@ -121,16 +121,4 @@ namespace ReactiveUI.Wpf public Registrations() { } public void Register(System.Action, System.Type> registerFunction) { } } -} -namespace XamlGeneratedNamespace -{ - public sealed class GeneratedInternalTypeHelper : System.Windows.Markup.InternalTypeHelper - { - public GeneratedInternalTypeHelper() { } - protected override void AddEventHandler(System.Reflection.EventInfo eventInfo, object target, System.Delegate handler) { } - protected override System.Delegate CreateDelegate(System.Type delegateType, object target, string handler) { } - protected override object CreateInstance(System.Type type, System.Globalization.CultureInfo culture) { } - protected override object GetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, System.Globalization.CultureInfo culture) { } - protected override void SetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, object value, System.Globalization.CultureInfo culture) { } - } } \ No newline at end of file diff --git a/src/ReactiveUI.Tests/Utilities/ApiApprovalBase.cs b/src/ReactiveUI.Tests/Utilities/ApiApprovalBase.cs index b70b89db78..34ff7703e7 100644 --- a/src/ReactiveUI.Tests/Utilities/ApiApprovalBase.cs +++ b/src/ReactiveUI.Tests/Utilities/ApiApprovalBase.cs @@ -5,11 +5,13 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; @@ -46,7 +48,33 @@ protected static void CheckApproval(Assembly assembly, [CallerMemberName]string if (!string.Equals(receivedPublicApi, approvedPublicApi, StringComparison.InvariantCulture)) { File.WriteAllText(receivedFileName, receivedPublicApi); - ShouldlyConfiguration.DiffTools.GetDiffTool().Open(receivedFileName, approvedFileName, true); + try + { + ShouldlyConfiguration.DiffTools.GetDiffTool().Open(receivedFileName, approvedFileName, true); + } + catch (ShouldAssertException) + { + var process = new Process + { + StartInfo = new ProcessStartInfo + { + Arguments = $"\"{approvedFileName}\" \"{receivedFileName}\"", + UseShellExecute = false, + RedirectStandardOutput = true, + CreateNoWindow = true + } + }; +#if NET_461 + process.StartInfo.FileName = "FC"; +#else + process.StartInfo.FileName = "diff"; +#endif + process.Start(); + string output = process.StandardOutput.ReadToEnd(); + process.WaitForExit(); + + throw new Exception("Invalid API configuration: " + Environment.NewLine + output); + } } Assert.Equal(approvedPublicApi, receivedPublicApi); diff --git a/src/ReactiveUI.Winforms/ReactiveUI.Winforms.csproj b/src/ReactiveUI.Winforms/ReactiveUI.Winforms.csproj index 06d525a43d..20a2476cf2 100644 --- a/src/ReactiveUI.Winforms/ReactiveUI.Winforms.csproj +++ b/src/ReactiveUI.Winforms/ReactiveUI.Winforms.csproj @@ -6,7 +6,7 @@ ReactiveUI.Winforms Windows Forms specific extensions to ReactiveUI ReactiveUI.WinForms - true + true diff --git a/src/ReactiveUI.Wpf/ReactiveUI.Wpf.csproj b/src/ReactiveUI.Wpf/ReactiveUI.Wpf.csproj index eb92fc1017..eeeb035b67 100644 --- a/src/ReactiveUI.Wpf/ReactiveUI.Wpf.csproj +++ b/src/ReactiveUI.Wpf/ReactiveUI.Wpf.csproj @@ -3,7 +3,7 @@ net461 WPF specific extensions to ReactiveUI ReactiveUI.WPF - true + true diff --git a/src/global.json b/src/global.json index 1e4edb34a6..ddab91af6c 100644 --- a/src/global.json +++ b/src/global.json @@ -1,5 +1,5 @@ { "msbuild-sdks": { - "MSBuild.Sdk.Extras": "1.6.68" + "MSBuild.Sdk.Extras": "2.0.24" } } From 8fb7684354b12829818608d39865065360f7d32e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 30 Apr 2019 11:13:00 +1000 Subject: [PATCH 09/24] build(deps): bump Microsoft.Xaml.Behaviors.Uwp.Managed (#2015) Bumps Microsoft.Xaml.Behaviors.Uwp.Managed from 2.0.0 to 2.0.1. Signed-off-by: dependabot[bot] --- src/ReactiveUI.Blend/ReactiveUI.Blend.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ReactiveUI.Blend/ReactiveUI.Blend.csproj b/src/ReactiveUI.Blend/ReactiveUI.Blend.csproj index cbb2791a28..f523132ca2 100644 --- a/src/ReactiveUI.Blend/ReactiveUI.Blend.csproj +++ b/src/ReactiveUI.Blend/ReactiveUI.Blend.csproj @@ -25,7 +25,7 @@ - + From cbcc5acfad186da9b01799ebdf03e3fb0b38e619 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 30 Apr 2019 12:29:14 +1000 Subject: [PATCH 10/24] build(deps): bump CommandLineParser from 2.4.3 to 2.5.0 (#2014) Bumps [CommandLineParser](https://github.com/commandlineparser/commandline) from 2.4.3 to 2.5.0. - [Release notes](https://github.com/commandlineparser/commandline/releases) - [Changelog](https://github.com/commandlineparser/commandline/blob/master/docs/ChangeLog) - [Commits](https://github.com/commandlineparser/commandline/compare/v2.4.3...v2.5.0) Signed-off-by: dependabot[bot] --- src/EventBuilder/EventBuilder.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EventBuilder/EventBuilder.csproj b/src/EventBuilder/EventBuilder.csproj index 2eca6b610e..547e7f22dc 100644 --- a/src/EventBuilder/EventBuilder.csproj +++ b/src/EventBuilder/EventBuilder.csproj @@ -18,7 +18,7 @@ - + From 1838154065e9b318457ff0e899a22543b65ad342 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 6 May 2019 10:29:39 +1000 Subject: [PATCH 11/24] build(deps): bump Fody from 5.0.1 to 5.0.5 (#2017) Bumps [Fody](https://github.com/Fody/Fody) from 5.0.1 to 5.0.5. - [Release notes](https://github.com/Fody/Fody/releases) - [Commits](https://github.com/Fody/Fody/commits) Signed-off-by: dependabot[bot] --- src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj b/src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj index 635467e930..fb68bd59ad 100644 --- a/src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj +++ b/src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj @@ -14,7 +14,7 @@ - + From a41b3f46467f206d94743c2155d5627775ff5701 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 6 May 2019 10:30:47 +1000 Subject: [PATCH 12/24] build(deps): bump FodyHelpers from 5.0.1 to 5.0.6 (#2018) Bumps [FodyHelpers](https://github.com/Fody/Fody) from 5.0.1 to 5.0.6. - [Release notes](https://github.com/Fody/Fody/releases) - [Commits](https://github.com/Fody/Fody/commits) Signed-off-by: dependabot[bot] --- src/ReactiveUI.Fody/ReactiveUI.Fody.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ReactiveUI.Fody/ReactiveUI.Fody.csproj b/src/ReactiveUI.Fody/ReactiveUI.Fody.csproj index cc8a633788..b98b86f887 100644 --- a/src/ReactiveUI.Fody/ReactiveUI.Fody.csproj +++ b/src/ReactiveUI.Fody/ReactiveUI.Fody.csproj @@ -7,6 +7,6 @@ - + \ No newline at end of file From 8fdca6979f5acd1ce55d270c4f6ae7903e38f897 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 6 May 2019 10:31:22 +1000 Subject: [PATCH 13/24] build(deps): bump FodyPackaging from 5.0.1 to 5.0.6 (#2016) Bumps [FodyPackaging](https://github.com/Fody/Fody) from 5.0.1 to 5.0.6. - [Release notes](https://github.com/Fody/Fody/releases) - [Commits](https://github.com/Fody/Fody/commits) Signed-off-by: dependabot[bot] --- src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj b/src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj index fb68bd59ad..5dcb8d151d 100644 --- a/src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj +++ b/src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj @@ -15,7 +15,7 @@ - + From 7da21d1d135fc745bef85059c9b1c35e9c46878a Mon Sep 17 00:00:00 2001 From: Rodney Littles II <6969701+RLittlesII@users.noreply.github.com> Date: Mon, 6 May 2019 22:47:01 -0500 Subject: [PATCH 14/24] housekeeping: Added IBuilder and Extensions (#2019) --- src/ReactiveUI.Mac.sln | 60 ++++++- .../ReactiveUI.Testing.Tests.csproj | 17 ++ src/ReactiveUI.Testing.Tests/TestFixture.cs | 35 ++++ .../TestFixtureBuilder.cs | 85 +++++++++ .../TestFixtureBuilderExtensionTests.cs | 167 ++++++++++++++++++ src/ReactiveUI.Testing/IBuilderExtensions.cs | 144 +++++++++++++++ .../MessageBusExtensions.cs | 69 ++++++++ .../{TestUtils.cs => SchedulerExtensions.cs} | 53 +----- ...iApprovalTests.Testing.net461.approved.txt | 26 ++- ...alTests.Testing.netcoreapp2.0.approved.txt | 26 ++- src/ReactiveUI.Tests/API/ApiApprovalTests.cs | 2 +- src/ReactiveUI.sln | 60 ++++++- 12 files changed, 681 insertions(+), 63 deletions(-) create mode 100644 src/ReactiveUI.Testing.Tests/ReactiveUI.Testing.Tests.csproj create mode 100644 src/ReactiveUI.Testing.Tests/TestFixture.cs create mode 100644 src/ReactiveUI.Testing.Tests/TestFixtureBuilder.cs create mode 100644 src/ReactiveUI.Testing.Tests/TestFixtureBuilderExtensionTests.cs create mode 100644 src/ReactiveUI.Testing/IBuilderExtensions.cs create mode 100644 src/ReactiveUI.Testing/MessageBusExtensions.cs rename src/ReactiveUI.Testing/{TestUtils.cs => SchedulerExtensions.cs} (81%) diff --git a/src/ReactiveUI.Mac.sln b/src/ReactiveUI.Mac.sln index 22ef441963..1a69974a9e 100644 --- a/src/ReactiveUI.Mac.sln +++ b/src/ReactiveUI.Mac.sln @@ -1,4 +1,4 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 +Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.26730.15 MinimumVisualStudioVersion = 10.0.40219.1 @@ -28,6 +28,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReactiveUI.Fody.Helpers", " EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReactiveUI.Fody.Tests", "ReactiveUI.Fody.Tests\ReactiveUI.Fody.Tests.csproj", "{404B0F3F-7343-4E54-A863-F27B99FE788B}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReactiveUI.Testing.Tests", "ReactiveUI.Testing.Tests\ReactiveUI.Testing.Tests.csproj", "{6591097A-342A-4EA0-AFF6-D2B3207F3E09}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Ad-Hoc|Any CPU = Ad-Hoc|Any CPU @@ -468,6 +470,62 @@ Global {404B0F3F-7343-4E54-A863-F27B99FE788B}.Release|x64.Build.0 = Release|Any CPU {404B0F3F-7343-4E54-A863-F27B99FE788B}.Release|x86.ActiveCfg = Release|Any CPU {404B0F3F-7343-4E54-A863-F27B99FE788B}.Release|x86.Build.0 = Release|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Ad-Hoc|Mixed Platforms.ActiveCfg = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Ad-Hoc|Mixed Platforms.Build.0 = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Ad-Hoc|x64.Build.0 = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Ad-Hoc|x86.Build.0 = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.AppStore|Any CPU.Build.0 = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.AppStore|ARM.ActiveCfg = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.AppStore|ARM.Build.0 = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.AppStore|iPhone.ActiveCfg = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.AppStore|iPhone.Build.0 = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.AppStore|Mixed Platforms.ActiveCfg = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.AppStore|Mixed Platforms.Build.0 = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.AppStore|x64.ActiveCfg = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.AppStore|x64.Build.0 = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.AppStore|x86.ActiveCfg = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.AppStore|x86.Build.0 = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Debug|ARM.ActiveCfg = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Debug|ARM.Build.0 = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Debug|iPhone.Build.0 = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Debug|x64.ActiveCfg = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Debug|x64.Build.0 = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Debug|x86.ActiveCfg = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Debug|x86.Build.0 = Debug|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Release|Any CPU.Build.0 = Release|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Release|ARM.ActiveCfg = Release|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Release|ARM.Build.0 = Release|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Release|iPhone.ActiveCfg = Release|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Release|iPhone.Build.0 = Release|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Release|x64.ActiveCfg = Release|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Release|x64.Build.0 = Release|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Release|x86.ActiveCfg = Release|Any CPU + {6591097A-342A-4EA0-AFF6-D2B3207F3E09}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ReactiveUI.Testing.Tests/ReactiveUI.Testing.Tests.csproj b/src/ReactiveUI.Testing.Tests/ReactiveUI.Testing.Tests.csproj new file mode 100644 index 0000000000..79162b61fd --- /dev/null +++ b/src/ReactiveUI.Testing.Tests/ReactiveUI.Testing.Tests.csproj @@ -0,0 +1,17 @@ + + + netcoreapp2.0 + $(TargetFrameworks);net461 + netstandard2.0 + $(TargetFramework) + + + + + + + + + + + diff --git a/src/ReactiveUI.Testing.Tests/TestFixture.cs b/src/ReactiveUI.Testing.Tests/TestFixture.cs new file mode 100644 index 0000000000..ab66321b2d --- /dev/null +++ b/src/ReactiveUI.Testing.Tests/TestFixture.cs @@ -0,0 +1,35 @@ +// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using System.Collections.Generic; + +namespace ReactiveUI.Testing.Tests +{ + /// + /// Test fixture. + /// + public class TestFixture + { + /// + /// Gets or sets the count. + /// + public int Count { get; set; } + + /// + /// Gets or sets the name. + /// + public string Name { get; set; } + + /// + /// Gets or sets the tests. + /// + public IEnumerable Tests { get; set; } + + /// + /// Gets or sets the variables. + /// + public Dictionary Variables { get; set; } + } +} diff --git a/src/ReactiveUI.Testing.Tests/TestFixtureBuilder.cs b/src/ReactiveUI.Testing.Tests/TestFixtureBuilder.cs new file mode 100644 index 0000000000..65e67133e4 --- /dev/null +++ b/src/ReactiveUI.Testing.Tests/TestFixtureBuilder.cs @@ -0,0 +1,85 @@ +// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using System.Collections.Generic; + +namespace ReactiveUI.Testing.Tests +{ + /// + /// An that constructs a . + /// + public class TestFixtureBuilder : IBuilder + { + private int _count; + private string _name; + private List _tests = new List(); + private Dictionary _variables = new Dictionary(); + + /// + /// Performs an implicit conversion from to . + /// + /// The builder. + /// The test fixture. + public static implicit operator TestFixture(TestFixtureBuilder builder) => builder.Build(); + + /// + /// Adds the count to the builder. + /// + /// The count. + /// The builder. + public TestFixtureBuilder WithCount(int count) => this.With(ref _count, count); + + /// + /// Adds the dictionary to the builder. + /// + /// The dictionary. + /// The builder. + public TestFixtureBuilder WithDictionary(Dictionary variables) => this.With(ref _variables, variables); + + /// + /// Adds the key value pair to the builder. + /// + /// The key value pair. + /// The builder. + public TestFixtureBuilder WithKeyValue(KeyValuePair keyValuePair) => this.With(ref _variables, keyValuePair); + + /// + /// Adds a key value pair to the builder. + /// + /// The key. + /// The value. + /// The builder. + public TestFixtureBuilder WithKeyValue(string key, string value) => this.With(ref _variables, key, value); + + /// + /// Adds a name to the builder. + /// + /// The name. + /// The builder. + public TestFixtureBuilder WithName(string name) => this.With(ref _name, name); + + /// + /// Adds a test to the builder. + /// + /// The test. + /// The builder. + public TestFixtureBuilder WithTest(string test) => this.With(ref _tests, test); + + /// + /// Adds tests to the builder. + /// + /// The tests. + /// The builder. + public TestFixtureBuilder WithTests(IEnumerable tests) => this.With(ref _tests, tests); + + private TestFixture Build() => new TestFixture + { + Name = _name, + Count = _count, + Tests = _tests, + Variables = _variables + }; + } +} diff --git a/src/ReactiveUI.Testing.Tests/TestFixtureBuilderExtensionTests.cs b/src/ReactiveUI.Testing.Tests/TestFixtureBuilderExtensionTests.cs new file mode 100644 index 0000000000..68b061126e --- /dev/null +++ b/src/ReactiveUI.Testing.Tests/TestFixtureBuilderExtensionTests.cs @@ -0,0 +1,167 @@ +// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using System.Collections.Generic; +using Shouldly; +using Xunit; + +namespace ReactiveUI.Testing.Tests +{ + /// + /// Test for . + /// + public sealed class TestFixtureBuilderExtensionTests + { + /// + /// Gets data for the test execution. + /// + public static IEnumerable Data => + new List + { + new object[] { "testing", string.Empty, string.Empty }, + new object[] { "testing", "testing", string.Empty }, + new object[] { "testing", "testing", "one" }, + new object[] { "testing", "one", "two" } + }; + + /// + /// Gets key value for the test execution. + /// + public static IEnumerable KeyValues => + new List + { + new object[] { "testing", string.Empty }, + new object[] { "testing", "one" }, + new object[] { "testing", "two" }, + new object[] { "testing", "one two" } + }; + + /// + /// Gets key value pairs for the test execution. + /// + public static IEnumerable KeyValuePairs => new List + { + new object[] { new KeyValuePair("latch", "key") }, + new object[] { new KeyValuePair("skeleton", "key") }, + new object[] { new KeyValuePair("electronic", "key") }, + new object[] { new KeyValuePair("rsa", "key") } + }; + + /// + /// A test to verify the a dictionary is added to the . + /// + [Fact] + public void Should_Add_Dictionary() + { + // Given, When + var dictionary = new Dictionary + { + { "check", "one" }, + { "testing", "two" } + }; + TestFixture builder = + new TestFixtureBuilder() + .WithDictionary(dictionary); + + // Then + builder.Variables.ShouldBe(dictionary); + Assert.Equal(dictionary, builder.Variables); + } + + /// + /// A test to verify the key value pairs are added to the . + /// + /// The key. + /// The value. + [Theory] + [MemberData(nameof(KeyValues))] + public void Should_Add_Key_Value(string key, string value) + { + // Given, When + TestFixture builder = new TestFixtureBuilder().WithKeyValue(key, value); + + // Then + builder.Variables[key].ShouldBe(value); + } + + /// + /// A test to verify the key value pairs are added to the . + /// + /// The key value pair. + [Theory] + [MemberData(nameof(KeyValuePairs))] + public void Should_Add_Key_Value_Pair(KeyValuePair keyValuePair) + { + // Given, When + TestFixture builder = new TestFixtureBuilder().WithKeyValue(keyValuePair); + + // Then + builder.Variables[keyValuePair.Key].ShouldBe(keyValuePair.Value); + } + + /// + /// A test to verify a range of values are added to the . + /// + /// The first test. + /// The second test. + /// The third test. + [Theory] + [MemberData(nameof(Data))] + public void Should_Add_Range_To_List(string test1, string test2, string test3) + { + // Given, When + TestFixture builder = new TestFixtureBuilder().WithTests(new[] { test1, test2, test3 }); + + // Then + builder.Tests.ShouldBe(new[] { test1, test2, test3 }); + } + + /// + /// A test to verify a value added to a list of tests on the . + /// + [Fact] + public void Should_Add_Value_To_List() + { + // Given, When + TestFixture builder = new TestFixtureBuilder().WithTest("testing"); + + // Then + builder.Tests.ShouldBe(new[] { "testing" }); + } + + /// + /// A test to verify the count. + /// + /// The count. + [Theory] + [InlineData(1)] + [InlineData(100)] + [InlineData(1000)] + [InlineData(10000)] + [InlineData(100000)] + public void Should_Return_Count(int count) + { + // Given, When + TestFixture builder = new TestFixtureBuilder().WithCount(count); + + // Then + builder.Count.ShouldBe(count); + } + + [Theory] + [InlineData("ReactiveUI")] + [InlineData("Splat")] + [InlineData("Sextant")] + [InlineData("Akavache")] + public void Should_Return_Name(string name) + { + // Given, When + TestFixture builder = new TestFixtureBuilder().WithName(name); + + // Then + builder.Name.ShouldBe(name); + } + } +} diff --git a/src/ReactiveUI.Testing/IBuilderExtensions.cs b/src/ReactiveUI.Testing/IBuilderExtensions.cs new file mode 100644 index 0000000000..a6beb9ff05 --- /dev/null +++ b/src/ReactiveUI.Testing/IBuilderExtensions.cs @@ -0,0 +1,144 @@ +// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using System.Collections.Generic; + +namespace ReactiveUI.Testing +{ +#pragma warning disable SA1402, SA1649, CA1040 + /// + /// An interface for building. + /// + public interface IBuilder + { + } + + /// + /// Default methods for the abstraction. + /// + public static class IBuilderExtensions + { + /// + /// Adds the specified field to the builder. + /// + /// The type of the builder. + /// The type of the field. + /// This builder. + /// The field. + /// The value. + /// The builder. + public static TBuilder With(this TBuilder builder, ref TField field, TField value) + where TBuilder : IBuilder + { + field = value; + return builder; + } + + /// + /// Adds the specified list of fields to the builder. + /// + /// The type of the builder. + /// The type of the field. + /// This builder. + /// The field. + /// The values. + /// The builder. + public static TBuilder With( + this TBuilder builder, + ref List field, + IEnumerable values) + where TBuilder : IBuilder + { + if (values == null) + { + field = null; + } + else + { + field.AddRange(values); + } + + return builder; + } + + /// + /// Adds the specified field to the builder. + /// + /// The type of the builder. + /// The type of the field. + /// This builder. + /// The field. + /// The value. + /// The builder. + public static TBuilder With(this TBuilder builder, ref List field, TField value) + where TBuilder : IBuilder + { + field.Add(value); + return builder; + } + + /// + /// Adds the specified key value pair to the provided dictionary. + /// + /// The type of the builder. + /// The type of the key. + /// The type of the field. + /// This builder. + /// The dictionary. + /// The key value pair. + /// The builder. + public static TBuilder With( + this TBuilder builder, + ref Dictionary dictionary, + KeyValuePair keyValuePair) + where TBuilder : IBuilder + { + dictionary.Add(keyValuePair.Key, keyValuePair.Value); + return builder; + } + + /// + /// Adds the specified key and value to the provided dictionary. + /// + /// The type of the builder. + /// The type of the key. + /// The type of the field. + /// This builder. + /// The dictionary. + /// The key. + /// The value. + /// The builder. + public static TBuilder With( + this TBuilder builder, + ref Dictionary dictionary, + TKey key, + TField value) + where TBuilder : IBuilder + { + dictionary.Add(key, value); + return builder; + } + + /// + /// Adds the specified dictionary to the provided dictionary. + /// + /// The type of the builder. + /// The type of the key. + /// The type of the field. + /// This builder. + /// The dictionary. + /// The key value pair. + /// The builder. + public static TBuilder With( + this TBuilder builder, + ref Dictionary dictionary, + IDictionary keyValuePair) + { + dictionary = (Dictionary)keyValuePair; + return builder; + } + } +#pragma warning restore SA1402, SA1649, CA1040 +} diff --git a/src/ReactiveUI.Testing/MessageBusExtensions.cs b/src/ReactiveUI.Testing/MessageBusExtensions.cs new file mode 100644 index 0000000000..5f9614d548 --- /dev/null +++ b/src/ReactiveUI.Testing/MessageBusExtensions.cs @@ -0,0 +1,69 @@ +// Copyright (c) 2019 .NET Foundation and Contributors. All rights reserved. +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for full license information. + +using System; +using System.Reactive.Disposables; +using System.Threading; + +namespace ReactiveUI.Testing +{ + /// + /// Message bus testing extensions. + /// + public static class MessageBusExtensions + { + private static readonly object mbGate = 42; + + /// + /// Override the default Message Bus during the specified block. + /// + /// The return type. + /// The message bus to use for the block. + /// The function to execute. + /// The return value of the function. + public static TRet With(this IMessageBus messageBus, Func block) + { + using (messageBus.WithMessageBus()) + { + return block(); + } + } + + /// + /// WithMessageBus allows you to override the default Message Bus + /// implementation until the object returned is disposed. If a + /// message bus is not specified, a default empty one is created. + /// + /// The message bus to use, or null to create + /// a new one using the default implementation. + /// An object that when disposed, restores the original + /// message bus. + public static IDisposable WithMessageBus(this IMessageBus messageBus) + { + var origMessageBus = MessageBus.Current; + + Monitor.Enter(mbGate); + MessageBus.Current = messageBus ?? new MessageBus(); + return Disposable.Create(() => + { + MessageBus.Current = origMessageBus; + Monitor.Exit(mbGate); + }); + } + + /// + /// Override the default Message Bus during the specified block. + /// + /// The message bus to use for the block. + /// The action to execute. + public static void With(this IMessageBus messageBus, Action block) + { + using (messageBus.WithMessageBus()) + { + block(); + } + } + } +} diff --git a/src/ReactiveUI.Testing/TestUtils.cs b/src/ReactiveUI.Testing/SchedulerExtensions.cs similarity index 81% rename from src/ReactiveUI.Testing/TestUtils.cs rename to src/ReactiveUI.Testing/SchedulerExtensions.cs index 023fa6c0d2..404423076f 100644 --- a/src/ReactiveUI.Testing/TestUtils.cs +++ b/src/ReactiveUI.Testing/SchedulerExtensions.cs @@ -15,11 +15,10 @@ namespace ReactiveUI.Testing { #pragma warning disable SA1600 // Elements should be documented - public static class TestUtils + public static class SchedulerExtensions #pragma warning restore SA1600 // Elements should be documented { private static readonly AutoResetEvent schedGate = new AutoResetEvent(true); - private static readonly object mbGate = 42; /// /// WithScheduler overrides the default Deferred and Taskpool schedulers @@ -47,28 +46,6 @@ public static IDisposable WithScheduler(IScheduler sched) }); } - /// - /// WithMessageBus allows you to override the default Message Bus - /// implementation until the object returned is disposed. If a - /// message bus is not specified, a default empty one is created. - /// - /// The message bus to use, or null to create - /// a new one using the default implementation. - /// An object that when disposed, restores the original - /// message bus. - public static IDisposable WithMessageBus(this IMessageBus messageBus) - { - var origMessageBus = MessageBus.Current; - - Monitor.Enter(mbGate); - MessageBus.Current = messageBus ?? new MessageBus(); - return Disposable.Create(() => - { - MessageBus.Current = origMessageBus; - Monitor.Exit(mbGate); - }); - } - /// /// With is an extension method that uses the given scheduler as the /// default Deferred and Taskpool schedulers for the given Func. Use @@ -150,34 +127,6 @@ public static Task WithAsync(this T sched, Func block) }); } - /// - /// Override the default Message Bus during the specified block. - /// - /// The return type. - /// The message bus to use for the block. - /// The function to execute. - /// The return value of the function. - public static TRet With(this IMessageBus messageBus, Func block) - { - using (messageBus.WithMessageBus()) - { - return block(); - } - } - - /// - /// Override the default Message Bus during the specified block. - /// - /// The message bus to use for the block. - /// The action to execute. - public static void With(this IMessageBus messageBus, Action block) - { - using (messageBus.WithMessageBus()) - { - block(); - } - } - /// /// AdvanceToMs moves the TestScheduler to the specified time in /// milliseconds. diff --git a/src/ReactiveUI.Tests/API/ApiApprovalTests.Testing.net461.approved.txt b/src/ReactiveUI.Tests/API/ApiApprovalTests.Testing.net461.approved.txt index 92b48a4a3d..517ff80fca 100644 --- a/src/ReactiveUI.Tests/API/ApiApprovalTests.Testing.net461.approved.txt +++ b/src/ReactiveUI.Tests/API/ApiApprovalTests.Testing.net461.approved.txt @@ -1,7 +1,28 @@ [assembly: System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.6.1", FrameworkDisplayName=".NET Framework 4.6.1")] namespace ReactiveUI.Testing { - public class static TestUtils + public interface IBuilder { } + public class static IBuilderExtensions + { + public static TBuilder With(this TBuilder builder, ref TField field, TField value) + where TBuilder : ReactiveUI.Testing.IBuilder { } + public static TBuilder With(this TBuilder builder, ref System.Collections.Generic.List<> field, System.Collections.Generic.IEnumerable values) + where TBuilder : ReactiveUI.Testing.IBuilder { } + public static TBuilder With(this TBuilder builder, ref System.Collections.Generic.List<> field, TField value) + where TBuilder : ReactiveUI.Testing.IBuilder { } + public static TBuilder With(this TBuilder builder, ref System.Collections.Generic.Dictionary<, > dictionary, System.Collections.Generic.KeyValuePair keyValuePair) + where TBuilder : ReactiveUI.Testing.IBuilder { } + public static TBuilder With(this TBuilder builder, ref System.Collections.Generic.Dictionary<, > dictionary, TKey key, TField value) + where TBuilder : ReactiveUI.Testing.IBuilder { } + public static TBuilder With(this TBuilder builder, ref System.Collections.Generic.Dictionary<, > dictionary, System.Collections.Generic.IDictionary keyValuePair) { } + } + public class static MessageBusExtensions + { + public static TRet With(this ReactiveUI.IMessageBus messageBus, System.Func block) { } + public static void With(this ReactiveUI.IMessageBus messageBus, System.Action block) { } + public static System.IDisposable WithMessageBus(this ReactiveUI.IMessageBus messageBus) { } + } + public class static SchedulerExtensions { public static void AdvanceByMs(this Microsoft.Reactive.Testing.TestScheduler sched, double milliseconds) { } public static void AdvanceToMs(this Microsoft.Reactive.Testing.TestScheduler sched, double milliseconds) { } @@ -13,13 +34,10 @@ namespace ReactiveUI.Testing where T : System.Reactive.Concurrency.IScheduler { } public static void With(this T sched, System.Action block) where T : System.Reactive.Concurrency.IScheduler { } - public static TRet With(this ReactiveUI.IMessageBus messageBus, System.Func block) { } - public static void With(this ReactiveUI.IMessageBus messageBus, System.Action block) { } public static System.Threading.Tasks.Task WithAsync(this T sched, System.Func> block) where T : System.Reactive.Concurrency.IScheduler { } public static System.Threading.Tasks.Task WithAsync(this T sched, System.Func block) where T : System.Reactive.Concurrency.IScheduler { } - public static System.IDisposable WithMessageBus(this ReactiveUI.IMessageBus messageBus) { } public static System.IDisposable WithScheduler(System.Reactive.Concurrency.IScheduler sched) { } } } \ No newline at end of file diff --git a/src/ReactiveUI.Tests/API/ApiApprovalTests.Testing.netcoreapp2.0.approved.txt b/src/ReactiveUI.Tests/API/ApiApprovalTests.Testing.netcoreapp2.0.approved.txt index 4a2e257408..af2f4a4878 100644 --- a/src/ReactiveUI.Tests/API/ApiApprovalTests.Testing.netcoreapp2.0.approved.txt +++ b/src/ReactiveUI.Tests/API/ApiApprovalTests.Testing.netcoreapp2.0.approved.txt @@ -1,7 +1,28 @@ [assembly: System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v2.0", FrameworkDisplayName="")] namespace ReactiveUI.Testing { - public class static TestUtils + public interface IBuilder { } + public class static IBuilderExtensions + { + public static TBuilder With(this TBuilder builder, ref TField field, TField value) + where TBuilder : ReactiveUI.Testing.IBuilder { } + public static TBuilder With(this TBuilder builder, ref System.Collections.Generic.List<> field, System.Collections.Generic.IEnumerable values) + where TBuilder : ReactiveUI.Testing.IBuilder { } + public static TBuilder With(this TBuilder builder, ref System.Collections.Generic.List<> field, TField value) + where TBuilder : ReactiveUI.Testing.IBuilder { } + public static TBuilder With(this TBuilder builder, ref System.Collections.Generic.Dictionary<, > dictionary, System.Collections.Generic.KeyValuePair keyValuePair) + where TBuilder : ReactiveUI.Testing.IBuilder { } + public static TBuilder With(this TBuilder builder, ref System.Collections.Generic.Dictionary<, > dictionary, TKey key, TField value) + where TBuilder : ReactiveUI.Testing.IBuilder { } + public static TBuilder With(this TBuilder builder, ref System.Collections.Generic.Dictionary<, > dictionary, System.Collections.Generic.IDictionary keyValuePair) { } + } + public class static MessageBusExtensions + { + public static TRet With(this ReactiveUI.IMessageBus messageBus, System.Func block) { } + public static void With(this ReactiveUI.IMessageBus messageBus, System.Action block) { } + public static System.IDisposable WithMessageBus(this ReactiveUI.IMessageBus messageBus) { } + } + public class static SchedulerExtensions { public static void AdvanceByMs(this Microsoft.Reactive.Testing.TestScheduler sched, double milliseconds) { } public static void AdvanceToMs(this Microsoft.Reactive.Testing.TestScheduler sched, double milliseconds) { } @@ -13,13 +34,10 @@ namespace ReactiveUI.Testing where T : System.Reactive.Concurrency.IScheduler { } public static void With(this T sched, System.Action block) where T : System.Reactive.Concurrency.IScheduler { } - public static TRet With(this ReactiveUI.IMessageBus messageBus, System.Func block) { } - public static void With(this ReactiveUI.IMessageBus messageBus, System.Action block) { } public static System.Threading.Tasks.Task WithAsync(this T sched, System.Func> block) where T : System.Reactive.Concurrency.IScheduler { } public static System.Threading.Tasks.Task WithAsync(this T sched, System.Func block) where T : System.Reactive.Concurrency.IScheduler { } - public static System.IDisposable WithMessageBus(this ReactiveUI.IMessageBus messageBus) { } public static System.IDisposable WithScheduler(System.Reactive.Concurrency.IScheduler sched) { } } } \ No newline at end of file diff --git a/src/ReactiveUI.Tests/API/ApiApprovalTests.cs b/src/ReactiveUI.Tests/API/ApiApprovalTests.cs index ccef8ee02e..ddccdbbcab 100644 --- a/src/ReactiveUI.Tests/API/ApiApprovalTests.cs +++ b/src/ReactiveUI.Tests/API/ApiApprovalTests.cs @@ -18,7 +18,7 @@ public class ApiApprovalTests : ApiApprovalBase [Fact] public void Testing() { - CheckApproval(typeof(Testing.TestUtils).Assembly); + CheckApproval(typeof(Testing.SchedulerExtensions).Assembly); } [Fact] diff --git a/src/ReactiveUI.sln b/src/ReactiveUI.sln index 9193af3007..f9c29ccc32 100644 --- a/src/ReactiveUI.sln +++ b/src/ReactiveUI.sln @@ -1,4 +1,4 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 +Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.26730.15 MinimumVisualStudioVersion = 10.0.40219.1 @@ -38,6 +38,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReactiveUI.Fody.Tests", "Re EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReactiveUI.Splat.Tests", "ReactiveUI.Splat.Tests\ReactiveUI.Splat.Tests.csproj", "{7ED6D69F-138F-40BD-9F37-3E4050E4D19B}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReactiveUI.Testing.Tests", "ReactiveUI.Testing.Tests\ReactiveUI.Testing.Tests.csproj", "{CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Ad-Hoc|Any CPU = Ad-Hoc|Any CPU @@ -758,6 +760,62 @@ Global {7ED6D69F-138F-40BD-9F37-3E4050E4D19B}.Release|x64.Build.0 = Release|Any CPU {7ED6D69F-138F-40BD-9F37-3E4050E4D19B}.Release|x86.ActiveCfg = Release|Any CPU {7ED6D69F-138F-40BD-9F37-3E4050E4D19B}.Release|x86.Build.0 = Release|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Ad-Hoc|Mixed Platforms.ActiveCfg = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Ad-Hoc|Mixed Platforms.Build.0 = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Ad-Hoc|x64.Build.0 = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Ad-Hoc|x86.Build.0 = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.AppStore|Any CPU.Build.0 = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.AppStore|ARM.ActiveCfg = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.AppStore|ARM.Build.0 = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.AppStore|iPhone.ActiveCfg = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.AppStore|iPhone.Build.0 = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.AppStore|Mixed Platforms.ActiveCfg = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.AppStore|Mixed Platforms.Build.0 = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.AppStore|x64.ActiveCfg = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.AppStore|x64.Build.0 = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.AppStore|x86.ActiveCfg = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.AppStore|x86.Build.0 = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Debug|ARM.ActiveCfg = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Debug|ARM.Build.0 = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Debug|iPhone.Build.0 = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Debug|x64.ActiveCfg = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Debug|x64.Build.0 = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Debug|x86.ActiveCfg = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Debug|x86.Build.0 = Debug|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Release|Any CPU.Build.0 = Release|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Release|ARM.ActiveCfg = Release|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Release|ARM.Build.0 = Release|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Release|iPhone.ActiveCfg = Release|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Release|iPhone.Build.0 = Release|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Release|x64.ActiveCfg = Release|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Release|x64.Build.0 = Release|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Release|x86.ActiveCfg = Release|Any CPU + {CD8B19A9-316E-4FBC-8F0C-87ADC6AAD684}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From a941bda455ee36a1bf56c8d8dc7106be31dc4e8d Mon Sep 17 00:00:00 2001 From: Glenn <5834289+glennawatson@users.noreply.github.com> Date: Tue, 7 May 2019 14:18:39 +1000 Subject: [PATCH 15/24] Update version.json --- version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.json b/version.json index 983607298e..e03f7d0f40 100644 --- a/version.json +++ b/version.json @@ -1,5 +1,5 @@ { - "version": "9.13", + "version": "9.14", "publicReleaseRefSpec": [ "^refs/heads/master$", // we release out of master "^refs/heads/develop$", // we release out of develop From f0b78c4648881422d27d9900f501c2a9f84e6a26 Mon Sep 17 00:00:00 2001 From: Artyom Date: Wed, 8 May 2019 14:55:26 +0300 Subject: [PATCH 16/24] fix: POCOObservableForProperty having a race condition (#2020) --- .../ObservableForProperty/POCOObservableForProperty.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ReactiveUI/ObservableForProperty/POCOObservableForProperty.cs b/src/ReactiveUI/ObservableForProperty/POCOObservableForProperty.cs index fb54ab0ffa..55fd028027 100644 --- a/src/ReactiveUI/ObservableForProperty/POCOObservableForProperty.cs +++ b/src/ReactiveUI/ObservableForProperty/POCOObservableForProperty.cs @@ -4,6 +4,7 @@ // See the LICENSE file in the project root for full license information. using System; +using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq.Expressions; using System.Reactive.Linq; @@ -18,7 +19,7 @@ namespace ReactiveUI /// public class POCOObservableForProperty : ICreatesObservableForProperty { - private static readonly Dictionary<(Type, string), bool> hasWarned = new Dictionary<(Type, string), bool>(); + private static readonly IDictionary<(Type, string), bool> hasWarned = new ConcurrentDictionary<(Type, string), bool>(); /// public int GetAffinityForObject(Type type, string propertyName, bool beforeChanged = false) From afdf520a8c5ee7f6bee053af61d7593fad93c2ce Mon Sep 17 00:00:00 2001 From: Glenn <5834289+glennawatson@users.noreply.github.com> Date: Sun, 12 May 2019 16:41:17 +1000 Subject: [PATCH 17/24] fix: WhenActivated not fired when in ViewModelViewHost (#2023) --- 4eac0733-0a64-4c41-a024-157e17e6276c.cake | 2 ++ src/ReactiveUI.Events.WPF/ReactiveUI.Events.WPF.csproj | 1 + .../ReactiveUI.Events.Winforms.csproj | 1 + src/ReactiveUI.Winforms/ReactiveUI.Winforms.csproj | 1 + src/ReactiveUI.Wpf/ReactiveUI.Wpf.csproj | 1 + 5 files changed, 6 insertions(+) create mode 100644 4eac0733-0a64-4c41-a024-157e17e6276c.cake diff --git a/4eac0733-0a64-4c41-a024-157e17e6276c.cake b/4eac0733-0a64-4c41-a024-157e17e6276c.cake new file mode 100644 index 0000000000..944cbe2555 --- /dev/null +++ b/4eac0733-0a64-4c41-a024-157e17e6276c.cake @@ -0,0 +1,2 @@ +#module nuget:?package=Cake.DotNetTool.Module&version=0.2.0 +#tool dotnet:?package=nbgv&version=2.3.125 diff --git a/src/ReactiveUI.Events.WPF/ReactiveUI.Events.WPF.csproj b/src/ReactiveUI.Events.WPF/ReactiveUI.Events.WPF.csproj index db7b5c8bf9..82be16bf7a 100644 --- a/src/ReactiveUI.Events.WPF/ReactiveUI.Events.WPF.csproj +++ b/src/ReactiveUI.Events.WPF/ReactiveUI.Events.WPF.csproj @@ -5,6 +5,7 @@ Provides Observable-based events API for WPF UI controls/eventhandlers. The contents of this package is automatically generated, please target pull-requests to the code generator. ReactiveUI.Events.WPF true + true $(NoWarn);CS1570;CA1812 diff --git a/src/ReactiveUI.Events.Winforms/ReactiveUI.Events.Winforms.csproj b/src/ReactiveUI.Events.Winforms/ReactiveUI.Events.Winforms.csproj index 86291fd3bf..0f708db9a0 100644 --- a/src/ReactiveUI.Events.Winforms/ReactiveUI.Events.Winforms.csproj +++ b/src/ReactiveUI.Events.Winforms/ReactiveUI.Events.Winforms.csproj @@ -6,6 +6,7 @@ Provides Observable-based events API for Winforms UI controls/eventhandlers. The contents of this package is automatically generated, please target pull-requests to the code generator. ReactiveUI.Events.Winforms true + true $(NoWarn);CS1570;CA1812 diff --git a/src/ReactiveUI.Winforms/ReactiveUI.Winforms.csproj b/src/ReactiveUI.Winforms/ReactiveUI.Winforms.csproj index 20a2476cf2..8e783dc7d4 100644 --- a/src/ReactiveUI.Winforms/ReactiveUI.Winforms.csproj +++ b/src/ReactiveUI.Winforms/ReactiveUI.Winforms.csproj @@ -7,6 +7,7 @@ Windows Forms specific extensions to ReactiveUI ReactiveUI.WinForms true + true diff --git a/src/ReactiveUI.Wpf/ReactiveUI.Wpf.csproj b/src/ReactiveUI.Wpf/ReactiveUI.Wpf.csproj index eeeb035b67..8a485de71e 100644 --- a/src/ReactiveUI.Wpf/ReactiveUI.Wpf.csproj +++ b/src/ReactiveUI.Wpf/ReactiveUI.Wpf.csproj @@ -4,6 +4,7 @@ WPF specific extensions to ReactiveUI ReactiveUI.WPF true + true From dfe84987fd9df8861316c600b2f6a2580996faba Mon Sep 17 00:00:00 2001 From: Glenn <5834289+glennawatson@users.noreply.github.com> Date: Mon, 13 May 2019 19:16:07 +1000 Subject: [PATCH 18/24] housekeeping: Update from ReactiveExtensions 4.0.0 to 4.1.5 (#2025) --- ...iveUI.Samples.Testing.SimpleViewModelsUnitTests.csproj | 2 +- src/Directory.build.props | 8 ++++---- src/ReactiveUI.Events.WPF/ReactiveUI.Events.WPF.csproj | 2 +- .../ReactiveUI.Events.Winforms.csproj | 2 +- .../ReactiveUI.Events.XamEssentials.csproj | 2 +- .../ReactiveUI.Events.XamForms.csproj | 2 +- src/ReactiveUI.Events/ReactiveUI.Events.csproj | 2 +- .../ReactiveUI.Fody.Helpers.csproj | 2 +- src/ReactiveUI.Testing/ReactiveUI.Testing.csproj | 2 +- src/ReactiveUI/ReactiveUI.csproj | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/samples/testing/ReactiveUI.Samples.Testing.SimpleViewModels/src/ReactiveUI.Samples.Testing.SimpleViewModels.Tests/ReactiveUI.Samples.Testing.SimpleViewModelsUnitTests.csproj b/samples/testing/ReactiveUI.Samples.Testing.SimpleViewModels/src/ReactiveUI.Samples.Testing.SimpleViewModels.Tests/ReactiveUI.Samples.Testing.SimpleViewModelsUnitTests.csproj index 6644f8d464..c5ffddf033 100644 --- a/samples/testing/ReactiveUI.Samples.Testing.SimpleViewModels/src/ReactiveUI.Samples.Testing.SimpleViewModels.Tests/ReactiveUI.Samples.Testing.SimpleViewModelsUnitTests.csproj +++ b/samples/testing/ReactiveUI.Samples.Testing.SimpleViewModels/src/ReactiveUI.Samples.Testing.SimpleViewModels.Tests/ReactiveUI.Samples.Testing.SimpleViewModelsUnitTests.csproj @@ -3,7 +3,7 @@ netcoreapp2.2;net461 - + diff --git a/src/Directory.build.props b/src/Directory.build.props index e6dff6f4db..b0e4deb9eb 100644 --- a/src/Directory.build.props +++ b/src/Directory.build.props @@ -27,13 +27,13 @@ - + - + - + @@ -58,7 +58,7 @@ - + diff --git a/src/ReactiveUI.Events.WPF/ReactiveUI.Events.WPF.csproj b/src/ReactiveUI.Events.WPF/ReactiveUI.Events.WPF.csproj index 82be16bf7a..b39539f464 100644 --- a/src/ReactiveUI.Events.WPF/ReactiveUI.Events.WPF.csproj +++ b/src/ReactiveUI.Events.WPF/ReactiveUI.Events.WPF.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/ReactiveUI.Events.Winforms/ReactiveUI.Events.Winforms.csproj b/src/ReactiveUI.Events.Winforms/ReactiveUI.Events.Winforms.csproj index 0f708db9a0..cc2914e4da 100644 --- a/src/ReactiveUI.Events.Winforms/ReactiveUI.Events.Winforms.csproj +++ b/src/ReactiveUI.Events.Winforms/ReactiveUI.Events.Winforms.csproj @@ -14,7 +14,7 @@ - + diff --git a/src/ReactiveUI.Events.XamEssentials/ReactiveUI.Events.XamEssentials.csproj b/src/ReactiveUI.Events.XamEssentials/ReactiveUI.Events.XamEssentials.csproj index 01a67d0663..90574acfef 100644 --- a/src/ReactiveUI.Events.XamEssentials/ReactiveUI.Events.XamEssentials.csproj +++ b/src/ReactiveUI.Events.XamEssentials/ReactiveUI.Events.XamEssentials.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/ReactiveUI.Events.XamForms/ReactiveUI.Events.XamForms.csproj b/src/ReactiveUI.Events.XamForms/ReactiveUI.Events.XamForms.csproj index 1e51832966..955b8ae905 100644 --- a/src/ReactiveUI.Events.XamForms/ReactiveUI.Events.XamForms.csproj +++ b/src/ReactiveUI.Events.XamForms/ReactiveUI.Events.XamForms.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/ReactiveUI.Events/ReactiveUI.Events.csproj b/src/ReactiveUI.Events/ReactiveUI.Events.csproj index 3b7cac72a4..836ec679c0 100644 --- a/src/ReactiveUI.Events/ReactiveUI.Events.csproj +++ b/src/ReactiveUI.Events/ReactiveUI.Events.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj b/src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj index 5dcb8d151d..1803341f0a 100644 --- a/src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj +++ b/src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj @@ -16,7 +16,7 @@ - + diff --git a/src/ReactiveUI.Testing/ReactiveUI.Testing.csproj b/src/ReactiveUI.Testing/ReactiveUI.Testing.csproj index 26ba93cf0e..c5d3abf429 100644 --- a/src/ReactiveUI.Testing/ReactiveUI.Testing.csproj +++ b/src/ReactiveUI.Testing/ReactiveUI.Testing.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/ReactiveUI/ReactiveUI.csproj b/src/ReactiveUI/ReactiveUI.csproj index ca8b047c24..6dc37dd017 100644 --- a/src/ReactiveUI/ReactiveUI.csproj +++ b/src/ReactiveUI/ReactiveUI.csproj @@ -11,7 +11,7 @@ - + From 3cf59aba88d4e14aa94c5f19264d8d47d8db77bd Mon Sep 17 00:00:00 2001 From: Glenn <5834289+glennawatson@users.noreply.github.com> Date: Mon, 13 May 2019 20:13:30 +1000 Subject: [PATCH 19/24] fix: WhenActivated on WPF by reverting to MsBuild.Sdk.Extras 1.6.18 (#2027) --- src/ReactiveUI.Events/ReactiveUI.Events.csproj | 6 ++++++ .../wpf/API/ApiApprovalTests.Wpf.net461.approved.txt | 12 ++++++++++++ src/global.json | 2 +- version.json | 2 +- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/ReactiveUI.Events/ReactiveUI.Events.csproj b/src/ReactiveUI.Events/ReactiveUI.Events.csproj index 836ec679c0..31596662f7 100644 --- a/src/ReactiveUI.Events/ReactiveUI.Events.csproj +++ b/src/ReactiveUI.Events/ReactiveUI.Events.csproj @@ -17,6 +17,12 @@ + + Windows Desktop Extensions for the UWP + + + Windows Mobile Extensions for the UWP + diff --git a/src/ReactiveUI.Tests/Platforms/wpf/API/ApiApprovalTests.Wpf.net461.approved.txt b/src/ReactiveUI.Tests/Platforms/wpf/API/ApiApprovalTests.Wpf.net461.approved.txt index 1fd8a824c2..61423593e4 100644 --- a/src/ReactiveUI.Tests/Platforms/wpf/API/ApiApprovalTests.Wpf.net461.approved.txt +++ b/src/ReactiveUI.Tests/Platforms/wpf/API/ApiApprovalTests.Wpf.net461.approved.txt @@ -121,4 +121,16 @@ namespace ReactiveUI.Wpf public Registrations() { } public void Register(System.Action, System.Type> registerFunction) { } } +} +namespace XamlGeneratedNamespace +{ + public sealed class GeneratedInternalTypeHelper : System.Windows.Markup.InternalTypeHelper + { + public GeneratedInternalTypeHelper() { } + protected override void AddEventHandler(System.Reflection.EventInfo eventInfo, object target, System.Delegate handler) { } + protected override System.Delegate CreateDelegate(System.Type delegateType, object target, string handler) { } + protected override object CreateInstance(System.Type type, System.Globalization.CultureInfo culture) { } + protected override object GetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, System.Globalization.CultureInfo culture) { } + protected override void SetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, object value, System.Globalization.CultureInfo culture) { } + } } \ No newline at end of file diff --git a/src/global.json b/src/global.json index ddab91af6c..1e4edb34a6 100644 --- a/src/global.json +++ b/src/global.json @@ -1,5 +1,5 @@ { "msbuild-sdks": { - "MSBuild.Sdk.Extras": "2.0.24" + "MSBuild.Sdk.Extras": "1.6.68" } } diff --git a/version.json b/version.json index e03f7d0f40..75a1e504c3 100644 --- a/version.json +++ b/version.json @@ -1,5 +1,5 @@ { - "version": "9.14", + "version": "9.15", "publicReleaseRefSpec": [ "^refs/heads/master$", // we release out of master "^refs/heads/develop$", // we release out of develop From 97d1aa3780f79f933933befda79666b27a83a76b Mon Sep 17 00:00:00 2001 From: Artyom Date: Mon, 13 May 2019 14:30:14 +0300 Subject: [PATCH 20/24] Add Universal Windows routing example (#2030) --- samples/uwp/ReactiveUI.UwpRouting.sln | 51 +++++ samples/uwp/ReactiveUI.UwpRouting/App.xaml | 5 + samples/uwp/ReactiveUI.UwpRouting/App.xaml.cs | 33 ++++ .../Assets/LockScreenLogo.scale-200.png | 3 + .../Assets/SplashScreen.scale-200.png | 3 + .../Assets/Square150x150Logo.scale-200.png | 3 + .../Assets/Square44x44Logo.scale-200.png | 3 + ...x44Logo.targetsize-24_altform-unplated.png | 3 + .../Assets/StoreLogo.png | 3 + .../Assets/Wide310x150Logo.scale-200.png | 3 + .../Package.appxmanifest | 49 +++++ .../Properties/AssemblyInfo.cs | 29 +++ .../Properties/Default.rd.xml | 31 +++ .../ReactiveUI.UwpRouting.csproj | 181 ++++++++++++++++++ .../ViewModels/FirstViewModel.cs | 15 ++ .../ViewModels/MainViewModel.cs | 39 ++++ .../Views/FirstView.xaml | 16 ++ .../Views/FirstView.xaml.cs | 30 +++ .../ReactiveUI.UwpRouting/Views/MainView.xaml | 19 ++ .../Views/MainView.xaml.cs | 31 +++ 20 files changed, 550 insertions(+) create mode 100644 samples/uwp/ReactiveUI.UwpRouting.sln create mode 100644 samples/uwp/ReactiveUI.UwpRouting/App.xaml create mode 100644 samples/uwp/ReactiveUI.UwpRouting/App.xaml.cs create mode 100644 samples/uwp/ReactiveUI.UwpRouting/Assets/LockScreenLogo.scale-200.png create mode 100644 samples/uwp/ReactiveUI.UwpRouting/Assets/SplashScreen.scale-200.png create mode 100644 samples/uwp/ReactiveUI.UwpRouting/Assets/Square150x150Logo.scale-200.png create mode 100644 samples/uwp/ReactiveUI.UwpRouting/Assets/Square44x44Logo.scale-200.png create mode 100644 samples/uwp/ReactiveUI.UwpRouting/Assets/Square44x44Logo.targetsize-24_altform-unplated.png create mode 100644 samples/uwp/ReactiveUI.UwpRouting/Assets/StoreLogo.png create mode 100644 samples/uwp/ReactiveUI.UwpRouting/Assets/Wide310x150Logo.scale-200.png create mode 100644 samples/uwp/ReactiveUI.UwpRouting/Package.appxmanifest create mode 100644 samples/uwp/ReactiveUI.UwpRouting/Properties/AssemblyInfo.cs create mode 100644 samples/uwp/ReactiveUI.UwpRouting/Properties/Default.rd.xml create mode 100644 samples/uwp/ReactiveUI.UwpRouting/ReactiveUI.UwpRouting.csproj create mode 100644 samples/uwp/ReactiveUI.UwpRouting/ViewModels/FirstViewModel.cs create mode 100644 samples/uwp/ReactiveUI.UwpRouting/ViewModels/MainViewModel.cs create mode 100644 samples/uwp/ReactiveUI.UwpRouting/Views/FirstView.xaml create mode 100644 samples/uwp/ReactiveUI.UwpRouting/Views/FirstView.xaml.cs create mode 100644 samples/uwp/ReactiveUI.UwpRouting/Views/MainView.xaml create mode 100644 samples/uwp/ReactiveUI.UwpRouting/Views/MainView.xaml.cs diff --git a/samples/uwp/ReactiveUI.UwpRouting.sln b/samples/uwp/ReactiveUI.UwpRouting.sln new file mode 100644 index 0000000000..f5624f7e8d --- /dev/null +++ b/samples/uwp/ReactiveUI.UwpRouting.sln @@ -0,0 +1,51 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.489 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReactiveUI.UwpRouting", "ReactiveUI.UwpRouting\ReactiveUI.UwpRouting.csproj", "{702CB6D2-A9E0-40A4-A64D-BAACC63893A8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM = Debug|ARM + Debug|ARM64 = Debug|ARM64 + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|ARM = Release|ARM + Release|ARM64 = Release|ARM64 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {702CB6D2-A9E0-40A4-A64D-BAACC63893A8}.Debug|ARM.ActiveCfg = Debug|ARM + {702CB6D2-A9E0-40A4-A64D-BAACC63893A8}.Debug|ARM.Build.0 = Debug|ARM + {702CB6D2-A9E0-40A4-A64D-BAACC63893A8}.Debug|ARM.Deploy.0 = Debug|ARM + {702CB6D2-A9E0-40A4-A64D-BAACC63893A8}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {702CB6D2-A9E0-40A4-A64D-BAACC63893A8}.Debug|ARM64.Build.0 = Debug|ARM64 + {702CB6D2-A9E0-40A4-A64D-BAACC63893A8}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {702CB6D2-A9E0-40A4-A64D-BAACC63893A8}.Debug|x64.ActiveCfg = Debug|x64 + {702CB6D2-A9E0-40A4-A64D-BAACC63893A8}.Debug|x64.Build.0 = Debug|x64 + {702CB6D2-A9E0-40A4-A64D-BAACC63893A8}.Debug|x64.Deploy.0 = Debug|x64 + {702CB6D2-A9E0-40A4-A64D-BAACC63893A8}.Debug|x86.ActiveCfg = Debug|x86 + {702CB6D2-A9E0-40A4-A64D-BAACC63893A8}.Debug|x86.Build.0 = Debug|x86 + {702CB6D2-A9E0-40A4-A64D-BAACC63893A8}.Debug|x86.Deploy.0 = Debug|x86 + {702CB6D2-A9E0-40A4-A64D-BAACC63893A8}.Release|ARM.ActiveCfg = Release|ARM + {702CB6D2-A9E0-40A4-A64D-BAACC63893A8}.Release|ARM.Build.0 = Release|ARM + {702CB6D2-A9E0-40A4-A64D-BAACC63893A8}.Release|ARM.Deploy.0 = Release|ARM + {702CB6D2-A9E0-40A4-A64D-BAACC63893A8}.Release|ARM64.ActiveCfg = Release|ARM64 + {702CB6D2-A9E0-40A4-A64D-BAACC63893A8}.Release|ARM64.Build.0 = Release|ARM64 + {702CB6D2-A9E0-40A4-A64D-BAACC63893A8}.Release|ARM64.Deploy.0 = Release|ARM64 + {702CB6D2-A9E0-40A4-A64D-BAACC63893A8}.Release|x64.ActiveCfg = Release|x64 + {702CB6D2-A9E0-40A4-A64D-BAACC63893A8}.Release|x64.Build.0 = Release|x64 + {702CB6D2-A9E0-40A4-A64D-BAACC63893A8}.Release|x64.Deploy.0 = Release|x64 + {702CB6D2-A9E0-40A4-A64D-BAACC63893A8}.Release|x86.ActiveCfg = Release|x86 + {702CB6D2-A9E0-40A4-A64D-BAACC63893A8}.Release|x86.Build.0 = Release|x86 + {702CB6D2-A9E0-40A4-A64D-BAACC63893A8}.Release|x86.Deploy.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7F4403AB-47C8-4125-8E65-DC8E07DBDA1E} + EndGlobalSection +EndGlobal diff --git a/samples/uwp/ReactiveUI.UwpRouting/App.xaml b/samples/uwp/ReactiveUI.UwpRouting/App.xaml new file mode 100644 index 0000000000..5d3b064472 --- /dev/null +++ b/samples/uwp/ReactiveUI.UwpRouting/App.xaml @@ -0,0 +1,5 @@ + + diff --git a/samples/uwp/ReactiveUI.UwpRouting/App.xaml.cs b/samples/uwp/ReactiveUI.UwpRouting/App.xaml.cs new file mode 100644 index 0000000000..3b952c8bf5 --- /dev/null +++ b/samples/uwp/ReactiveUI.UwpRouting/App.xaml.cs @@ -0,0 +1,33 @@ +using System; +using Windows.ApplicationModel.Activation; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Navigation; +using ReactiveUI.UwpRouting.Views; + +namespace ReactiveUI.UwpRouting +{ + public sealed partial class App : Application + { + public App() => InitializeComponent(); + + protected override void OnLaunched(LaunchActivatedEventArgs e) + { + if (!(Window.Current.Content is Frame rootFrame)) + { + rootFrame = new Frame(); + rootFrame.NavigationFailed += OnNavigationFailed; + Window.Current.Content = rootFrame; + } + + if (e.PrelaunchActivated != false) return; + if (rootFrame.Content == null) rootFrame.Navigate(typeof(MainView), e.Arguments); + Window.Current.Activate(); + } + + private static void OnNavigationFailed(object sender, NavigationFailedEventArgs e) + { + throw new Exception("Failed to load Page " + e.SourcePageType.FullName); + } + } +} diff --git a/samples/uwp/ReactiveUI.UwpRouting/Assets/LockScreenLogo.scale-200.png b/samples/uwp/ReactiveUI.UwpRouting/Assets/LockScreenLogo.scale-200.png new file mode 100644 index 0000000000..8cf1cc0297 --- /dev/null +++ b/samples/uwp/ReactiveUI.UwpRouting/Assets/LockScreenLogo.scale-200.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a41a053b3fc3b0c109720ccd437a19725ae9163ea75990222a12b596b9c7ca76 +size 1430 diff --git a/samples/uwp/ReactiveUI.UwpRouting/Assets/SplashScreen.scale-200.png b/samples/uwp/ReactiveUI.UwpRouting/Assets/SplashScreen.scale-200.png new file mode 100644 index 0000000000..1ade290fb9 --- /dev/null +++ b/samples/uwp/ReactiveUI.UwpRouting/Assets/SplashScreen.scale-200.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3382b0b1b834e95b888f06d483dc2d78fa1b3855e0683d5cfbd5167be9731a6 +size 7700 diff --git a/samples/uwp/ReactiveUI.UwpRouting/Assets/Square150x150Logo.scale-200.png b/samples/uwp/ReactiveUI.UwpRouting/Assets/Square150x150Logo.scale-200.png new file mode 100644 index 0000000000..f269619be8 --- /dev/null +++ b/samples/uwp/ReactiveUI.UwpRouting/Assets/Square150x150Logo.scale-200.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f3cb5738e8f05544445f79996a313f8b47dee22dbc9c7be859d2707710f0c73 +size 2937 diff --git a/samples/uwp/ReactiveUI.UwpRouting/Assets/Square44x44Logo.scale-200.png b/samples/uwp/ReactiveUI.UwpRouting/Assets/Square44x44Logo.scale-200.png new file mode 100644 index 0000000000..818d96d80a --- /dev/null +++ b/samples/uwp/ReactiveUI.UwpRouting/Assets/Square44x44Logo.scale-200.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:594492a25070951d7462c091d9f899a66f55ba992bb9b05d98d50f67cdfb2abe +size 1647 diff --git a/samples/uwp/ReactiveUI.UwpRouting/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/samples/uwp/ReactiveUI.UwpRouting/Assets/Square44x44Logo.targetsize-24_altform-unplated.png new file mode 100644 index 0000000000..8c010282f4 --- /dev/null +++ b/samples/uwp/ReactiveUI.UwpRouting/Assets/Square44x44Logo.targetsize-24_altform-unplated.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48cf9c22156a0b3d77982641f972785e7861a7257f7bcf155be7d5a12e1aa3d8 +size 1255 diff --git a/samples/uwp/ReactiveUI.UwpRouting/Assets/StoreLogo.png b/samples/uwp/ReactiveUI.UwpRouting/Assets/StoreLogo.png new file mode 100644 index 0000000000..679f7d7461 --- /dev/null +++ b/samples/uwp/ReactiveUI.UwpRouting/Assets/StoreLogo.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae95e99a96251abaf8de15c9cdaddb8cefb1b8b320b10a4f1f4e1dc3c25c1b1a +size 1451 diff --git a/samples/uwp/ReactiveUI.UwpRouting/Assets/Wide310x150Logo.scale-200.png b/samples/uwp/ReactiveUI.UwpRouting/Assets/Wide310x150Logo.scale-200.png new file mode 100644 index 0000000000..7578982624 --- /dev/null +++ b/samples/uwp/ReactiveUI.UwpRouting/Assets/Wide310x150Logo.scale-200.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b5b7754832c08e58faacfe64ea4b9f8b59b52a658e4eea4aab3790cfb89faa03 +size 3204 diff --git a/samples/uwp/ReactiveUI.UwpRouting/Package.appxmanifest b/samples/uwp/ReactiveUI.UwpRouting/Package.appxmanifest new file mode 100644 index 0000000000..eb37fd2af9 --- /dev/null +++ b/samples/uwp/ReactiveUI.UwpRouting/Package.appxmanifest @@ -0,0 +1,49 @@ + + + + + + + + + + ReactiveUI.UwpRouting + prizr + Assets\StoreLogo.png + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/uwp/ReactiveUI.UwpRouting/Properties/AssemblyInfo.cs b/samples/uwp/ReactiveUI.UwpRouting/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..73eef03c56 --- /dev/null +++ b/samples/uwp/ReactiveUI.UwpRouting/Properties/AssemblyInfo.cs @@ -0,0 +1,29 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ReactiveUI.UwpRouting")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ReactiveUI.UwpRouting")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: ComVisible(false)] \ No newline at end of file diff --git a/samples/uwp/ReactiveUI.UwpRouting/Properties/Default.rd.xml b/samples/uwp/ReactiveUI.UwpRouting/Properties/Default.rd.xml new file mode 100644 index 0000000000..af00722cdf --- /dev/null +++ b/samples/uwp/ReactiveUI.UwpRouting/Properties/Default.rd.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/uwp/ReactiveUI.UwpRouting/ReactiveUI.UwpRouting.csproj b/samples/uwp/ReactiveUI.UwpRouting/ReactiveUI.UwpRouting.csproj new file mode 100644 index 0000000000..eb2cc216d5 --- /dev/null +++ b/samples/uwp/ReactiveUI.UwpRouting/ReactiveUI.UwpRouting.csproj @@ -0,0 +1,181 @@ + + + + + Debug + x86 + {702CB6D2-A9E0-40A4-A64D-BAACC63893A8} + AppContainerExe + Properties + ReactiveUI.UwpRouting + ReactiveUI.UwpRouting + en-US + UAP + 10.0.17763.0 + 10.0.17763.0 + 14 + 512 + {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + true + ReactiveUI.UwpRouting_TemporaryKey.pfx + + + true + bin\x86\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + x86 + false + prompt + true + + + bin\x86\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + x86 + false + prompt + true + true + + + true + bin\ARM\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + ARM + false + prompt + true + + + bin\ARM\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + ARM + false + prompt + true + true + + + true + bin\ARM64\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + ARM64 + false + prompt + true + true + + + bin\ARM64\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + ARM64 + false + prompt + true + true + + + true + bin\x64\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + x64 + false + prompt + true + + + bin\x64\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + x64 + false + prompt + true + true + + + PackageReference + + + + App.xaml + + + + + + FirstView.xaml + + + MainView.xaml + + + + + Designer + + + + + + + + + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + + + 6.2.8 + + + 9.15.1 + + + + 14.0 + + + + \ No newline at end of file diff --git a/samples/uwp/ReactiveUI.UwpRouting/ViewModels/FirstViewModel.cs b/samples/uwp/ReactiveUI.UwpRouting/ViewModels/FirstViewModel.cs new file mode 100644 index 0000000000..f0cb835f3f --- /dev/null +++ b/samples/uwp/ReactiveUI.UwpRouting/ViewModels/FirstViewModel.cs @@ -0,0 +1,15 @@ +using System; + +namespace ReactiveUI.UwpRouting.ViewModels +{ + public class FirstViewModel : ReactiveObject, IRoutableViewModel + { + // Reference to IScreen that owns the routable view model. + public IScreen HostScreen { get; } + + // Unique identifier for the routable view model. + public string UrlPathSegment { get; } = Guid.NewGuid().ToString().Substring(0, 5); + + public FirstViewModel(IScreen screen) => HostScreen = screen; + } +} diff --git a/samples/uwp/ReactiveUI.UwpRouting/ViewModels/MainViewModel.cs b/samples/uwp/ReactiveUI.UwpRouting/ViewModels/MainViewModel.cs new file mode 100644 index 0000000000..62e3ffabcd --- /dev/null +++ b/samples/uwp/ReactiveUI.UwpRouting/ViewModels/MainViewModel.cs @@ -0,0 +1,39 @@ +using System.Reactive; +using ReactiveUI.UwpRouting.Views; +using Splat; + +namespace ReactiveUI.UwpRouting.ViewModels +{ + public class MainViewModel : ReactiveObject, IScreen + { + // The Router associated with this Screen. + // Required by the IScreen interface. + public RoutingState Router { get; } = new RoutingState(); + + // The command that navigates a user to first view model. + public ReactiveCommand GoNext { get; } + + // The command that navigates a user back. + public ReactiveCommand GoBack => Router.NavigateBack; + + public MainViewModel() + { + // Router uses Splat.Locator to resolve views for + // view models, so we need to register our views + // using Locator.CurrentMutable.Register* methods. + // + Locator.CurrentMutable.Register(() => new FirstView(), typeof(IViewFor)); + + // Manage the routing state. Use the Router.Navigate.Execute + // command to navigate to different view models. + // + // Note, that the Navigate.Execute method accepts an instance + // of a view model, this allows you to pass parameters to + // your view models, or to reuse existing view models. + // + GoNext = ReactiveCommand.CreateFromObservable( + () => Router.Navigate.Execute(new FirstViewModel(this)) + ); + } + } +} diff --git a/samples/uwp/ReactiveUI.UwpRouting/Views/FirstView.xaml b/samples/uwp/ReactiveUI.UwpRouting/Views/FirstView.xaml new file mode 100644 index 0000000000..53fecbb525 --- /dev/null +++ b/samples/uwp/ReactiveUI.UwpRouting/Views/FirstView.xaml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + diff --git a/samples/uwp/ReactiveUI.UwpRouting/Views/FirstView.xaml.cs b/samples/uwp/ReactiveUI.UwpRouting/Views/FirstView.xaml.cs new file mode 100644 index 0000000000..dc1470a19f --- /dev/null +++ b/samples/uwp/ReactiveUI.UwpRouting/Views/FirstView.xaml.cs @@ -0,0 +1,30 @@ +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using ReactiveUI.UwpRouting.ViewModels; + +namespace ReactiveUI.UwpRouting.Views +{ + public sealed partial class FirstView : UserControl, IViewFor + { + public static readonly DependencyProperty ViewModelProperty = DependencyProperty + .Register(nameof(ViewModel), typeof(FirstViewModel), typeof(FirstView), null); + + public FirstView() + { + InitializeComponent(); + this.WhenActivated(disposables => { }); + } + + public FirstViewModel ViewModel + { + get => (FirstViewModel)GetValue(ViewModelProperty); + set => SetValue(ViewModelProperty, value); + } + + object IViewFor.ViewModel + { + get => ViewModel; + set => ViewModel = (FirstViewModel)value; + } + } +} diff --git a/samples/uwp/ReactiveUI.UwpRouting/Views/MainView.xaml b/samples/uwp/ReactiveUI.UwpRouting/Views/MainView.xaml new file mode 100644 index 0000000000..7fa82a804f --- /dev/null +++ b/samples/uwp/ReactiveUI.UwpRouting/Views/MainView.xaml @@ -0,0 +1,19 @@ + + + + + + + + +