From 2fd232393809b655e99a6a543c9ac090701f6776 Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Mon, 9 Dec 2019 16:28:14 +1100 Subject: [PATCH 1/5] refactor: Remove the weak event managers --- .../Properties/AndroidManifest.xml | 6 +- .../ReactiveUI.Android.Tests.csproj | 1 - .../ReactiveAppCompatActivity.cs | 16 +- .../ReactiveDialogFragment.cs | 16 +- .../ReactiveFragment.cs | 16 +- .../ReactiveFragmentActivity.cs | 16 +- .../ReactiveRecyclerViewViewHolder.cs | 16 +- .../ReactiveAppCompatActivity.cs | 16 +- .../ReactiveDialogFragment.cs | 4 +- src/ReactiveUI.AndroidX/ReactiveFragment.cs | 4 +- .../ReactiveFragmentActivity.cs | 4 +- .../ReactiveRecyclerViewViewHolder.cs | 4 +- src/ReactiveUI.Winforms/RoutedViewHost.cs | 16 +- src/ReactiveUI.Winforms/ViewModelViewHost.cs | 16 +- .../CanExecuteChangedEventManager.cs | 16 - .../PropertyChangedEventManager.cs | 15 - .../PropertyChangingEventManager.cs | 15 - .../EventManagers/WeakEventManager.cs | 385 ------------------ .../Platforms/android/ReactiveActivity.cs | 16 +- .../Platforms/android/ReactiveFragment.cs | 16 +- .../android/ReactivePreferenceActivity.cs | 16 +- .../android/ReactivePreferenceFragment.cs | 16 +- .../Platforms/android/ReactiveViewHost.cs | 16 +- .../Platforms/apple-common/ReactiveControl.cs | 16 +- .../apple-common/ReactiveImageView.cs | 16 +- .../ReactiveSplitViewController.cs | 16 +- .../Platforms/apple-common/ReactiveView.cs | 16 +- .../apple-common/ReactiveViewController.cs | 16 +- .../uikit-common/ReactiveCollectionView.cs | 16 +- .../ReactiveCollectionViewCell.cs | 16 +- .../ReactiveCollectionViewController.cs | 16 +- .../ReactiveCollectionViewSource.cs | 16 +- .../ReactiveNavigationController.cs | 16 +- .../ReactivePageViewController.cs | 16 +- .../uikit-common/ReactiveTabBarController.cs | 16 +- .../uikit-common/ReactiveTableView.cs | 16 +- .../uikit-common/ReactiveTableViewCell.cs | 16 +- .../ReactiveTableViewController.cs | 16 +- .../uikit-common/ReactiveTableViewSource.cs | 16 +- .../ReactiveObject/ReactiveObject.cs | 24 -- 40 files changed, 127 insertions(+), 815 deletions(-) delete mode 100644 src/ReactiveUI/EventManagers/CanExecuteChangedEventManager.cs delete mode 100644 src/ReactiveUI/EventManagers/PropertyChangedEventManager.cs delete mode 100644 src/ReactiveUI/EventManagers/PropertyChangingEventManager.cs delete mode 100644 src/ReactiveUI/EventManagers/WeakEventManager.cs diff --git a/src/ReactiveUI.Android.Tests/Properties/AndroidManifest.xml b/src/ReactiveUI.Android.Tests/Properties/AndroidManifest.xml index 7bafff66a5..f5a07e6f1c 100644 --- a/src/ReactiveUI.Android.Tests/Properties/AndroidManifest.xml +++ b/src/ReactiveUI.Android.Tests/Properties/AndroidManifest.xml @@ -1,5 +1,5 @@  - - - + + + \ No newline at end of file diff --git a/src/ReactiveUI.Android.Tests/ReactiveUI.Android.Tests.csproj b/src/ReactiveUI.Android.Tests/ReactiveUI.Android.Tests.csproj index 4b488e3c30..79babac030 100644 --- a/src/ReactiveUI.Android.Tests/ReactiveUI.Android.Tests.csproj +++ b/src/ReactiveUI.Android.Tests/ReactiveUI.Android.Tests.csproj @@ -17,7 +17,6 @@ Resources\Resource.designer.cs Resource Off - false v9.0 Properties\AndroidManifest.xml Resources diff --git a/src/ReactiveUI.AndroidSupport/ReactiveAppCompatActivity.cs b/src/ReactiveUI.AndroidSupport/ReactiveAppCompatActivity.cs index db915c5598..0dfdf0580a 100644 --- a/src/ReactiveUI.AndroidSupport/ReactiveAppCompatActivity.cs +++ b/src/ReactiveUI.AndroidSupport/ReactiveAppCompatActivity.cs @@ -80,18 +80,10 @@ protected ReactiveAppCompatActivity(IntPtr handle, JniHandleOwnership ownership) } /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// public IObservable> Changing => this.GetChangingObservable(); @@ -129,13 +121,13 @@ public event PropertyChangedEventHandler PropertyChanged /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } /// diff --git a/src/ReactiveUI.AndroidSupport/ReactiveDialogFragment.cs b/src/ReactiveUI.AndroidSupport/ReactiveDialogFragment.cs index d8918b7ad9..800b5c08a0 100644 --- a/src/ReactiveUI.AndroidSupport/ReactiveDialogFragment.cs +++ b/src/ReactiveUI.AndroidSupport/ReactiveDialogFragment.cs @@ -63,18 +63,10 @@ protected ReactiveDialogFragment() } /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// public IObservable ThrownExceptions => this.GetThrownExceptionsObservable(); @@ -98,13 +90,13 @@ public event PropertyChangedEventHandler PropertyChanged /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } /// diff --git a/src/ReactiveUI.AndroidSupport/ReactiveFragment.cs b/src/ReactiveUI.AndroidSupport/ReactiveFragment.cs index 961965d468..c74f8b67c4 100644 --- a/src/ReactiveUI.AndroidSupport/ReactiveFragment.cs +++ b/src/ReactiveUI.AndroidSupport/ReactiveFragment.cs @@ -81,18 +81,10 @@ protected ReactiveFragment() } /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// public IObservable ThrownExceptions => this.GetThrownExceptionsObservable(); @@ -116,13 +108,13 @@ public event PropertyChangedEventHandler PropertyChanged /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } /// diff --git a/src/ReactiveUI.AndroidSupport/ReactiveFragmentActivity.cs b/src/ReactiveUI.AndroidSupport/ReactiveFragmentActivity.cs index 5b1ce60997..d41b15b168 100644 --- a/src/ReactiveUI.AndroidSupport/ReactiveFragmentActivity.cs +++ b/src/ReactiveUI.AndroidSupport/ReactiveFragmentActivity.cs @@ -77,18 +77,10 @@ public class ReactiveFragmentActivity : FragmentActivity, IReactiveObject, IReac private readonly Subject<(int requestCode, Result result, Intent intent)> _activityResult = new Subject<(int requestCode, Result result, Intent intent)>(); /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// public IObservable> Changing => this.GetChangingObservable(); @@ -117,13 +109,13 @@ public event PropertyChangedEventHandler PropertyChanged /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } /// diff --git a/src/ReactiveUI.AndroidSupport/ReactiveRecyclerViewViewHolder.cs b/src/ReactiveUI.AndroidSupport/ReactiveRecyclerViewViewHolder.cs index 319602da6f..b984e447bb 100644 --- a/src/ReactiveUI.AndroidSupport/ReactiveRecyclerViewViewHolder.cs +++ b/src/ReactiveUI.AndroidSupport/ReactiveRecyclerViewViewHolder.cs @@ -80,18 +80,10 @@ protected ReactiveRecyclerViewViewHolder(View view) } /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// /// Gets an observable that signals that this ViewHolder has been selected. @@ -174,13 +166,13 @@ public bool AreChangeNotificationsEnabled() /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } [OnDeserialized] diff --git a/src/ReactiveUI.AndroidX/ReactiveAppCompatActivity.cs b/src/ReactiveUI.AndroidX/ReactiveAppCompatActivity.cs index 14238bf8d6..7097e67686 100644 --- a/src/ReactiveUI.AndroidX/ReactiveAppCompatActivity.cs +++ b/src/ReactiveUI.AndroidX/ReactiveAppCompatActivity.cs @@ -80,18 +80,10 @@ protected ReactiveAppCompatActivity(IntPtr handle, JniHandleOwnership ownership) } /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// public IObservable> Changing => this.GetChangingObservable(); @@ -129,13 +121,13 @@ public event PropertyChangedEventHandler PropertyChanged /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } /// diff --git a/src/ReactiveUI.AndroidX/ReactiveDialogFragment.cs b/src/ReactiveUI.AndroidX/ReactiveDialogFragment.cs index 7fa446328d..66603244d4 100644 --- a/src/ReactiveUI.AndroidX/ReactiveDialogFragment.cs +++ b/src/ReactiveUI.AndroidX/ReactiveDialogFragment.cs @@ -98,13 +98,13 @@ public event PropertyChangedEventHandler PropertyChanged /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } /// diff --git a/src/ReactiveUI.AndroidX/ReactiveFragment.cs b/src/ReactiveUI.AndroidX/ReactiveFragment.cs index 98b579f195..53669369c9 100644 --- a/src/ReactiveUI.AndroidX/ReactiveFragment.cs +++ b/src/ReactiveUI.AndroidX/ReactiveFragment.cs @@ -98,13 +98,13 @@ public event PropertyChangedEventHandler PropertyChanged /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } /// diff --git a/src/ReactiveUI.AndroidX/ReactiveFragmentActivity.cs b/src/ReactiveUI.AndroidX/ReactiveFragmentActivity.cs index 6e63d188d6..c220cb8c69 100644 --- a/src/ReactiveUI.AndroidX/ReactiveFragmentActivity.cs +++ b/src/ReactiveUI.AndroidX/ReactiveFragmentActivity.cs @@ -102,13 +102,13 @@ public event PropertyChangedEventHandler PropertyChanged /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } /// diff --git a/src/ReactiveUI.AndroidX/ReactiveRecyclerViewViewHolder.cs b/src/ReactiveUI.AndroidX/ReactiveRecyclerViewViewHolder.cs index b21a5a7d4e..38942b7c94 100644 --- a/src/ReactiveUI.AndroidX/ReactiveRecyclerViewViewHolder.cs +++ b/src/ReactiveUI.AndroidX/ReactiveRecyclerViewViewHolder.cs @@ -174,13 +174,13 @@ public bool AreChangeNotificationsEnabled() /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } [OnDeserialized] diff --git a/src/ReactiveUI.Winforms/RoutedViewHost.cs b/src/ReactiveUI.Winforms/RoutedViewHost.cs index a2d7c18fb8..7f068d1a2d 100644 --- a/src/ReactiveUI.Winforms/RoutedViewHost.cs +++ b/src/ReactiveUI.Winforms/RoutedViewHost.cs @@ -82,18 +82,10 @@ public RoutedControlHost() } /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// /// Gets or sets the default content. @@ -139,13 +131,13 @@ public IObservable ViewContractObservable /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } /// diff --git a/src/ReactiveUI.Winforms/ViewModelViewHost.cs b/src/ReactiveUI.Winforms/ViewModelViewHost.cs index 1c23b44046..a91343daad 100644 --- a/src/ReactiveUI.Winforms/ViewModelViewHost.cs +++ b/src/ReactiveUI.Winforms/ViewModelViewHost.cs @@ -40,18 +40,10 @@ public ViewModelControlHost() } /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// /// Gets or sets a value indicating whether [default cache views enabled]. @@ -131,13 +123,13 @@ public bool CacheViews /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } /// diff --git a/src/ReactiveUI/EventManagers/CanExecuteChangedEventManager.cs b/src/ReactiveUI/EventManagers/CanExecuteChangedEventManager.cs deleted file mode 100644 index e3bd8f9827..0000000000 --- a/src/ReactiveUI/EventManagers/CanExecuteChangedEventManager.cs +++ /dev/null @@ -1,16 +0,0 @@ -// 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.Windows.Input; - -namespace ReactiveUI -{ -#if !NET_461 - internal class CanExecuteChangedEventManager : WeakEventManager - { - } -#endif -} diff --git a/src/ReactiveUI/EventManagers/PropertyChangedEventManager.cs b/src/ReactiveUI/EventManagers/PropertyChangedEventManager.cs deleted file mode 100644 index 7dc4bb5e5b..0000000000 --- a/src/ReactiveUI/EventManagers/PropertyChangedEventManager.cs +++ /dev/null @@ -1,15 +0,0 @@ -// 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.ComponentModel; - -namespace ReactiveUI -{ -#if !NET_461 - internal class PropertyChangedEventManager : WeakEventManager - { - } -#endif -} diff --git a/src/ReactiveUI/EventManagers/PropertyChangingEventManager.cs b/src/ReactiveUI/EventManagers/PropertyChangingEventManager.cs deleted file mode 100644 index a64573fc48..0000000000 --- a/src/ReactiveUI/EventManagers/PropertyChangingEventManager.cs +++ /dev/null @@ -1,15 +0,0 @@ -// 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.ComponentModel; - -namespace ReactiveUI -{ -#if !NET_461 - internal class PropertyChangingEventManager : WeakEventManager - { - } -#endif -} diff --git a/src/ReactiveUI/EventManagers/WeakEventManager.cs b/src/ReactiveUI/EventManagers/WeakEventManager.cs deleted file mode 100644 index 59589fa2a0..0000000000 --- a/src/ReactiveUI/EventManagers/WeakEventManager.cs +++ /dev/null @@ -1,385 +0,0 @@ -// 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.Collections.Generic; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Linq; -using System.Reactive.Disposables; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using System.Windows.Input; - -namespace ReactiveUI -{ - /// - /// WeakEventManager base class. Inspired by the WPF WeakEventManager class and the code in - /// http://social.msdn.microsoft.com/Forums/silverlight/en-US/34d85c3f-52ea-4adc-bb32-8297f5549042/command-binding-memory-leak?forum=silverlightbugs. - /// - /// The type of the event source. - /// The type of the event handler. - /// The type of the event arguments. - public class WeakEventManager - where TEventSource : class - where TEventHandler : class - { - private static readonly object StaticSource = new object(); - - private static readonly Lazy> current = - new Lazy>(() => new WeakEventManager()); - - /// - /// Mapping between the target of the delegate (for example a Button) and the handler (EventHandler). - /// Windows Phone needs this, otherwise the event handler gets garbage collected. - /// - private readonly ConditionalWeakTable> _targetToEventHandler = new ConditionalWeakTable>(); - - /// - /// Mapping from the source of the event to the list of handlers. This is a CWT to ensure it does not leak the source of the event. - /// - private readonly ConditionalWeakTable _sourceToWeakHandlers = new ConditionalWeakTable(); - - /// - /// Initializes a new instance of the class. - /// Protected to disallow instances of this class and force a subclass. - /// - protected WeakEventManager() - { - } - - private static WeakEventManager Current => current.Value; - - /// - /// Adds a weak reference to the handler and associates it with the source. - /// - /// The source. - /// The handler. - public static void AddHandler(TEventSource source, TEventHandler handler) - { - if (source == null) - { - throw new ArgumentNullException(nameof(source)); - } - - if (handler == null) - { - throw new ArgumentNullException(nameof(handler)); - } - - if (!typeof(TEventHandler).GetTypeInfo().IsSubclassOf(typeof(Delegate))) - { - throw new ArgumentException("Handler must be Delegate type"); - } - - Current.PrivateAddHandler(source, handler); - } - - /// - /// Removes the association between the source and the handler. - /// - /// The source. - /// The handler. - public static void RemoveHandler(TEventSource source, TEventHandler handler) - { - if (source == null) - { - throw new ArgumentNullException(nameof(source)); - } - - if (handler == null) - { - throw new ArgumentNullException(nameof(handler)); - } - - if (!typeof(TEventHandler).GetTypeInfo().IsSubclassOf(typeof(Delegate))) - { - throw new ArgumentException("handler must be Delegate type"); - } - - Current.PrivateRemoveHandler(source, handler); - } - - /// - /// Delivers the event to the handlers registered for the source. - /// - /// The sender. - /// The arguments instance containing the event data. - public static void DeliverEvent(TEventSource sender, TEventArgs args) - { - Current.PrivateDeliverEvent(sender, args); - } - - /// - /// Override this method to attach to an event. - /// - /// The source. - protected virtual void StartListening(object source) - { - } - - /// - /// Override this method to detach from an event. - /// - /// The source. - protected virtual void StopListening(object source) - { - } - - private void PrivateAddHandler(TEventSource source, TEventHandler handler) - { - AddWeakHandler(source, handler); - AddTargetHandler(handler); - } - - private void AddWeakHandler(TEventSource source, TEventHandler handler) - { - if (_sourceToWeakHandlers.TryGetValue(source, out var weakHandlers)) - { - // clone list if we are currently delivering an event - if (weakHandlers.IsDeliverActive) - { - weakHandlers = weakHandlers.Clone(); - _sourceToWeakHandlers.Remove(source); - _sourceToWeakHandlers.Add(source, weakHandlers); - } - - weakHandlers.AddWeakHandler(source, handler); - } - else - { - weakHandlers = new WeakHandlerList(); - weakHandlers.AddWeakHandler(source, handler); - - _sourceToWeakHandlers.Add(source, weakHandlers); - StartListening(source); - } - - Purge(source); - } - - private void AddTargetHandler(TEventHandler handler) - { - var @delegate = handler as Delegate; - object key = @delegate.Target ?? StaticSource; - - if (_targetToEventHandler.TryGetValue(key, out var delegates)) - { - delegates.Add(@delegate); - } - else - { - delegates = new List - { - @delegate, - }; - - _targetToEventHandler.Add(key, delegates); - } - } - - private void PrivateRemoveHandler(TEventSource source, TEventHandler handler) - { - RemoveWeakHandler(source, handler); - RemoveTargetHandler(handler); - } - - private void RemoveWeakHandler(TEventSource source, TEventHandler handler) - { - if (_sourceToWeakHandlers.TryGetValue(source, out var weakHandlers)) - { - // clone list if we are currently delivering an event - if (weakHandlers.IsDeliverActive) - { - weakHandlers = weakHandlers.Clone(); - _sourceToWeakHandlers.Remove(source); - _sourceToWeakHandlers.Add(source, weakHandlers); - } - - if (weakHandlers.RemoveWeakHandler(source, handler) && weakHandlers.Count == 0) - { - _sourceToWeakHandlers.Remove(source); - StopListening(source); - } - } - } - - private void RemoveTargetHandler(TEventHandler handler) - { - var @delegate = handler as Delegate; - object key = @delegate?.Target ?? StaticSource; - - if (_targetToEventHandler.TryGetValue(key, out var delegates)) - { - delegates.Remove(@delegate); - - if (delegates.Count == 0) - { - _targetToEventHandler.Remove(key); - } - } - } - - private void PrivateDeliverEvent(object sender, TEventArgs args) - { - object source = sender != null ? sender : StaticSource; - - bool hasStaleEntries = false; - - if (_sourceToWeakHandlers.TryGetValue(source, out var weakHandlers)) - { - using (weakHandlers.DeliverActive()) - { - hasStaleEntries = weakHandlers.DeliverEvent(source, args); - } - } - - if (hasStaleEntries) - { - Purge(source); - } - } - - private void Purge(object source) - { - if (_sourceToWeakHandlers.TryGetValue(source, out var weakHandlers)) - { - if (weakHandlers.IsDeliverActive) - { - weakHandlers = weakHandlers.Clone(); - _sourceToWeakHandlers.Remove(source); - _sourceToWeakHandlers.Add(source, weakHandlers); - } - else - { - weakHandlers.Purge(); - } - } - } - - internal class WeakHandler - { - private readonly WeakReference _source; - private readonly WeakReference _originalHandler; - - public WeakHandler(object source, TEventHandler originalHandler) - { - _source = new WeakReference(source); - _originalHandler = new WeakReference(originalHandler); - } - - public bool IsActive => _source != null && _source.IsAlive && _originalHandler != null && _originalHandler.IsAlive; - - public TEventHandler Handler - { - get - { - if (_originalHandler == null) - { - return default(TEventHandler); - } - - return (TEventHandler)_originalHandler.Target; - } - } - - public bool Matches(object source, TEventHandler handler) - { - return _source != null && - ReferenceEquals(_source.Target, source) && - _originalHandler != null && - (ReferenceEquals(_originalHandler.Target, handler) || - (_originalHandler.Target is PropertyChangedEventHandler eventHandler && - handler is PropertyChangedEventHandler && - Equals( - eventHandler.Target, - (handler as PropertyChangedEventHandler)?.Target))); - } - } - - internal class WeakHandlerList - { - private readonly List _handlers; - private int _deliveries; - - public WeakHandlerList() - { - _handlers = new List(); - } - - public int Count => _handlers.Count; - - public bool IsDeliverActive => _deliveries > 0; - - public void AddWeakHandler(TEventSource source, TEventHandler handler) - { - WeakHandler handlerSink = new WeakHandler(source, handler); - _handlers.Add(handlerSink); - } - - public bool RemoveWeakHandler(TEventSource source, TEventHandler handler) - { - foreach (var weakHandler in _handlers) - { - if (weakHandler.Matches(source, handler)) - { - return _handlers.Remove(weakHandler); - } - } - - return false; - } - - public WeakHandlerList Clone() - { - WeakHandlerList newList = new WeakHandlerList(); - newList._handlers.AddRange(_handlers.Where(h => h.IsActive)); - - return newList; - } - - public IDisposable DeliverActive() - { - Interlocked.Increment(ref _deliveries); - - return Disposable.Create(() => Interlocked.Decrement(ref _deliveries)); - } - - public virtual bool DeliverEvent(object sender, TEventArgs args) - { - bool hasStaleEntries = false; - - foreach (var handler in _handlers) - { - if (handler.IsActive) - { - var @delegate = handler.Handler as Delegate; - @delegate?.DynamicInvoke(sender, args); - } - else - { - hasStaleEntries = true; - } - } - - return hasStaleEntries; - } - - public void Purge() - { - for (int i = _handlers.Count - 1; i >= 0; i--) - { - if (!_handlers[i].IsActive) - { - _handlers.RemoveAt(i); - } - } - } - } - } -} diff --git a/src/ReactiveUI/Platforms/android/ReactiveActivity.cs b/src/ReactiveUI/Platforms/android/ReactiveActivity.cs index 5b30fb514e..dad9fe4003 100644 --- a/src/ReactiveUI/Platforms/android/ReactiveActivity.cs +++ b/src/ReactiveUI/Platforms/android/ReactiveActivity.cs @@ -90,18 +90,10 @@ protected ReactiveActivity(IntPtr handle, JniHandleOwnership ownership) } /// - public event PropertyChangingEventHandler PropertyChanging - { - add { PropertyChangingEventManager.AddHandler(this, value); } - remove { PropertyChangingEventManager.RemoveHandler(this, value); } - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add { PropertyChangedEventManager.AddHandler(this, value); } - remove { PropertyChangedEventManager.RemoveHandler(this, value); } - } + public event PropertyChangedEventHandler PropertyChanged; /// public IObservable> Changing @@ -148,13 +140,13 @@ public IObservable> Changed /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } /// diff --git a/src/ReactiveUI/Platforms/android/ReactiveFragment.cs b/src/ReactiveUI/Platforms/android/ReactiveFragment.cs index 81d3a0c88b..87a9141c77 100644 --- a/src/ReactiveUI/Platforms/android/ReactiveFragment.cs +++ b/src/ReactiveUI/Platforms/android/ReactiveFragment.cs @@ -85,18 +85,10 @@ protected ReactiveFragment(IntPtr handle, JniHandleOwnership ownership) } /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// public IObservable> Changing => this.GetChangingObservable(); @@ -126,13 +118,13 @@ public event PropertyChangedEventHandler PropertyChanged /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } /// diff --git a/src/ReactiveUI/Platforms/android/ReactivePreferenceActivity.cs b/src/ReactiveUI/Platforms/android/ReactivePreferenceActivity.cs index f9564bef33..a37f21248b 100644 --- a/src/ReactiveUI/Platforms/android/ReactivePreferenceActivity.cs +++ b/src/ReactiveUI/Platforms/android/ReactivePreferenceActivity.cs @@ -90,18 +90,10 @@ protected ReactivePreferenceActivity(IntPtr handle, JniHandleOwnership ownership } /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// public IObservable> Changing => this.GetChangingObservable(); @@ -148,13 +140,13 @@ public event PropertyChangedEventHandler PropertyChanged /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } /// diff --git a/src/ReactiveUI/Platforms/android/ReactivePreferenceFragment.cs b/src/ReactiveUI/Platforms/android/ReactivePreferenceFragment.cs index 49f643e1a8..1c1e220cab 100644 --- a/src/ReactiveUI/Platforms/android/ReactivePreferenceFragment.cs +++ b/src/ReactiveUI/Platforms/android/ReactivePreferenceFragment.cs @@ -85,18 +85,10 @@ protected ReactivePreferenceFragment(IntPtr handle, JniHandleOwnership ownership } /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// public IObservable> Changing => this.GetChangingObservable(); @@ -123,13 +115,13 @@ public event PropertyChangedEventHandler PropertyChanged /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// diff --git a/src/ReactiveUI/Platforms/android/ReactiveViewHost.cs b/src/ReactiveUI/Platforms/android/ReactiveViewHost.cs index dffee432b5..b7c88a7a4e 100644 --- a/src/ReactiveUI/Platforms/android/ReactiveViewHost.cs +++ b/src/ReactiveUI/Platforms/android/ReactiveViewHost.cs @@ -55,18 +55,10 @@ protected ReactiveViewHost() } /// - public event PropertyChangedEventHandler PropertyChanged - { - add { PropertyChangedEventManager.AddHandler(this, value); } - remove { PropertyChangedEventManager.RemoveHandler(this, value); } - } + public event PropertyChangedEventHandler PropertyChanged; /// - public event PropertyChangingEventHandler PropertyChanging - { - add { PropertyChangingEventManager.AddHandler(this, value); } - remove { PropertyChangingEventManager.RemoveHandler(this, value); } - } + public event PropertyChangingEventHandler PropertyChanging; /// public TViewModel ViewModel @@ -129,13 +121,13 @@ public bool AreChangeNotificationsEnabled() /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } [OnDeserialized] diff --git a/src/ReactiveUI/Platforms/apple-common/ReactiveControl.cs b/src/ReactiveUI/Platforms/apple-common/ReactiveControl.cs index 0ff40e8f9b..d4cadd9081 100644 --- a/src/ReactiveUI/Platforms/apple-common/ReactiveControl.cs +++ b/src/ReactiveUI/Platforms/apple-common/ReactiveControl.cs @@ -77,18 +77,10 @@ protected ReactiveControl(IntPtr handle) } /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// public IObservable> Changing => this.GetChangingObservable(); @@ -139,13 +131,13 @@ void ICanForceManualActivation.Activate(bool activate) /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } /// diff --git a/src/ReactiveUI/Platforms/apple-common/ReactiveImageView.cs b/src/ReactiveUI/Platforms/apple-common/ReactiveImageView.cs index e2c012ec0d..28055676ed 100644 --- a/src/ReactiveUI/Platforms/apple-common/ReactiveImageView.cs +++ b/src/ReactiveUI/Platforms/apple-common/ReactiveImageView.cs @@ -100,18 +100,10 @@ protected ReactiveImageView(IntPtr handle) } /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// public IObservable ThrownExceptions => this.GetThrownExceptionsObservable(); @@ -135,13 +127,13 @@ public event PropertyChangedEventHandler PropertyChanged /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } /// diff --git a/src/ReactiveUI/Platforms/apple-common/ReactiveSplitViewController.cs b/src/ReactiveUI/Platforms/apple-common/ReactiveSplitViewController.cs index 11d4e77b4e..a8ac3e99cd 100644 --- a/src/ReactiveUI/Platforms/apple-common/ReactiveSplitViewController.cs +++ b/src/ReactiveUI/Platforms/apple-common/ReactiveSplitViewController.cs @@ -79,18 +79,10 @@ protected ReactiveSplitViewController() } /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// public IObservable> Changing => this.GetChangingObservable(); @@ -110,13 +102,13 @@ public event PropertyChangedEventHandler PropertyChanged /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } /// diff --git a/src/ReactiveUI/Platforms/apple-common/ReactiveView.cs b/src/ReactiveUI/Platforms/apple-common/ReactiveView.cs index c0aa6be0d2..88291f1cc7 100644 --- a/src/ReactiveUI/Platforms/apple-common/ReactiveView.cs +++ b/src/ReactiveUI/Platforms/apple-common/ReactiveView.cs @@ -77,18 +77,10 @@ protected ReactiveView(CGRect frame) } /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// public IObservable ThrownExceptions => this.GetThrownExceptionsObservable(); @@ -108,13 +100,13 @@ public event PropertyChangedEventHandler PropertyChanged /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } /// diff --git a/src/ReactiveUI/Platforms/apple-common/ReactiveViewController.cs b/src/ReactiveUI/Platforms/apple-common/ReactiveViewController.cs index de500defba..5bfb518420 100644 --- a/src/ReactiveUI/Platforms/apple-common/ReactiveViewController.cs +++ b/src/ReactiveUI/Platforms/apple-common/ReactiveViewController.cs @@ -77,18 +77,10 @@ protected ReactiveViewController(string nibNameOrNull, NSBundle nibBundleOrNull) } /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// public IObservable> Changing => this.GetChangingObservable(); @@ -108,13 +100,13 @@ public event PropertyChangedEventHandler PropertyChanged /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } /// diff --git a/src/ReactiveUI/Platforms/uikit-common/ReactiveCollectionView.cs b/src/ReactiveUI/Platforms/uikit-common/ReactiveCollectionView.cs index 785cb8a18c..1187a8ce95 100644 --- a/src/ReactiveUI/Platforms/uikit-common/ReactiveCollectionView.cs +++ b/src/ReactiveUI/Platforms/uikit-common/ReactiveCollectionView.cs @@ -65,18 +65,10 @@ protected ReactiveCollectionView(NSCoder coder) } /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// public IObservable> Changing => this.GetChangingObservable(); @@ -122,13 +114,13 @@ public override void RemoveFromSuperview() /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } /// diff --git a/src/ReactiveUI/Platforms/uikit-common/ReactiveCollectionViewCell.cs b/src/ReactiveUI/Platforms/uikit-common/ReactiveCollectionViewCell.cs index ba0667aa41..412fbd69e1 100644 --- a/src/ReactiveUI/Platforms/uikit-common/ReactiveCollectionViewCell.cs +++ b/src/ReactiveUI/Platforms/uikit-common/ReactiveCollectionViewCell.cs @@ -72,18 +72,10 @@ protected ReactiveCollectionViewCell(IntPtr handle) } /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// public IObservable> Changing => this.GetChangingObservable(); @@ -103,13 +95,13 @@ public event PropertyChangedEventHandler PropertyChanged /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } /// diff --git a/src/ReactiveUI/Platforms/uikit-common/ReactiveCollectionViewController.cs b/src/ReactiveUI/Platforms/uikit-common/ReactiveCollectionViewController.cs index 1d64e3ccf5..0606587953 100644 --- a/src/ReactiveUI/Platforms/uikit-common/ReactiveCollectionViewController.cs +++ b/src/ReactiveUI/Platforms/uikit-common/ReactiveCollectionViewController.cs @@ -80,18 +80,10 @@ protected ReactiveCollectionViewController() } /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// public IObservable> Changing => this.GetChangingObservable(); @@ -111,13 +103,13 @@ public event PropertyChangedEventHandler PropertyChanged /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } /// diff --git a/src/ReactiveUI/Platforms/uikit-common/ReactiveCollectionViewSource.cs b/src/ReactiveUI/Platforms/uikit-common/ReactiveCollectionViewSource.cs index d6f1c75a94..3235623b7d 100644 --- a/src/ReactiveUI/Platforms/uikit-common/ReactiveCollectionViewSource.cs +++ b/src/ReactiveUI/Platforms/uikit-common/ReactiveCollectionViewSource.cs @@ -62,18 +62,10 @@ public ReactiveCollectionViewSource(UICollectionView collectionView) } /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// /// Gets or sets the data that should be displayed by this @@ -170,13 +162,13 @@ public object ItemAt(NSIndexPath indexPath) /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } /// diff --git a/src/ReactiveUI/Platforms/uikit-common/ReactiveNavigationController.cs b/src/ReactiveUI/Platforms/uikit-common/ReactiveNavigationController.cs index 5569664a50..3d04838bf7 100644 --- a/src/ReactiveUI/Platforms/uikit-common/ReactiveNavigationController.cs +++ b/src/ReactiveUI/Platforms/uikit-common/ReactiveNavigationController.cs @@ -89,18 +89,10 @@ protected ReactiveNavigationController() } /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// public IObservable> Changing => this.GetChangingObservable(); @@ -120,13 +112,13 @@ public event PropertyChangedEventHandler PropertyChanged /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } /// diff --git a/src/ReactiveUI/Platforms/uikit-common/ReactivePageViewController.cs b/src/ReactiveUI/Platforms/uikit-common/ReactivePageViewController.cs index 7b91b6d093..b4ee5b7c75 100644 --- a/src/ReactiveUI/Platforms/uikit-common/ReactivePageViewController.cs +++ b/src/ReactiveUI/Platforms/uikit-common/ReactivePageViewController.cs @@ -114,18 +114,10 @@ protected ReactivePageViewController() } /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// public IObservable> Changing => this.GetChangingObservable(); @@ -145,13 +137,13 @@ public event PropertyChangedEventHandler PropertyChanged /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } /// diff --git a/src/ReactiveUI/Platforms/uikit-common/ReactiveTabBarController.cs b/src/ReactiveUI/Platforms/uikit-common/ReactiveTabBarController.cs index 8fbdfb1bdf..d7e881effa 100644 --- a/src/ReactiveUI/Platforms/uikit-common/ReactiveTabBarController.cs +++ b/src/ReactiveUI/Platforms/uikit-common/ReactiveTabBarController.cs @@ -70,18 +70,10 @@ protected ReactiveTabBarController() } /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// public IObservable> Changing => this.GetChangingObservable(); @@ -129,13 +121,13 @@ public override void ViewDidDisappear(bool animated) /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } /// diff --git a/src/ReactiveUI/Platforms/uikit-common/ReactiveTableView.cs b/src/ReactiveUI/Platforms/uikit-common/ReactiveTableView.cs index f90ec96373..b5022f9714 100644 --- a/src/ReactiveUI/Platforms/uikit-common/ReactiveTableView.cs +++ b/src/ReactiveUI/Platforms/uikit-common/ReactiveTableView.cs @@ -81,18 +81,10 @@ protected ReactiveTableView(IntPtr handle) } /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// public IObservable> Changing => this.GetChangingObservable(); @@ -112,13 +104,13 @@ public event PropertyChangedEventHandler PropertyChanged /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } /// diff --git a/src/ReactiveUI/Platforms/uikit-common/ReactiveTableViewCell.cs b/src/ReactiveUI/Platforms/uikit-common/ReactiveTableViewCell.cs index af30ff5cbc..ab8b6d1a9a 100644 --- a/src/ReactiveUI/Platforms/uikit-common/ReactiveTableViewCell.cs +++ b/src/ReactiveUI/Platforms/uikit-common/ReactiveTableViewCell.cs @@ -92,18 +92,10 @@ protected ReactiveTableViewCell(IntPtr handle) } /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// public IObservable> Changing => this.GetChangingObservable(); @@ -142,13 +134,13 @@ public override void WillMoveToSuperview(UIView newsuper) /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } /// diff --git a/src/ReactiveUI/Platforms/uikit-common/ReactiveTableViewController.cs b/src/ReactiveUI/Platforms/uikit-common/ReactiveTableViewController.cs index 3c7065d796..2d208130a5 100644 --- a/src/ReactiveUI/Platforms/uikit-common/ReactiveTableViewController.cs +++ b/src/ReactiveUI/Platforms/uikit-common/ReactiveTableViewController.cs @@ -80,18 +80,10 @@ protected ReactiveTableViewController() } /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// public IObservable> Changing => this.GetChangingObservable(); @@ -139,13 +131,13 @@ public override void ViewDidDisappear(bool animated) /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } /// diff --git a/src/ReactiveUI/Platforms/uikit-common/ReactiveTableViewSource.cs b/src/ReactiveUI/Platforms/uikit-common/ReactiveTableViewSource.cs index 34c0561c3c..cf782c2c7c 100644 --- a/src/ReactiveUI/Platforms/uikit-common/ReactiveTableViewSource.cs +++ b/src/ReactiveUI/Platforms/uikit-common/ReactiveTableViewSource.cs @@ -61,18 +61,10 @@ public ReactiveTableViewSource(UITableView tableView) } /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// /// Gets or sets the data that should be displayed by this @@ -311,13 +303,13 @@ public IDisposable SuppressChangeNotifications() /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) { - PropertyChangingEventManager.DeliverEvent(this, args); + PropertyChanging?.Invoke(this, args); } /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) { - PropertyChangedEventManager.DeliverEvent(this, args); + PropertyChanged?.Invoke(this, args); } /// diff --git a/src/ReactiveUI/ReactiveObject/ReactiveObject.cs b/src/ReactiveUI/ReactiveObject/ReactiveObject.cs index 7e661b78c8..a0100a1ddb 100644 --- a/src/ReactiveUI/ReactiveObject/ReactiveObject.cs +++ b/src/ReactiveUI/ReactiveObject/ReactiveObject.cs @@ -32,27 +32,11 @@ public ReactiveObject() _thrownExceptions = new Lazy>(this.GetThrownExceptionsObservable, LazyThreadSafetyMode.PublicationOnly); } -#if NET_461 /// public event PropertyChangingEventHandler PropertyChanging; /// public event PropertyChangedEventHandler PropertyChanged; -#else - /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } - - /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } -#endif /// [IgnoreDataMember] @@ -66,19 +50,11 @@ public event PropertyChangedEventHandler PropertyChanged [IgnoreDataMember] public IObservable ThrownExceptions => _thrownExceptions.Value; -#if NET_461 /// void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) => PropertyChanging?.Invoke(this, args); /// void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) => PropertyChanged?.Invoke(this, args); -#else - /// - void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args) => PropertyChangingEventManager.DeliverEvent(this, args); - - /// - void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args) => PropertyChangedEventManager.DeliverEvent(this, args); -#endif /// public IDisposable SuppressChangeNotifications() => IReactiveObjectExtensions.SuppressChangeNotifications(this); From d818217464b30e431dc0dd9dbd227d6daa7b27ee Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Mon, 9 Dec 2019 16:40:53 +1100 Subject: [PATCH 2/5] Further removals --- src/ReactiveUI.AndroidX/ReactiveFragment.cs | 12 ++--------- .../ReactiveFragmentActivity.cs | 12 ++--------- .../ReactiveRecyclerViewViewHolder.cs | 12 ++--------- .../EventShims/PropertyChangedEventManager.cs | 20 ------------------- .../PropertyChangingEventManager.cs | 20 ------------------- 5 files changed, 6 insertions(+), 70 deletions(-) delete mode 100644 src/ReactiveUI.Winforms/EventShims/PropertyChangedEventManager.cs delete mode 100644 src/ReactiveUI.Winforms/EventShims/PropertyChangingEventManager.cs diff --git a/src/ReactiveUI.AndroidX/ReactiveFragment.cs b/src/ReactiveUI.AndroidX/ReactiveFragment.cs index 53669369c9..10dceded19 100644 --- a/src/ReactiveUI.AndroidX/ReactiveFragment.cs +++ b/src/ReactiveUI.AndroidX/ReactiveFragment.cs @@ -63,18 +63,10 @@ protected ReactiveFragment() } /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// public IObservable ThrownExceptions => this.GetThrownExceptionsObservable(); diff --git a/src/ReactiveUI.AndroidX/ReactiveFragmentActivity.cs b/src/ReactiveUI.AndroidX/ReactiveFragmentActivity.cs index c220cb8c69..5b0adb2e0a 100644 --- a/src/ReactiveUI.AndroidX/ReactiveFragmentActivity.cs +++ b/src/ReactiveUI.AndroidX/ReactiveFragmentActivity.cs @@ -62,18 +62,10 @@ public class ReactiveFragmentActivity : FragmentActivity, IReactiveObject, IReac private readonly Subject<(int requestCode, Result result, Intent intent)> _activityResult = new Subject<(int requestCode, Result result, Intent intent)>(); /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// public IObservable> Changing => this.GetChangingObservable(); diff --git a/src/ReactiveUI.AndroidX/ReactiveRecyclerViewViewHolder.cs b/src/ReactiveUI.AndroidX/ReactiveRecyclerViewViewHolder.cs index 38942b7c94..5841a86718 100644 --- a/src/ReactiveUI.AndroidX/ReactiveRecyclerViewViewHolder.cs +++ b/src/ReactiveUI.AndroidX/ReactiveRecyclerViewViewHolder.cs @@ -80,18 +80,10 @@ protected ReactiveRecyclerViewViewHolder(View view) } /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// /// Gets an observable that signals that this ViewHolder has been selected. diff --git a/src/ReactiveUI.Winforms/EventShims/PropertyChangedEventManager.cs b/src/ReactiveUI.Winforms/EventShims/PropertyChangedEventManager.cs deleted file mode 100644 index 7802159bdf..0000000000 --- a/src/ReactiveUI.Winforms/EventShims/PropertyChangedEventManager.cs +++ /dev/null @@ -1,20 +0,0 @@ -// 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.Collections.Generic; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ReactiveUI.Winforms -{ - [SuppressMessage("Design", "CA1812: Instance not created", Justification = "Created by static method in other assembly.")] - internal class PropertyChangedEventManager : WeakEventManager - { - } -} diff --git a/src/ReactiveUI.Winforms/EventShims/PropertyChangingEventManager.cs b/src/ReactiveUI.Winforms/EventShims/PropertyChangingEventManager.cs deleted file mode 100644 index 1af85004b2..0000000000 --- a/src/ReactiveUI.Winforms/EventShims/PropertyChangingEventManager.cs +++ /dev/null @@ -1,20 +0,0 @@ -// 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.Collections.Generic; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ReactiveUI.Winforms -{ - [SuppressMessage("Design", "CA1812: Instance not created", Justification = "Created by static method in other assembly.")] - internal class PropertyChangingEventManager : WeakEventManager - { - } -} From 8606eb30276158a8cac1fb83c160c84a159229e9 Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Mon, 9 Dec 2019 18:38:57 +1100 Subject: [PATCH 3/5] More removing classes --- src/ReactiveUI.AndroidX/ReactiveDialogFragment.cs | 12 ++---------- .../Helpers/DiagnosticResultLocation.cs | 4 ++-- .../Helpers/DiagnosticVerifier.Helper.cs | 5 +++++ .../Verifiers/DiagnosticVerifier.cs | 7 ++++--- src/ReactiveUI.Fody.Tests/FodyWeavers.xsd | 1 + src/ReactiveUI.Tests/InteractionsTest.cs | 0 .../Platforms/winforms/CommandBindingTests.cs | 0 7 files changed, 14 insertions(+), 15 deletions(-) mode change 100755 => 100644 src/ReactiveUI.Tests/InteractionsTest.cs mode change 100755 => 100644 src/ReactiveUI.Tests/Platforms/winforms/CommandBindingTests.cs diff --git a/src/ReactiveUI.AndroidX/ReactiveDialogFragment.cs b/src/ReactiveUI.AndroidX/ReactiveDialogFragment.cs index 66603244d4..cedf0dd587 100644 --- a/src/ReactiveUI.AndroidX/ReactiveDialogFragment.cs +++ b/src/ReactiveUI.AndroidX/ReactiveDialogFragment.cs @@ -63,18 +63,10 @@ protected ReactiveDialogFragment() } /// - public event PropertyChangingEventHandler PropertyChanging - { - add => PropertyChangingEventManager.AddHandler(this, value); - remove => PropertyChangingEventManager.RemoveHandler(this, value); - } + public event PropertyChangingEventHandler PropertyChanging; /// - public event PropertyChangedEventHandler PropertyChanged - { - add => PropertyChangedEventManager.AddHandler(this, value); - remove => PropertyChangedEventManager.RemoveHandler(this, value); - } + public event PropertyChangedEventHandler PropertyChanged; /// public IObservable ThrownExceptions => this.GetThrownExceptionsObservable(); diff --git a/src/ReactiveUI.Fody.Analyzer.Test/Helpers/DiagnosticResultLocation.cs b/src/ReactiveUI.Fody.Analyzer.Test/Helpers/DiagnosticResultLocation.cs index 359f373699..3e8e577d7a 100644 --- a/src/ReactiveUI.Fody.Analyzer.Test/Helpers/DiagnosticResultLocation.cs +++ b/src/ReactiveUI.Fody.Analyzer.Test/Helpers/DiagnosticResultLocation.cs @@ -10,7 +10,7 @@ namespace TestHelper /// /// Location where the diagnostic appears, as determined by path, line number, and column number. /// - public struct DiagnosticResultLocation + public struct DiagnosticResultLocation : IEquatable { /// /// Initializes a new instance of the struct. @@ -73,7 +73,7 @@ public DiagnosticResultLocation(string path, int line, int column) /// Are Equal. public bool Equals(DiagnosticResultLocation other) { - return string.Equals(Path, other.Path) && Line == other.Line && Column == other.Column; + return string.Equals(Path, other.Path, StringComparison.InvariantCultureIgnoreCase) && Line == other.Line && Column == other.Column; } /// diff --git a/src/ReactiveUI.Fody.Analyzer.Test/Helpers/DiagnosticVerifier.Helper.cs b/src/ReactiveUI.Fody.Analyzer.Test/Helpers/DiagnosticVerifier.Helper.cs index f0a0138550..1ffb62045b 100644 --- a/src/ReactiveUI.Fody.Analyzer.Test/Helpers/DiagnosticVerifier.Helper.cs +++ b/src/ReactiveUI.Fody.Analyzer.Test/Helpers/DiagnosticVerifier.Helper.cs @@ -43,6 +43,11 @@ public abstract partial class DiagnosticVerifier /// An IEnumerable of Diagnostics that surfaced in the source code, sorted by Location. protected static Diagnostic[] GetSortedDiagnosticsFromDocuments(DiagnosticAnalyzer analyzer, Document[] documents) { + if (documents is null) + { + throw new ArgumentNullException(nameof(documents)); + } + var projects = new HashSet(); foreach (var document in documents) { diff --git a/src/ReactiveUI.Fody.Analyzer.Test/Verifiers/DiagnosticVerifier.cs b/src/ReactiveUI.Fody.Analyzer.Test/Verifiers/DiagnosticVerifier.cs index 9558652eff..5b60233a57 100644 --- a/src/ReactiveUI.Fody.Analyzer.Test/Verifiers/DiagnosticVerifier.cs +++ b/src/ReactiveUI.Fody.Analyzer.Test/Verifiers/DiagnosticVerifier.cs @@ -10,6 +10,7 @@ using System.Linq; using System.Text; using Xunit; +using System.Globalization; namespace TestHelper { @@ -89,7 +90,7 @@ protected void VerifyBasicDiagnostic(string[] sources, params DiagnosticResult[] /// Diagnostic Results that should have appeared in the code. private static void VerifyDiagnosticResults(IEnumerable actualResults, DiagnosticAnalyzer analyzer, params DiagnosticResult[] expectedResults) { - int expectedCount = expectedResults.Count(); + int expectedCount = expectedResults.Length; int actualCount = actualResults.Count(); if (expectedCount != actualCount) @@ -219,7 +220,7 @@ private static string FormatDiagnostics(DiagnosticAnalyzer analyzer, params Diag var location = diagnostics[i].Location; if (location == Location.None) { - builder.AppendFormat("GetGlobalResult({0}.{1})", analyzerType.Name, rule.Id); + builder.AppendFormat(CultureInfo.InvariantCulture, "GetGlobalResult({0}.{1})", analyzerType.Name, rule.Id); } else { @@ -255,7 +256,7 @@ private static string FormatDiagnostics(DiagnosticAnalyzer analyzer, params Diag /// The language of the classes represented by the source strings. /// The analyzer to be run on the source code. /// DiagnosticResults that should appear after the analyzer is run on the sources. - private void VerifyDiagnostics(string[] sources, string language, DiagnosticAnalyzer analyzer, params DiagnosticResult[] expected) + private static void VerifyDiagnostics(string[] sources, string language, DiagnosticAnalyzer analyzer, params DiagnosticResult[] expected) { var diagnostics = GetSortedDiagnostics(sources, language, analyzer); VerifyDiagnosticResults(diagnostics, analyzer, expected); diff --git a/src/ReactiveUI.Fody.Tests/FodyWeavers.xsd b/src/ReactiveUI.Fody.Tests/FodyWeavers.xsd index f3ac47620a..5cedd530b9 100644 --- a/src/ReactiveUI.Fody.Tests/FodyWeavers.xsd +++ b/src/ReactiveUI.Fody.Tests/FodyWeavers.xsd @@ -4,6 +4,7 @@ + diff --git a/src/ReactiveUI.Tests/InteractionsTest.cs b/src/ReactiveUI.Tests/InteractionsTest.cs old mode 100755 new mode 100644 diff --git a/src/ReactiveUI.Tests/Platforms/winforms/CommandBindingTests.cs b/src/ReactiveUI.Tests/Platforms/winforms/CommandBindingTests.cs old mode 100755 new mode 100644 From 0e11a802a711209ec224e6c895c34e12a6463a58 Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Tue, 10 Dec 2019 14:56:04 +1100 Subject: [PATCH 4/5] fix --- src/ReactiveUI.Fody.Tests/FodyWeavers.xsd | 1 - src/ReactiveUI/Expression/Reflection.cs | 2 +- src/ReactiveUI/Interfaces/IHasScheduler.cs | 0 .../Platforms/uap/SingleWindowDispatcherScheduler.cs | 4 ++-- .../Platforms/windows-common/ReactiveUserControl.cs | 0 5 files changed, 3 insertions(+), 4 deletions(-) delete mode 100644 src/ReactiveUI/Interfaces/IHasScheduler.cs mode change 100755 => 100644 src/ReactiveUI/Platforms/windows-common/ReactiveUserControl.cs diff --git a/src/ReactiveUI.Fody.Tests/FodyWeavers.xsd b/src/ReactiveUI.Fody.Tests/FodyWeavers.xsd index 5cedd530b9..f3ac47620a 100644 --- a/src/ReactiveUI.Fody.Tests/FodyWeavers.xsd +++ b/src/ReactiveUI.Fody.Tests/FodyWeavers.xsd @@ -4,7 +4,6 @@ - diff --git a/src/ReactiveUI/Expression/Reflection.cs b/src/ReactiveUI/Expression/Reflection.cs index efe428e14a..488749c415 100644 --- a/src/ReactiveUI/Expression/Reflection.cs +++ b/src/ReactiveUI/Expression/Reflection.cs @@ -262,7 +262,7 @@ public static bool TryGetAllValuesForPropertyChain(out IObservedChange[expressions.Count()]; + changeValues = new IObservedChange[expressions.Count]; foreach (Expression expression in expressions.SkipLast(1)) { diff --git a/src/ReactiveUI/Interfaces/IHasScheduler.cs b/src/ReactiveUI/Interfaces/IHasScheduler.cs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/ReactiveUI/Platforms/uap/SingleWindowDispatcherScheduler.cs b/src/ReactiveUI/Platforms/uap/SingleWindowDispatcherScheduler.cs index dcfc9e3aa8..505c78df14 100644 --- a/src/ReactiveUI/Platforms/uap/SingleWindowDispatcherScheduler.cs +++ b/src/ReactiveUI/Platforms/uap/SingleWindowDispatcherScheduler.cs @@ -152,13 +152,13 @@ void RaiseToDispatcher(object sender, object e) } } - private CoreDispatcher TryGetDispatcher() + private static CoreDispatcher TryGetDispatcher() { CoreDispatcher coreDispatcher; try { - coreDispatcher = CoreApplication.Views.FirstOrDefault()?.Dispatcher; + coreDispatcher = CoreApplication.Views.Count > 0 ? CoreApplication.Views[0].Dispatcher : null; } catch { diff --git a/src/ReactiveUI/Platforms/windows-common/ReactiveUserControl.cs b/src/ReactiveUI/Platforms/windows-common/ReactiveUserControl.cs old mode 100755 new mode 100644 From 286ae6ba4ee6f2537ccccd946499d94a2d326b5a Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Tue, 10 Dec 2019 14:59:18 +1100 Subject: [PATCH 5/5] fix --- .../ApiApprovalTests.ReactiveUI.approved.txt | 856 ------------------ ...provalTests.ReactiveUI.net461.approved.txt | 11 - ...ests.ReactiveUI.netcoreapp2.0.approved.txt | 4 + ...ests.ReactiveUI.netcoreapp3.0.approved.txt | 11 - ...alTests.Testing.netcoreapp2.0.approved.txt | 43 - 5 files changed, 4 insertions(+), 921 deletions(-) delete mode 100644 src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.approved.txt delete mode 100644 src/ReactiveUI.Tests/API/ApiApprovalTests.Testing.netcoreapp2.0.approved.txt diff --git a/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.approved.txt b/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.approved.txt deleted file mode 100644 index 108e3719e1..0000000000 --- a/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.approved.txt +++ /dev/null @@ -1,856 +0,0 @@ -[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("ReactiveUI.AndroidSupport")] -[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("ReactiveUI.Tests")] -[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("ReactiveUI.Winforms")] -[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("ReactiveUI.Wpf")] -[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("ReactiveUI.XamForms")] -[assembly: System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.6.1", FrameworkDisplayName=".NET Framework 4.6.1")] -namespace ReactiveUI -{ - public class static AutoPersistHelper - { - public static System.IDisposable ActOnEveryObject(this System.Collections.ObjectModel.ObservableCollection @this, System.Action onAdd, System.Action onRemove) - where TItem : ReactiveUI.IReactiveObject { } - public static System.IDisposable ActOnEveryObject(this System.Collections.ObjectModel.ReadOnlyObservableCollection @this, System.Action onAdd, System.Action onRemove) - where TItem : ReactiveUI.IReactiveObject { } - public static System.IDisposable ActOnEveryObject(this TCollection @this, System.Action onAdd, System.Action onRemove) - where TItem : ReactiveUI.IReactiveObject - where TCollection : System.Collections.Specialized.INotifyCollectionChanged, System.Collections.Generic.IEnumerable<> { } - public static System.IDisposable ActOnEveryObject(this System.IObservable> @this, System.Action onAdd, System.Action onRemove) - where TItem : ReactiveUI.IReactiveObject { } - public static System.IDisposable AutoPersist(this T @this, System.Func> doPersist, System.Nullable interval = null) - where T : ReactiveUI.IReactiveObject { } - public static System.IDisposable AutoPersist(this T @this, System.Func> doPersist, System.IObservable manualSaveSignal, System.Nullable interval = null) - where T : ReactiveUI.IReactiveObject { } - public static System.IDisposable AutoPersistCollection(this System.Collections.ObjectModel.ObservableCollection @this, System.Func> doPersist, System.Nullable interval = null) - where TItem : ReactiveUI.IReactiveObject { } - public static System.IDisposable AutoPersistCollection(this System.Collections.ObjectModel.ObservableCollection @this, System.Func> doPersist, System.IObservable manualSaveSignal, System.Nullable interval = null) - where TItem : ReactiveUI.IReactiveObject { } - public static System.IDisposable AutoPersistCollection(this System.Collections.ObjectModel.ReadOnlyObservableCollection @this, System.Func> doPersist, System.IObservable manualSaveSignal, System.Nullable interval = null) - where TItem : ReactiveUI.IReactiveObject { } - public static System.IDisposable AutoPersistCollection(this TCollection @this, System.Func> doPersist, System.IObservable manualSaveSignal, System.Nullable interval = null) - where TItem : ReactiveUI.IReactiveObject - where TCollection : System.Collections.Specialized.INotifyCollectionChanged, System.Collections.Generic.IEnumerable<> { } - } - public enum BindingDirection - { - OneWay = 0, - TwoWay = 1, - AsyncOneWay = 2, - } - public class CanActivateViewFetcher : ReactiveUI.IActivationForViewFetcher - { - public CanActivateViewFetcher() { } - public System.IObservable GetActivationForView(ReactiveUI.IActivatableView view) { } - public int GetAffinityForView(System.Type view) { } - } - public class static ChangeSetMixin - { - public static System.IObservable CountChanged(this System.IObservable changeSet) { } - public static System.IObservable> CountChanged(this System.IObservable> changeSet) { } - public static bool HasCountChanged(this DynamicData.IChangeSet changeSet) { } - } - public class CombinedReactiveCommand : ReactiveUI.ReactiveCommandBase> - { - protected internal CombinedReactiveCommand(System.Collections.Generic.IEnumerable> childCommands, System.IObservable canExecute, System.Reactive.Concurrency.IScheduler outputScheduler) { } - public override System.IObservable CanExecute { get; } - public override System.IObservable IsExecuting { get; } - public override System.IObservable ThrownExceptions { get; } - protected override void Dispose(bool disposing) { } - public override System.IObservable> Execute(TParam parameter = null) { } - public override System.IDisposable Subscribe(System.IObserver> observer) { } - } - public class static CommandBinder - { - public static ReactiveUI.IReactiveBinding BindCommand(this TView view, TViewModel viewModel, System.Linq.Expressions.Expression> propertyName, System.Linq.Expressions.Expression> controlName, System.IObservable withParameter, string toEvent = null) - where TView : class, ReactiveUI.IViewFor<> - where TViewModel : class - where TProp : System.Windows.Input.ICommand { } - public static ReactiveUI.IReactiveBinding BindCommand(this TView view, TViewModel viewModel, System.Linq.Expressions.Expression> propertyName, System.Linq.Expressions.Expression> controlName, string toEvent = null) - where TView : class, ReactiveUI.IViewFor<> - where TViewModel : class - where TProp : System.Windows.Input.ICommand { } - public static ReactiveUI.IReactiveBinding BindCommand(this TView view, TViewModel viewModel, System.Linq.Expressions.Expression> propertyName, System.Linq.Expressions.Expression> controlName, System.Linq.Expressions.Expression> withParameter, string toEvent = null) - where TView : class, ReactiveUI.IViewFor<> - where TViewModel : class - where TProp : System.Windows.Input.ICommand { } - } - public class CommandBinderImplementation : Splat.IEnableLogger - { - public CommandBinderImplementation() { } - public ReactiveUI.IReactiveBinding BindCommand(TViewModel viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> controlProperty, System.Func withParameter, string toEvent = null) - where TView : class, ReactiveUI.IViewFor<> - where TViewModel : class - where TProp : System.Windows.Input.ICommand { } - public ReactiveUI.IReactiveBinding BindCommand(TViewModel viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> controlProperty, System.IObservable withParameter, string toEvent = null) - where TView : class, ReactiveUI.IViewFor<> - where TViewModel : class - where TProp : System.Windows.Input.ICommand { } - } - public class static ComparerChainingExtensions - { - public static System.Collections.Generic.IComparer ThenBy(this System.Collections.Generic.IComparer parent, System.Func selector) { } - public static System.Collections.Generic.IComparer ThenBy(this System.Collections.Generic.IComparer parent, System.Func selector, System.Collections.Generic.IComparer comparer) { } - public static System.Collections.Generic.IComparer ThenByDescending(this System.Collections.Generic.IComparer parent, System.Func selector) { } - public static System.Collections.Generic.IComparer ThenByDescending(this System.Collections.Generic.IComparer parent, System.Func selector, System.Collections.Generic.IComparer comparer) { } - } - public class ComponentModelTypeConverter : ReactiveUI.IBindingTypeConverter, Splat.IEnableLogger - { - public ComponentModelTypeConverter() { } - public int GetAffinityForObjects(System.Type fromType, System.Type toType) { } - public bool TryConvert(object from, System.Type toType, object conversionHint, out object result) { } - } - public class CreatesCommandBindingViaCommandParameter : ReactiveUI.ICreatesCommandBinding - { - public CreatesCommandBindingViaCommandParameter() { } - public System.IDisposable BindCommandToObject(System.Windows.Input.ICommand command, object target, System.IObservable commandParameter) { } - public System.IDisposable BindCommandToObject(System.Windows.Input.ICommand command, object target, System.IObservable commandParameter, string eventName) { } - public int GetAffinityForObject(System.Type type, bool hasEventTarget) { } - } - public class CreatesCommandBindingViaEvent : ReactiveUI.ICreatesCommandBinding - { - public CreatesCommandBindingViaEvent() { } - public System.IDisposable BindCommandToObject(System.Windows.Input.ICommand command, object target, System.IObservable commandParameter) { } - public System.IDisposable BindCommandToObject(System.Windows.Input.ICommand command, object target, System.IObservable commandParameter, string eventName) { } - public int GetAffinityForObject(System.Type type, bool hasEventTarget) { } - } - public class static DependencyResolverMixins - { - public static void InitializeReactiveUI(this Splat.IMutableDependencyResolver resolver) { } - public static void RegisterViewsForViewModels(this Splat.IMutableDependencyResolver resolver, System.Reflection.Assembly assembly) { } - } - public class DummySuspensionDriver : ReactiveUI.ISuspensionDriver - { - public DummySuspensionDriver() { } - public System.IObservable InvalidateState() { } - public System.IObservable LoadState() { } - public System.IObservable SaveState(object state) { } - } - public class EqualityTypeConverter : ReactiveUI.IBindingTypeConverter, Splat.IEnableLogger - { - public EqualityTypeConverter() { } - public static object DoReferenceCast(object from, System.Type targetType) { } - public int GetAffinityForObjects(System.Type fromType, System.Type toType) { } - public bool TryConvert(object from, System.Type toType, object conversionHint, out object result) { } - } - public class static ExpressionMixins - { - public static object[] GetArgumentsArray(this System.Linq.Expressions.Expression expression) { } - public static System.Collections.Generic.IEnumerable GetExpressionChain(this System.Linq.Expressions.Expression @this) { } - public static System.Reflection.MemberInfo GetMemberInfo(this System.Linq.Expressions.Expression expression) { } - public static System.Linq.Expressions.Expression GetParent(this System.Linq.Expressions.Expression expression) { } - } - public interface IActivatableView { } - public interface IActivationForViewFetcher - { - System.IObservable GetActivationForView(ReactiveUI.IActivatableView view); - int GetAffinityForView(System.Type view); - } - public interface IBindingTypeConverter : Splat.IEnableLogger - { - int GetAffinityForObjects(System.Type fromType, System.Type toType); - bool TryConvert(object from, System.Type toType, object conversionHint, out object result); - } - public interface ICanActivate - { - System.IObservable Activated { get; } - System.IObservable Deactivated { get; } - } - public interface IComparerBuilder - { - System.Collections.Generic.IComparer OrderBy(System.Func selector); - System.Collections.Generic.IComparer OrderBy(System.Func selector, System.Collections.Generic.IComparer comparer); - System.Collections.Generic.IComparer OrderByDescending(System.Func selector); - System.Collections.Generic.IComparer OrderByDescending(System.Func selector, System.Collections.Generic.IComparer comparer); - } - public interface ICreatesCommandBinding - { - System.IDisposable BindCommandToObject(System.Windows.Input.ICommand command, object target, System.IObservable commandParameter); - System.IDisposable BindCommandToObject(System.Windows.Input.ICommand command, object target, System.IObservable commandParameter, string eventName); - int GetAffinityForObject(System.Type type, bool hasEventTarget); - } - public interface ICreatesObservableForProperty : Splat.IEnableLogger - { - int GetAffinityForObject(System.Type type, string propertyName, bool beforeChanged = False); - System.IObservable> GetNotificationForProperty(object sender, System.Linq.Expressions.Expression expression, string propertyName, bool beforeChanged = False, bool suppressWarnings = False); - } - public interface IHandleObservableErrors - { - System.IObservable ThrownExceptions { get; } - } - public interface IMessageBus : Splat.IEnableLogger - { - bool IsRegistered(System.Type type, string contract = null); - System.IObservable Listen(string contract = null); - System.IObservable ListenIncludeLatest(string contract = null); - System.IDisposable RegisterMessageSource(System.IObservable source, string contract = null); - void RegisterScheduler(System.Reactive.Concurrency.IScheduler scheduler, string contract = null); - void SendMessage(T message, string contract = null); - } - public interface INotifyPropertyChanging - { - public event ReactiveUI.PropertyChangingEventHandler PropertyChanging; - } - public class INPCObservableForProperty : ReactiveUI.ICreatesObservableForProperty, Splat.IEnableLogger - { - public INPCObservableForProperty() { } - public int GetAffinityForObject(System.Type type, string propertyName, bool beforeChanged) { } - public System.IObservable> GetNotificationForProperty(object sender, System.Linq.Expressions.Expression expression, string propertyName, bool beforeChanged, bool suppressWarnings = False) { } - } - public class Interaction - { - public Interaction(System.Reactive.Concurrency.IScheduler handlerScheduler = null) { } - protected System.Func<, >[] GetHandlers() { } - public virtual System.IObservable Handle(TInput input) { } - public System.IDisposable RegisterHandler(System.Action> handler) { } - public System.IDisposable RegisterHandler(System.Func, System.Threading.Tasks.Task> handler) { } - public System.IDisposable RegisterHandler(System.Func, System.IObservable> handler) { } - } - public sealed class InteractionContext - { - public TInput Input { get; } - public bool IsHandled { get; } - public TOutput GetOutput() { } - public void SetOutput(TOutput output) { } - } - public interface IObservedChange - { - System.Linq.Expressions.Expression Expression { get; } - TSender Sender { get; } - TValue Value { get; } - } - public interface IPropertyBinderImplementation : Splat.IEnableLogger - { - ReactiveUI.IReactiveBinding> Bind(TViewModel viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.IObservable signalViewUpdate, object conversionHint, ReactiveUI.IBindingTypeConverter vmToViewConverterOverride = null, ReactiveUI.IBindingTypeConverter viewToVMConverterOverride = null) - where TViewModel : class - where TView : class, ReactiveUI.IViewFor - ; - ReactiveUI.IReactiveBinding> Bind(TViewModel viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.IObservable signalViewUpdate, System.Func vmToViewConverter, System.Func viewToVmConverter) - where TViewModel : class - where TView : class, ReactiveUI.IViewFor - ; - System.IDisposable BindTo(System.IObservable observedChange, TTarget target, System.Linq.Expressions.Expression> propertyExpression, object conversionHint, ReactiveUI.IBindingTypeConverter vmToViewConverterOverride = null) - where TTarget : class - ; - ReactiveUI.IReactiveBinding OneWayBind(TViewModel viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, object conversionHint, ReactiveUI.IBindingTypeConverter vmToViewConverterOverride = null) - where TViewModel : class - where TView : class, ReactiveUI.IViewFor - ; - ReactiveUI.IReactiveBinding OneWayBind(TViewModel viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.Func selector) - where TViewModel : class - where TView : class, ReactiveUI.IViewFor - ; - } - public interface IPropertyBindingHook - { - bool ExecuteHook(object source, object target, System.Func[]> getCurrentViewModelProperties, System.Func[]> getCurrentViewProperties, ReactiveUI.BindingDirection direction); - } - public interface IReactiveBinding : System.IDisposable - where out TView : ReactiveUI.IViewFor - where out TViewModel : class - { - System.IObservable Changed { get; } - ReactiveUI.BindingDirection Direction { get; } - TView View { get; } - System.Linq.Expressions.Expression ViewExpression { get; } - TViewModel ViewModel { get; } - System.Linq.Expressions.Expression ViewModelExpression { get; } - } - public interface IReactiveCommand : ReactiveUI.IHandleObservableErrors, System.IDisposable - { - System.IObservable CanExecute { get; } - System.IObservable IsExecuting { get; } - } - public interface IReactiveNotifyPropertyChanged - { - System.IObservable> Changed { get; } - System.IObservable> Changing { get; } - System.IDisposable SuppressChangeNotifications(); - } - public interface IReactiveObject : ReactiveUI.INotifyPropertyChanging, Splat.IEnableLogger, System.ComponentModel.INotifyPropertyChanged - { - void RaisePropertyChanged(System.ComponentModel.PropertyChangedEventArgs args); - void RaisePropertyChanging(ReactiveUI.PropertyChangingEventArgs args); - } - public class static IReactiveObjectExtensions - { - public static TRet RaiseAndSetIfChanged(this TObj @this, ref TRet backingField, TRet newValue, [System.Runtime.CompilerServices.CallerMemberNameAttribute()] string propertyName = null) - where TObj : ReactiveUI.IReactiveObject { } - public static void RaisePropertyChanged(this TSender @this, [System.Runtime.CompilerServices.CallerMemberNameAttribute()] string propertyName = null) - where TSender : ReactiveUI.IReactiveObject { } - public static void RaisePropertyChanging(this TSender @this, [System.Runtime.CompilerServices.CallerMemberNameAttribute()] string propertyName = null) - where TSender : ReactiveUI.IReactiveObject { } - } - public interface IReactivePropertyChangedEventArgs - { - string PropertyName { get; } - TSender Sender { get; } - } - public class IROObservableForProperty : ReactiveUI.ICreatesObservableForProperty, Splat.IEnableLogger - { - public IROObservableForProperty() { } - public int GetAffinityForObject(System.Type type, string propertyName, bool beforeChanged = False) { } - public System.IObservable> GetNotificationForProperty(object sender, System.Linq.Expressions.Expression expression, string propertyName, bool beforeChanged = False, bool suppressWarnings = False) { } - } - public interface IRoutableViewModel : ReactiveUI.INotifyPropertyChanging, ReactiveUI.IReactiveObject, Splat.IEnableLogger, System.ComponentModel.INotifyPropertyChanged - { - ReactiveUI.IScreen HostScreen { get; } - string UrlPathSegment { get; } - } - public interface IScreen - { - ReactiveUI.RoutingState Router { get; } - } - public interface IActivatableViewModel - { - ReactiveUI.ViewModelActivator Activator { get; } - } - public interface ISuspensionDriver - { - System.IObservable InvalidateState(); - System.IObservable LoadState(); - System.IObservable SaveState(object state); - } - public interface ISuspensionHost : ReactiveUI.INotifyPropertyChanging, ReactiveUI.IReactiveObject, Splat.IEnableLogger, System.ComponentModel.INotifyPropertyChanged - { - object AppState { get; set; } - System.Func CreateNewAppState { get; set; } - System.IObservable IsLaunchingNew { get; set; } - System.IObservable IsResuming { get; set; } - System.IObservable IsUnpausing { get; set; } - System.IObservable ShouldInvalidateState { get; set; } - System.IObservable ShouldPersistState { get; set; } - } - public interface IViewFor : ReactiveUI.IActivatableView - { - object ViewModel { get; set; } - } - public interface IViewFor : ReactiveUI.IActivatableView, ReactiveUI.IViewFor - where T : class - { - T ViewModel { get; set; } - } - public interface IViewLocator : Splat.IEnableLogger - { - ReactiveUI.IViewFor ResolveView(T viewModel, string contract = null) - where T : class; - } - public class MessageBus : ReactiveUI.IMessageBus, Splat.IEnableLogger - { - public MessageBus() { } - public static ReactiveUI.IMessageBus Current { get; set; } - public bool IsRegistered(System.Type type, string contract = null) { } - public System.IObservable Listen(string contract = null) { } - public System.IObservable ListenIncludeLatest(string contract = null) { } - public System.IDisposable RegisterMessageSource(System.IObservable source, string contract = null) { } - public void RegisterScheduler(System.Reactive.Concurrency.IScheduler scheduler, string contract = null) { } - public void SendMessage(T message, string contract = null) { } - } - public class static OAPHCreationHelperMixin - { - public static ReactiveUI.ObservableAsPropertyHelper ToProperty(this System.IObservable target, TObj source, System.Linq.Expressions.Expression> property, TRet initialValue = null, bool deferSubscription = False, System.Reactive.Concurrency.IScheduler scheduler = null) - where TObj : class, ReactiveUI.IReactiveObject { } - public static ReactiveUI.ObservableAsPropertyHelper ToProperty(this System.IObservable target, TObj source, System.Linq.Expressions.Expression> property, out ReactiveUI.ObservableAsPropertyHelper<> result, TRet initialValue = null, bool deferSubscription = False, System.Reactive.Concurrency.IScheduler scheduler = null) - where TObj : class, ReactiveUI.IReactiveObject { } - public static ReactiveUI.ObservableAsPropertyHelper ToProperty(this System.IObservable target, TObj source, string property, TRet initialValue = null, bool deferSubscription = False, System.Reactive.Concurrency.IScheduler scheduler = null) - where TObj : class, ReactiveUI.IReactiveObject { } - public static ReactiveUI.ObservableAsPropertyHelper ToProperty(this System.IObservable target, TObj source, string property, out ReactiveUI.ObservableAsPropertyHelper<> result, TRet initialValue = null, bool deferSubscription = False, System.Reactive.Concurrency.IScheduler scheduler = null) - where TObj : class, ReactiveUI.IReactiveObject { } - } - public sealed class ObservableAsPropertyHelper : ReactiveUI.IHandleObservableErrors, Splat.IEnableLogger, System.IDisposable - { - public ObservableAsPropertyHelper(System.IObservable observable, System.Action onChanged, T initialValue = null, bool deferSubscription = False, System.Reactive.Concurrency.IScheduler scheduler = null) { } - public ObservableAsPropertyHelper(System.IObservable observable, System.Action onChanged, System.Action onChanging = null, T initialValue = null, bool deferSubscription = False, System.Reactive.Concurrency.IScheduler scheduler = null) { } - public bool IsSubscribed { get; } - public System.IObservable ThrownExceptions { get; } - public T Value { get; } - public static ReactiveUI.ObservableAsPropertyHelper Default(T initialValue = null, System.Reactive.Concurrency.IScheduler scheduler = null) { } - public void Dispose() { } - } - public class static ObservableLoggingMixin - { - public static System.IObservable Log(this System.IObservable @this, TObj klass, string message = null, System.Func stringifier = null) - where TObj : Splat.IEnableLogger { } - public static System.IObservable LoggedCatch(this System.IObservable @this, TObj klass, System.IObservable next = null, string message = null) - where TObj : Splat.IEnableLogger { } - public static System.IObservable LoggedCatch(this System.IObservable @this, TObj klass, System.Func> next, string message = null) - where TObj : Splat.IEnableLogger - where TException : System.Exception { } - } - public class ObservedChange : ReactiveUI.IObservedChange - { - public ObservedChange(TSender sender, System.Linq.Expressions.Expression expression, TValue value = null) { } - public System.Linq.Expressions.Expression Expression { get; } - public TSender Sender { get; } - public TValue Value { get; } - } - public class static ObservedChangedMixin - { - public static string GetPropertyName(this ReactiveUI.IObservedChange @this) { } - public static TValue GetValue(this ReactiveUI.IObservedChange @this) { } - public static System.IObservable Value(this System.IObservable> @this) { } - } - public class static OrderedComparer - { - public static ReactiveUI.IComparerBuilder For(System.Collections.Generic.IEnumerable enumerable) { } - public static ReactiveUI.IComparerBuilder For() { } - } - public class static OrderedComparer - { - public static System.Collections.Generic.IComparer OrderBy(System.Func selector) { } - public static System.Collections.Generic.IComparer OrderBy(System.Func selector, System.Collections.Generic.IComparer comparer) { } - public static System.Collections.Generic.IComparer OrderByDescending(System.Func selector) { } - public static System.Collections.Generic.IComparer OrderByDescending(System.Func selector, System.Collections.Generic.IComparer comparer) { } - } - public class PlatformRegistrations - { - public PlatformRegistrations() { } - public void Register(System.Action, System.Type> registerFunction) { } - } - public class POCOObservableForProperty : ReactiveUI.ICreatesObservableForProperty, Splat.IEnableLogger - { - public POCOObservableForProperty() { } - public int GetAffinityForObject(System.Type type, string propertyName, bool beforeChanged = False) { } - public System.IObservable> GetNotificationForProperty(object sender, System.Linq.Expressions.Expression expression, string propertyName, bool beforeChanged = False, bool suppressWarnings = False) { } - } - public class PropertyBinderImplementation : ReactiveUI.IPropertyBinderImplementation, Splat.IEnableLogger - { - public PropertyBinderImplementation() { } - public ReactiveUI.IReactiveBinding> Bind(TViewModel viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.IObservable signalViewUpdate, object conversionHint, ReactiveUI.IBindingTypeConverter vmToViewConverterOverride = null, ReactiveUI.IBindingTypeConverter viewToVMConverterOverride = null) - where TViewModel : class - where TView : class, ReactiveUI.IViewFor { } - public ReactiveUI.IReactiveBinding> Bind(TViewModel viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.IObservable signalViewUpdate, System.Func vmToViewConverter, System.Func viewToVmConverter) - where TViewModel : class - where TView : class, ReactiveUI.IViewFor { } - public System.IDisposable BindTo(System.IObservable observedChange, TTarget target, System.Linq.Expressions.Expression> propertyExpression, object conversionHint = null, ReactiveUI.IBindingTypeConverter vmToViewConverterOverride = null) - where TTarget : class { } - public ReactiveUI.IReactiveBinding OneWayBind(TViewModel viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, object conversionHint = null, ReactiveUI.IBindingTypeConverter vmToViewConverterOverride = null) - where TViewModel : class - where TView : class, ReactiveUI.IViewFor { } - public ReactiveUI.IReactiveBinding OneWayBind(TViewModel viewModel, TView view, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.Func selector) - where TViewModel : class - where TView : class, ReactiveUI.IViewFor { } - } - public class static PropertyBindingMixins - { - public static ReactiveUI.IReactiveBinding> Bind(this TView view, TViewModel viewModel, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, object conversionHint = null, ReactiveUI.IBindingTypeConverter vmToViewConverterOverride = null, ReactiveUI.IBindingTypeConverter viewToVMConverterOverride = null) - where TViewModel : class - where TView : class, ReactiveUI.IViewFor { } - public static ReactiveUI.IReactiveBinding> Bind(this TView view, TViewModel viewModel, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.IObservable signalViewUpdate, object conversionHint = null, ReactiveUI.IBindingTypeConverter vmToViewConverterOverride = null, ReactiveUI.IBindingTypeConverter viewToVMConverterOverride = null) - where TViewModel : class - where TView : class, ReactiveUI.IViewFor { } - public static ReactiveUI.IReactiveBinding> Bind(this TView view, TViewModel viewModel, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.Func vmToViewConverter, System.Func viewToVmConverter) - where TViewModel : class - where TView : class, ReactiveUI.IViewFor { } - public static ReactiveUI.IReactiveBinding> Bind(this TView view, TViewModel viewModel, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.IObservable signalViewUpdate, System.Func vmToViewConverter, System.Func viewToVmConverter) - where TViewModel : class - where TView : class, ReactiveUI.IViewFor { } - public static System.IDisposable BindTo(this System.IObservable @this, TTarget target, System.Linq.Expressions.Expression> property, object conversionHint = null, ReactiveUI.IBindingTypeConverter vmToViewConverterOverride = null) - where TTarget : class { } - public static ReactiveUI.IReactiveBinding OneWayBind(this TView view, TViewModel viewModel, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, object conversionHint = null, ReactiveUI.IBindingTypeConverter vmToViewConverterOverride = null) - where TViewModel : class - where TView : class, ReactiveUI.IViewFor { } - public static ReactiveUI.IReactiveBinding OneWayBind(this TView view, TViewModel viewModel, System.Linq.Expressions.Expression> vmProperty, System.Linq.Expressions.Expression> viewProperty, System.Func selector) - where TViewModel : class - where TView : class, ReactiveUI.IViewFor { } - } - public class PropertyChangingEventArgs : System.EventArgs - { - public PropertyChangingEventArgs(string propertyName) { } - public string PropertyName { get; set; } - } - public delegate void PropertyChangingEventHandler(object sender, ReactiveUI.PropertyChangingEventArgs e); - public class static ReactiveCommand - { - public static ReactiveUI.ReactiveCommand Create(System.Action execute, System.IObservable canExecute = null, System.Reactive.Concurrency.IScheduler outputScheduler = null) { } - public static ReactiveUI.ReactiveCommand Create(System.Func execute, System.IObservable canExecute = null, System.Reactive.Concurrency.IScheduler outputScheduler = null) { } - public static ReactiveUI.ReactiveCommand Create(System.Action execute, System.IObservable canExecute = null, System.Reactive.Concurrency.IScheduler outputScheduler = null) { } - public static ReactiveUI.ReactiveCommand Create(System.Func execute, System.IObservable canExecute = null, System.Reactive.Concurrency.IScheduler outputScheduler = null) { } - public static ReactiveUI.CombinedReactiveCommand CreateCombined(System.Collections.Generic.IEnumerable> childCommands, System.IObservable canExecute = null, System.Reactive.Concurrency.IScheduler outputScheduler = null) { } - public static ReactiveUI.ReactiveCommand CreateFromObservable(System.Func> execute, System.IObservable canExecute = null, System.Reactive.Concurrency.IScheduler outputScheduler = null) { } - public static ReactiveUI.ReactiveCommand CreateFromObservable(System.Func> execute, System.IObservable canExecute = null, System.Reactive.Concurrency.IScheduler outputScheduler = null) { } - public static ReactiveUI.ReactiveCommand CreateFromTask(System.Func> execute, System.IObservable canExecute = null, System.Reactive.Concurrency.IScheduler outputScheduler = null) { } - public static ReactiveUI.ReactiveCommand CreateFromTask(System.Func> execute, System.IObservable canExecute = null, System.Reactive.Concurrency.IScheduler outputScheduler = null) { } - public static ReactiveUI.ReactiveCommand CreateFromTask(System.Func execute, System.IObservable canExecute = null, System.Reactive.Concurrency.IScheduler outputScheduler = null) { } - public static ReactiveUI.ReactiveCommand CreateFromTask(System.Func execute, System.IObservable canExecute = null, System.Reactive.Concurrency.IScheduler outputScheduler = null) { } - public static ReactiveUI.ReactiveCommand CreateFromTask(System.Func> execute, System.IObservable canExecute = null, System.Reactive.Concurrency.IScheduler outputScheduler = null) { } - public static ReactiveUI.ReactiveCommand CreateFromTask(System.Func> execute, System.IObservable canExecute = null, System.Reactive.Concurrency.IScheduler outputScheduler = null) { } - public static ReactiveUI.ReactiveCommand CreateFromTask(System.Func execute, System.IObservable canExecute = null, System.Reactive.Concurrency.IScheduler outputScheduler = null) { } - public static ReactiveUI.ReactiveCommand CreateFromTask(System.Func execute, System.IObservable canExecute = null, System.Reactive.Concurrency.IScheduler outputScheduler = null) { } - } - public class ReactiveCommand : ReactiveUI.ReactiveCommandBase - { - protected internal ReactiveCommand(System.Func> execute, System.IObservable canExecute, System.Reactive.Concurrency.IScheduler outputScheduler) { } - public override System.IObservable CanExecute { get; } - public override System.IObservable IsExecuting { get; } - public override System.IObservable ThrownExceptions { get; } - protected override void Dispose(bool disposing) { } - public override System.IObservable Execute(TParam parameter = null) { } - public override System.IDisposable Subscribe(System.IObserver observer) { } - } - public abstract class ReactiveCommandBase : ReactiveUI.IHandleObservableErrors, ReactiveUI.IReactiveCommand, System.IDisposable, System.IObservable, System.Windows.Input.ICommand - { - protected ReactiveCommandBase() { } - public abstract System.IObservable CanExecute { get; } - public abstract System.IObservable IsExecuting { get; } - public abstract System.IObservable ThrownExceptions { get; } - public event System.EventHandler System.Windows.Input.ICommand.CanExecuteChanged; - public void Dispose() { } - protected abstract void Dispose(bool disposing); - public abstract System.IObservable Execute(TParam parameter = null); - protected virtual bool ICommandCanExecute(object parameter) { } - protected virtual void ICommandExecute(object parameter) { } - protected void OnCanExecuteChanged() { } - public abstract System.IDisposable Subscribe(System.IObserver observer); - } - public class static ReactiveCommandMixins - { - public static System.IDisposable InvokeCommand(this System.IObservable @this, System.Windows.Input.ICommand command) { } - public static System.IDisposable InvokeCommand(this System.IObservable @this, ReactiveUI.ReactiveCommandBase command) { } - public static System.IDisposable InvokeCommand(this System.IObservable @this, TTarget target, System.Linq.Expressions.Expression> commandProperty) - where TTarget : class { } - public static System.IDisposable InvokeCommand(this System.IObservable @this, TTarget target, System.Linq.Expressions.Expression>> commandProperty) - where TTarget : class { } - } - public class static ReactiveNotifyPropertyChangedMixin - { - public static System.IObservable> ObservableForProperty(this TSender @this, System.Linq.Expressions.Expression> property, bool beforeChange = False, bool skipInitial = True) - where TSender : class { } - public static System.IObservable ObservableForProperty(this TSender @this, System.Linq.Expressions.Expression> property, System.Func selector, bool beforeChange = False) - where TSender : class { } - public static System.IObservable> SubscribeToExpressionChain(this TSender source, System.Linq.Expressions.Expression expression, bool beforeChange = False, bool skipInitial = True) { } - } - [System.Runtime.Serialization.DataContractAttribute()] - public class ReactiveObject : ReactiveUI.IHandleObservableErrors, ReactiveUI.INotifyPropertyChanging, ReactiveUI.IReactiveNotifyPropertyChanged, ReactiveUI.IReactiveObject, Splat.IEnableLogger, System.ComponentModel.INotifyPropertyChanged - { - public ReactiveObject() { } - [System.Runtime.Serialization.IgnoreDataMemberAttribute()] - public System.IObservable> Changed { get; } - [System.Runtime.Serialization.IgnoreDataMemberAttribute()] - public System.IObservable> Changing { get; } - [System.Runtime.Serialization.IgnoreDataMemberAttribute()] - public System.IObservable ThrownExceptions { get; } - public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; - public event ReactiveUI.PropertyChangingEventHandler PropertyChanging; - public bool AreChangeNotificationsEnabled() { } - public System.IDisposable DelayChangeNotifications() { } - public System.IDisposable SuppressChangeNotifications() { } - } - public class ReactivePropertyChangedEventArgs : System.ComponentModel.PropertyChangedEventArgs, ReactiveUI.IReactivePropertyChangedEventArgs - { - public ReactivePropertyChangedEventArgs(TSender sender, string propertyName) { } - public TSender Sender { get; } - } - public class ReactivePropertyChangingEventArgs : ReactiveUI.PropertyChangingEventArgs, ReactiveUI.IReactivePropertyChangedEventArgs - { - public ReactivePropertyChangingEventArgs(TSender sender, string propertyName) { } - public TSender Sender { get; } - } - public class static Reflection - { - public static string ExpressionToPropertyNames(System.Linq.Expressions.Expression expression) { } - public static System.Type GetEventArgsTypeForEvent(System.Type type, string eventName) { } - public static System.Func GetValueFetcherForProperty(System.Reflection.MemberInfo member) { } - public static System.Func GetValueFetcherOrThrow(System.Reflection.MemberInfo member) { } - public static System.Action GetValueSetterForProperty(System.Reflection.MemberInfo member) { } - public static System.Action GetValueSetterOrThrow(System.Reflection.MemberInfo member) { } - public static bool IsStatic(this System.Reflection.PropertyInfo @this) { } - public static System.Type ReallyFindType(string type, bool throwOnFailure) { } - public static System.Linq.Expressions.Expression Rewrite(System.Linq.Expressions.Expression expression) { } - public static void ThrowIfMethodsNotOverloaded(string callingTypeName, object targetObject, params string[] methodsToCheck) { } - public static bool TryGetAllValuesForPropertyChain(out ReactiveUI.IObservedChange<, > changeValues, object current, System.Collections.Generic.IEnumerable expressionChain) { } - public static bool TryGetValueForPropertyChain(out TValue changeValue, object current, System.Collections.Generic.IEnumerable expressionChain) { } - public static bool TrySetValueToPropertyChain(object target, System.Collections.Generic.IEnumerable expressionChain, TValue value, bool shouldThrow = True) { } - } - public class Registrations - { - public Registrations() { } - public void Register(System.Action, System.Type> registerFunction) { } - } - public class static RoutableViewModelMixin - { - public static System.IDisposable WhenNavigatedTo(this ReactiveUI.IRoutableViewModel @this, System.Func onNavigatedTo) { } - public static System.IObservable WhenNavigatedToObservable(this ReactiveUI.IRoutableViewModel @this) { } - public static System.IObservable WhenNavigatingFromObservable(this ReactiveUI.IRoutableViewModel @this) { } - } - [System.Runtime.Serialization.DataContractAttribute()] - public class RoutingState : ReactiveUI.ReactiveObject - { - public RoutingState() { } - public RoutingState(System.Reactive.Concurrency.IScheduler scheduler) { } - [System.Runtime.Serialization.IgnoreDataMemberAttribute()] - public System.IObservable CurrentViewModel { get; set; } - [System.Runtime.Serialization.IgnoreDataMemberAttribute()] - public ReactiveUI.ReactiveCommand Navigate { get; set; } - [System.Runtime.Serialization.IgnoreDataMemberAttribute()] - public ReactiveUI.ReactiveCommand NavigateAndReset { get; set; } - [System.Runtime.Serialization.IgnoreDataMemberAttribute()] - public ReactiveUI.ReactiveCommand NavigateBack { get; set; } - [System.Runtime.Serialization.IgnoreDataMemberAttribute()] - public System.IObservable> NavigationChanged { get; set; } - [System.Runtime.Serialization.IgnoreDataMemberAttribute()] - public System.Collections.ObjectModel.ObservableCollection NavigationStack { get; } - [System.Runtime.Serialization.IgnoreDataMemberAttribute()] - public System.Reactive.Concurrency.IScheduler Scheduler { get; set; } - } - public class static RoutingStateMixins - { - public static T FindViewModelInStack(this ReactiveUI.RoutingState @this) - where T : ReactiveUI.IRoutableViewModel { } - public static ReactiveUI.IRoutableViewModel GetCurrentViewModel(this ReactiveUI.RoutingState @this) { } - } - public class static RxApp - { - public const int BigCacheLimit = 256; - public const int SmallCacheLimit = 64; - public static System.IObserver DefaultExceptionHandler { get; set; } - public static System.Reactive.Concurrency.IScheduler MainThreadScheduler { get; set; } - public static bool SupportsRangeNotifications { get; set; } - public static bool SuppressViewCommandBindingMessage { get; set; } - public static ReactiveUI.ISuspensionHost SuspensionHost { get; set; } - public static System.Reactive.Concurrency.IScheduler TaskpoolScheduler { get; set; } - } - public class ScheduledSubject : System.IDisposable, System.IObservable, System.IObserver, System.Reactive.Subjects.ISubject, System.Reactive.Subjects.ISubject - { - public ScheduledSubject(System.Reactive.Concurrency.IScheduler scheduler, System.IObserver defaultObserver = null, System.Reactive.Subjects.ISubject defaultSubject = null) { } - public void Dispose() { } - protected virtual void Dispose(bool isDisposing) { } - public void OnCompleted() { } - public void OnError(System.Exception error) { } - public void OnNext(T value) { } - public System.IDisposable Subscribe(System.IObserver observer) { } - } - [System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.All)] - public class SingleInstanceViewAttribute : System.Attribute - { - public SingleInstanceViewAttribute() { } - } - public class StringConverter : ReactiveUI.IBindingTypeConverter, Splat.IEnableLogger - { - public StringConverter() { } - public int GetAffinityForObjects(System.Type fromType, System.Type toType) { } - public bool TryConvert(object from, System.Type toType, object conversionHint, out object result) { } - } - public class static SuspensionHostExtensions - { - public static T GetAppState(this ReactiveUI.ISuspensionHost @this) { } - public static System.IObservable ObserveAppState(this ReactiveUI.ISuspensionHost @this) - where T : class { } - public static System.IDisposable SetupDefaultSuspendResume(this ReactiveUI.ISuspensionHost @this, ReactiveUI.ISuspensionDriver driver = null) { } - } - public class UnhandledErrorException : System.Exception - { - public UnhandledErrorException() { } - public UnhandledErrorException(string message) { } - public UnhandledErrorException(string message, System.Exception innerException) { } - protected UnhandledErrorException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } - } - public class UnhandledInteractionException : System.Exception - { - public UnhandledInteractionException(ReactiveUI.Interaction interaction, TInput input) { } - public UnhandledInteractionException() { } - public UnhandledInteractionException(string message) { } - public UnhandledInteractionException(string message, System.Exception innerException) { } - protected UnhandledInteractionException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } - public TInput Input { get; } - public ReactiveUI.Interaction Interaction { get; } - public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } - } - [System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.All)] - public class ViewContractAttribute : System.Attribute - { - public ViewContractAttribute(string contract) { } - public string Contract { get; } - } - public class static ViewForMixins - { - public static void WhenActivated(this ReactiveUI.IActivatableViewModel @this, System.Func> block) { } - public static void WhenActivated(this ReactiveUI.IActivatableViewModel @this, System.Action> block) { } - public static void WhenActivated(this ReactiveUI.IActivatableViewModel @this, System.Action block) { } - public static System.IDisposable WhenActivated(this ReactiveUI.IActivatableView @this, System.Func> block) { } - public static System.IDisposable WhenActivated(this ReactiveUI.IActivatableView @this, System.Func> block, ReactiveUI.IViewFor view) { } - public static System.IDisposable WhenActivated(this ReactiveUI.IActivatableView @this, System.Action> block) { } - public static System.IDisposable WhenActivated(this ReactiveUI.IActivatableView @this, System.Action> block, ReactiveUI.IViewFor view) { } - public static System.IDisposable WhenActivated(this ReactiveUI.IActivatableView @this, System.Action block, ReactiveUI.IViewFor view = null) { } - } - public class static ViewLocator - { - public static ReactiveUI.IViewLocator Current { get; } - } - public class ViewLocatorNotFoundException : System.Exception - { - public ViewLocatorNotFoundException() { } - public ViewLocatorNotFoundException(string message) { } - public ViewLocatorNotFoundException(string message, System.Exception innerException) { } - protected ViewLocatorNotFoundException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } - } - public sealed class ViewModelActivator : System.IDisposable - { - public ViewModelActivator() { } - public System.IObservable Activated { get; } - public System.IObservable Deactivated { get; } - public System.IDisposable Activate() { } - public void Deactivate(bool ignoreRefCount = False) { } - public void Dispose() { } - } - public class WaitForDispatcherScheduler : System.Reactive.Concurrency.IScheduler - { - public WaitForDispatcherScheduler(System.Func schedulerFactory) { } - public System.DateTimeOffset Now { get; } - public System.IDisposable Schedule(TState state, System.Func action) { } - public System.IDisposable Schedule(TState state, System.TimeSpan dueTime, System.Func action) { } - public System.IDisposable Schedule(TState state, System.DateTimeOffset dueTime, System.Func action) { } - } - public class WeakEventManager - where TEventSource : class - where TEventHandler : class - { - protected WeakEventManager() { } - public static void AddHandler(TEventSource source, TEventHandler handler) { } - public static void DeliverEvent(TEventSource sender, TEventArgs args) { } - public static void RemoveHandler(TEventSource source, TEventHandler handler) { } - protected virtual void StartListening(object source) { } - protected virtual void StopListening(object source) { } - } - public class static WhenAnyMixin - { - public static System.IObservable WhenAny(this TSender This, System.Linq.Expressions.Expression> property1, System.Func, TRet> selector) - where TSender : class { } - public static System.IObservable WhenAny(this TSender This, System.Linq.Expressions.Expression> property1, System.Linq.Expressions.Expression> property2, System.Func, ReactiveUI.IObservedChange, TRet> selector) - where TSender : class { } - public static System.IObservable WhenAny(this TSender This, System.Linq.Expressions.Expression> property1, System.Linq.Expressions.Expression> property2, System.Linq.Expressions.Expression> property3, System.Func, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, TRet> selector) - where TSender : class { } - public static System.IObservable WhenAny(this TSender This, System.Linq.Expressions.Expression> property1, System.Linq.Expressions.Expression> property2, System.Linq.Expressions.Expression> property3, System.Linq.Expressions.Expression> property4, System.Func, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, TRet> selector) - where TSender : class { } - public static System.IObservable WhenAny(this TSender This, System.Linq.Expressions.Expression> property1, System.Linq.Expressions.Expression> property2, System.Linq.Expressions.Expression> property3, System.Linq.Expressions.Expression> property4, System.Linq.Expressions.Expression> property5, System.Func, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, TRet> selector) - where TSender : class { } - public static System.IObservable WhenAny(this TSender This, System.Linq.Expressions.Expression> property1, System.Linq.Expressions.Expression> property2, System.Linq.Expressions.Expression> property3, System.Linq.Expressions.Expression> property4, System.Linq.Expressions.Expression> property5, System.Linq.Expressions.Expression> property6, System.Func, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, TRet> selector) - where TSender : class { } - public static System.IObservable WhenAny(this TSender This, System.Linq.Expressions.Expression> property1, System.Linq.Expressions.Expression> property2, System.Linq.Expressions.Expression> property3, System.Linq.Expressions.Expression> property4, System.Linq.Expressions.Expression> property5, System.Linq.Expressions.Expression> property6, System.Linq.Expressions.Expression> property7, System.Func, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, TRet> selector) - where TSender : class { } - public static System.IObservable WhenAny(this TSender This, System.Linq.Expressions.Expression> property1, System.Linq.Expressions.Expression> property2, System.Linq.Expressions.Expression> property3, System.Linq.Expressions.Expression> property4, System.Linq.Expressions.Expression> property5, System.Linq.Expressions.Expression> property6, System.Linq.Expressions.Expression> property7, System.Linq.Expressions.Expression> property8, System.Func, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, TRet> selector) - where TSender : class { } - public static System.IObservable WhenAny(this TSender This, System.Linq.Expressions.Expression> property1, System.Linq.Expressions.Expression> property2, System.Linq.Expressions.Expression> property3, System.Linq.Expressions.Expression> property4, System.Linq.Expressions.Expression> property5, System.Linq.Expressions.Expression> property6, System.Linq.Expressions.Expression> property7, System.Linq.Expressions.Expression> property8, System.Linq.Expressions.Expression> property9, System.Func, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, TRet> selector) - where TSender : class { } - public static System.IObservable WhenAny(this TSender This, System.Linq.Expressions.Expression> property1, System.Linq.Expressions.Expression> property2, System.Linq.Expressions.Expression> property3, System.Linq.Expressions.Expression> property4, System.Linq.Expressions.Expression> property5, System.Linq.Expressions.Expression> property6, System.Linq.Expressions.Expression> property7, System.Linq.Expressions.Expression> property8, System.Linq.Expressions.Expression> property9, System.Linq.Expressions.Expression> property10, System.Func, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, TRet> selector) - where TSender : class { } - public static System.IObservable WhenAny(this TSender This, System.Linq.Expressions.Expression> property1, System.Linq.Expressions.Expression> property2, System.Linq.Expressions.Expression> property3, System.Linq.Expressions.Expression> property4, System.Linq.Expressions.Expression> property5, System.Linq.Expressions.Expression> property6, System.Linq.Expressions.Expression> property7, System.Linq.Expressions.Expression> property8, System.Linq.Expressions.Expression> property9, System.Linq.Expressions.Expression> property10, System.Linq.Expressions.Expression> property11, System.Func, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, TRet> selector) - where TSender : class { } - public static System.IObservable WhenAny(this TSender This, System.Linq.Expressions.Expression> property1, System.Linq.Expressions.Expression> property2, System.Linq.Expressions.Expression> property3, System.Linq.Expressions.Expression> property4, System.Linq.Expressions.Expression> property5, System.Linq.Expressions.Expression> property6, System.Linq.Expressions.Expression> property7, System.Linq.Expressions.Expression> property8, System.Linq.Expressions.Expression> property9, System.Linq.Expressions.Expression> property10, System.Linq.Expressions.Expression> property11, System.Linq.Expressions.Expression> property12, System.Func, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, TRet> selector) - where TSender : class { } - public static System.IObservable WhenAnyDynamic(this TSender This, System.Linq.Expressions.Expression property1, System.Func, TRet> selector) - where TSender : class { } - public static System.IObservable WhenAnyDynamic(this TSender This, System.Linq.Expressions.Expression property1, System.Linq.Expressions.Expression property2, System.Func, ReactiveUI.IObservedChange, TRet> selector) - where TSender : class { } - public static System.IObservable WhenAnyDynamic(this TSender This, System.Linq.Expressions.Expression property1, System.Linq.Expressions.Expression property2, System.Linq.Expressions.Expression property3, System.Func, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, TRet> selector) - where TSender : class { } - public static System.IObservable WhenAnyDynamic(this TSender This, System.Linq.Expressions.Expression property1, System.Linq.Expressions.Expression property2, System.Linq.Expressions.Expression property3, System.Linq.Expressions.Expression property4, System.Func, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, TRet> selector) - where TSender : class { } - public static System.IObservable WhenAnyDynamic(this TSender This, System.Linq.Expressions.Expression property1, System.Linq.Expressions.Expression property2, System.Linq.Expressions.Expression property3, System.Linq.Expressions.Expression property4, System.Linq.Expressions.Expression property5, System.Func, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, TRet> selector) - where TSender : class { } - public static System.IObservable WhenAnyDynamic(this TSender This, System.Linq.Expressions.Expression property1, System.Linq.Expressions.Expression property2, System.Linq.Expressions.Expression property3, System.Linq.Expressions.Expression property4, System.Linq.Expressions.Expression property5, System.Linq.Expressions.Expression property6, System.Func, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, TRet> selector) - where TSender : class { } - public static System.IObservable WhenAnyDynamic(this TSender This, System.Linq.Expressions.Expression property1, System.Linq.Expressions.Expression property2, System.Linq.Expressions.Expression property3, System.Linq.Expressions.Expression property4, System.Linq.Expressions.Expression property5, System.Linq.Expressions.Expression property6, System.Linq.Expressions.Expression property7, System.Func, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, TRet> selector) - where TSender : class { } - public static System.IObservable WhenAnyDynamic(this TSender This, System.Linq.Expressions.Expression property1, System.Linq.Expressions.Expression property2, System.Linq.Expressions.Expression property3, System.Linq.Expressions.Expression property4, System.Linq.Expressions.Expression property5, System.Linq.Expressions.Expression property6, System.Linq.Expressions.Expression property7, System.Linq.Expressions.Expression property8, System.Func, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, TRet> selector) - where TSender : class { } - public static System.IObservable WhenAnyDynamic(this TSender This, System.Linq.Expressions.Expression property1, System.Linq.Expressions.Expression property2, System.Linq.Expressions.Expression property3, System.Linq.Expressions.Expression property4, System.Linq.Expressions.Expression property5, System.Linq.Expressions.Expression property6, System.Linq.Expressions.Expression property7, System.Linq.Expressions.Expression property8, System.Linq.Expressions.Expression property9, System.Func, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, TRet> selector) - where TSender : class { } - public static System.IObservable WhenAnyDynamic(this TSender This, System.Linq.Expressions.Expression property1, System.Linq.Expressions.Expression property2, System.Linq.Expressions.Expression property3, System.Linq.Expressions.Expression property4, System.Linq.Expressions.Expression property5, System.Linq.Expressions.Expression property6, System.Linq.Expressions.Expression property7, System.Linq.Expressions.Expression property8, System.Linq.Expressions.Expression property9, System.Linq.Expressions.Expression property10, System.Func, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, TRet> selector) - where TSender : class { } - public static System.IObservable WhenAnyDynamic(this TSender This, System.Linq.Expressions.Expression property1, System.Linq.Expressions.Expression property2, System.Linq.Expressions.Expression property3, System.Linq.Expressions.Expression property4, System.Linq.Expressions.Expression property5, System.Linq.Expressions.Expression property6, System.Linq.Expressions.Expression property7, System.Linq.Expressions.Expression property8, System.Linq.Expressions.Expression property9, System.Linq.Expressions.Expression property10, System.Linq.Expressions.Expression property11, System.Func, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, TRet> selector) - where TSender : class { } - public static System.IObservable WhenAnyDynamic(this TSender This, System.Linq.Expressions.Expression property1, System.Linq.Expressions.Expression property2, System.Linq.Expressions.Expression property3, System.Linq.Expressions.Expression property4, System.Linq.Expressions.Expression property5, System.Linq.Expressions.Expression property6, System.Linq.Expressions.Expression property7, System.Linq.Expressions.Expression property8, System.Linq.Expressions.Expression property9, System.Linq.Expressions.Expression property10, System.Linq.Expressions.Expression property11, System.Linq.Expressions.Expression property12, System.Func, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, ReactiveUI.IObservedChange, TRet> selector) - where TSender : class { } - public static System.IObservable WhenAnyValue(this TSender This, System.Linq.Expressions.Expression> property1) - where TSender : class { } - public static System.IObservable WhenAnyValue(this TSender This, System.Linq.Expressions.Expression> property1, System.Func selector) - where TSender : class { } - public static System.IObservable> WhenAnyValue(this TSender This, System.Linq.Expressions.Expression> property1, System.Linq.Expressions.Expression> property2) - where TSender : class { } - public static System.IObservable WhenAnyValue(this TSender This, System.Linq.Expressions.Expression> property1, System.Linq.Expressions.Expression> property2, System.Func selector) - where TSender : class { } - public static System.IObservable> WhenAnyValue(this TSender This, System.Linq.Expressions.Expression> property1, System.Linq.Expressions.Expression> property2, System.Linq.Expressions.Expression> property3) - where TSender : class { } - public static System.IObservable WhenAnyValue(this TSender This, System.Linq.Expressions.Expression> property1, System.Linq.Expressions.Expression> property2, System.Linq.Expressions.Expression> property3, System.Func selector) - where TSender : class { } - public static System.IObservable> WhenAnyValue(this TSender This, System.Linq.Expressions.Expression> property1, System.Linq.Expressions.Expression> property2, System.Linq.Expressions.Expression> property3, System.Linq.Expressions.Expression> property4) - where TSender : class { } - public static System.IObservable WhenAnyValue(this TSender This, System.Linq.Expressions.Expression> property1, System.Linq.Expressions.Expression> property2, System.Linq.Expressions.Expression> property3, System.Linq.Expressions.Expression> property4, System.Func selector) - where TSender : class { } - public static System.IObservable> WhenAnyValue(this TSender This, System.Linq.Expressions.Expression> property1, System.Linq.Expressions.Expression> property2, System.Linq.Expressions.Expression> property3, System.Linq.Expressions.Expression> property4, System.Linq.Expressions.Expression> property5) - where TSender : class { } - public static System.IObservable WhenAnyValue(this TSender This, System.Linq.Expressions.Expression> property1, System.Linq.Expressions.Expression> property2, System.Linq.Expressions.Expression> property3, System.Linq.Expressions.Expression> property4, System.Linq.Expressions.Expression> property5, System.Func selector) - where TSender : class { } - public static System.IObservable> WhenAnyValue(this TSender This, System.Linq.Expressions.Expression> property1, System.Linq.Expressions.Expression> property2, System.Linq.Expressions.Expression> property3, System.Linq.Expressions.Expression> property4, System.Linq.Expressions.Expression> property5, System.Linq.Expressions.Expression> property6) - where TSender : class { } - public static System.IObservable WhenAnyValue(this TSender This, System.Linq.Expressions.Expression> property1, System.Linq.Expressions.Expression> property2, System.Linq.Expressions.Expression> property3, System.Linq.Expressions.Expression> property4, System.Linq.Expressions.Expression> property5, System.Linq.Expressions.Expression> property6, System.Func selector) - where TSender : class { } - public static System.IObservable> WhenAnyValue(this TSender This, System.Linq.Expressions.Expression> property1, System.Linq.Expressions.Expression> property2, System.Linq.Expressions.Expression> property3, System.Linq.Expressions.Expression> property4, System.Linq.Expressions.Expression> property5, System.Linq.Expressions.Expression> property6, System.Linq.Expressions.Expression> property7) - where TSender : class { } - public static System.IObservable WhenAnyValue(this TSender This, System.Linq.Expressions.Expression> property1, System.Linq.Expressions.Expression> property2, System.Linq.Expressions.Expression> property3, System.Linq.Expressions.Expression> property4, System.Linq.Expressions.Expression> property5, System.Linq.Expressions.Expression> property6, System.Linq.Expressions.Expression> property7, System.Func selector) - where TSender : class { } - public static System.IObservable WhenAnyValue(this TSender This, System.Linq.Expressions.Expression> property1, System.Linq.Expressions.Expression> property2, System.Linq.Expressions.Expression> property3, System.Linq.Expressions.Expression> property4, System.Linq.Expressions.Expression> property5, System.Linq.Expressions.Expression> property6, System.Linq.Expressions.Expression> property7, System.Linq.Expressions.Expression> property8, System.Func selector) - where TSender : class { } - public static System.IObservable WhenAnyValue(this TSender This, System.Linq.Expressions.Expression> property1, System.Linq.Expressions.Expression> property2, System.Linq.Expressions.Expression> property3, System.Linq.Expressions.Expression> property4, System.Linq.Expressions.Expression> property5, System.Linq.Expressions.Expression> property6, System.Linq.Expressions.Expression> property7, System.Linq.Expressions.Expression> property8, System.Linq.Expressions.Expression> property9, System.Func selector) - where TSender : class { } - public static System.IObservable WhenAnyValue(this TSender This, System.Linq.Expressions.Expression> property1, System.Linq.Expressions.Expression> property2, System.Linq.Expressions.Expression> property3, System.Linq.Expressions.Expression> property4, System.Linq.Expressions.Expression> property5, System.Linq.Expressions.Expression> property6, System.Linq.Expressions.Expression> property7, System.Linq.Expressions.Expression> property8, System.Linq.Expressions.Expression> property9, System.Linq.Expressions.Expression> property10, System.Func selector) - where TSender : class { } - public static System.IObservable WhenAnyValue(this TSender This, System.Linq.Expressions.Expression> property1, System.Linq.Expressions.Expression> property2, System.Linq.Expressions.Expression> property3, System.Linq.Expressions.Expression> property4, System.Linq.Expressions.Expression> property5, System.Linq.Expressions.Expression> property6, System.Linq.Expressions.Expression> property7, System.Linq.Expressions.Expression> property8, System.Linq.Expressions.Expression> property9, System.Linq.Expressions.Expression> property10, System.Linq.Expressions.Expression> property11, System.Func selector) - where TSender : class { } - public static System.IObservable WhenAnyValue(this TSender This, System.Linq.Expressions.Expression> property1, System.Linq.Expressions.Expression> property2, System.Linq.Expressions.Expression> property3, System.Linq.Expressions.Expression> property4, System.Linq.Expressions.Expression> property5, System.Linq.Expressions.Expression> property6, System.Linq.Expressions.Expression> property7, System.Linq.Expressions.Expression> property8, System.Linq.Expressions.Expression> property9, System.Linq.Expressions.Expression> property10, System.Linq.Expressions.Expression> property11, System.Linq.Expressions.Expression> property12, System.Func selector) - where TSender : class { } - } - public class static WhenAnyObservableMixin - { - public static System.IObservable WhenAnyObservable(this TSender This, System.Linq.Expressions.Expression>> obs1) - where TSender : class { } - public static System.IObservable WhenAnyObservable(this TSender This, System.Linq.Expressions.Expression>> obs1, System.Linq.Expressions.Expression>> obs2) - where TSender : class { } - public static System.IObservable WhenAnyObservable(this TSender This, System.Linq.Expressions.Expression>> obs1, System.Linq.Expressions.Expression>> obs2, System.Linq.Expressions.Expression>> obs3) - where TSender : class { } - public static System.IObservable WhenAnyObservable(this TSender This, System.Linq.Expressions.Expression>> obs1, System.Linq.Expressions.Expression>> obs2, System.Linq.Expressions.Expression>> obs3, System.Linq.Expressions.Expression>> obs4) - where TSender : class { } - public static System.IObservable WhenAnyObservable(this TSender This, System.Linq.Expressions.Expression>> obs1, System.Linq.Expressions.Expression>> obs2, System.Linq.Expressions.Expression>> obs3, System.Linq.Expressions.Expression>> obs4, System.Linq.Expressions.Expression>> obs5) - where TSender : class { } - public static System.IObservable WhenAnyObservable(this TSender This, System.Linq.Expressions.Expression>> obs1, System.Linq.Expressions.Expression>> obs2, System.Linq.Expressions.Expression>> obs3, System.Linq.Expressions.Expression>> obs4, System.Linq.Expressions.Expression>> obs5, System.Linq.Expressions.Expression>> obs6) - where TSender : class { } - public static System.IObservable WhenAnyObservable(this TSender This, System.Linq.Expressions.Expression>> obs1, System.Linq.Expressions.Expression>> obs2, System.Linq.Expressions.Expression>> obs3, System.Linq.Expressions.Expression>> obs4, System.Linq.Expressions.Expression>> obs5, System.Linq.Expressions.Expression>> obs6, System.Linq.Expressions.Expression>> obs7) - where TSender : class { } - public static System.IObservable WhenAnyObservable(this TSender This, System.Linq.Expressions.Expression>> obs1, System.Linq.Expressions.Expression>> obs2, System.Linq.Expressions.Expression>> obs3, System.Linq.Expressions.Expression>> obs4, System.Linq.Expressions.Expression>> obs5, System.Linq.Expressions.Expression>> obs6, System.Linq.Expressions.Expression>> obs7, System.Linq.Expressions.Expression>> obs8) - where TSender : class { } - public static System.IObservable WhenAnyObservable(this TSender This, System.Linq.Expressions.Expression>> obs1, System.Linq.Expressions.Expression>> obs2, System.Linq.Expressions.Expression>> obs3, System.Linq.Expressions.Expression>> obs4, System.Linq.Expressions.Expression>> obs5, System.Linq.Expressions.Expression>> obs6, System.Linq.Expressions.Expression>> obs7, System.Linq.Expressions.Expression>> obs8, System.Linq.Expressions.Expression>> obs9) - where TSender : class { } - public static System.IObservable WhenAnyObservable(this TSender This, System.Linq.Expressions.Expression>> obs1, System.Linq.Expressions.Expression>> obs2, System.Linq.Expressions.Expression>> obs3, System.Linq.Expressions.Expression>> obs4, System.Linq.Expressions.Expression>> obs5, System.Linq.Expressions.Expression>> obs6, System.Linq.Expressions.Expression>> obs7, System.Linq.Expressions.Expression>> obs8, System.Linq.Expressions.Expression>> obs9, System.Linq.Expressions.Expression>> obs10) - where TSender : class { } - public static System.IObservable WhenAnyObservable(this TSender This, System.Linq.Expressions.Expression>> obs1, System.Linq.Expressions.Expression>> obs2, System.Linq.Expressions.Expression>> obs3, System.Linq.Expressions.Expression>> obs4, System.Linq.Expressions.Expression>> obs5, System.Linq.Expressions.Expression>> obs6, System.Linq.Expressions.Expression>> obs7, System.Linq.Expressions.Expression>> obs8, System.Linq.Expressions.Expression>> obs9, System.Linq.Expressions.Expression>> obs10, System.Linq.Expressions.Expression>> obs11) - where TSender : class { } - public static System.IObservable WhenAnyObservable(this TSender This, System.Linq.Expressions.Expression>> obs1, System.Linq.Expressions.Expression>> obs2, System.Linq.Expressions.Expression>> obs3, System.Linq.Expressions.Expression>> obs4, System.Linq.Expressions.Expression>> obs5, System.Linq.Expressions.Expression>> obs6, System.Linq.Expressions.Expression>> obs7, System.Linq.Expressions.Expression>> obs8, System.Linq.Expressions.Expression>> obs9, System.Linq.Expressions.Expression>> obs10, System.Linq.Expressions.Expression>> obs11, System.Linq.Expressions.Expression>> obs12) - where TSender : class { } - public static System.IObservable WhenAnyObservable(this TSender This, System.Linq.Expressions.Expression>> obs1, System.Linq.Expressions.Expression>> obs2, System.Func selector) - where TSender : class { } - public static System.IObservable WhenAnyObservable(this TSender This, System.Linq.Expressions.Expression>> obs1, System.Linq.Expressions.Expression>> obs2, System.Linq.Expressions.Expression>> obs3, System.Func selector) - where TSender : class { } - public static System.IObservable WhenAnyObservable(this TSender This, System.Linq.Expressions.Expression>> obs1, System.Linq.Expressions.Expression>> obs2, System.Linq.Expressions.Expression>> obs3, System.Linq.Expressions.Expression>> obs4, System.Func selector) - where TSender : class { } - public static System.IObservable WhenAnyObservable(this TSender This, System.Linq.Expressions.Expression>> obs1, System.Linq.Expressions.Expression>> obs2, System.Linq.Expressions.Expression>> obs3, System.Linq.Expressions.Expression>> obs4, System.Linq.Expressions.Expression>> obs5, System.Func selector) - where TSender : class { } - public static System.IObservable WhenAnyObservable(this TSender This, System.Linq.Expressions.Expression>> obs1, System.Linq.Expressions.Expression>> obs2, System.Linq.Expressions.Expression>> obs3, System.Linq.Expressions.Expression>> obs4, System.Linq.Expressions.Expression>> obs5, System.Linq.Expressions.Expression>> obs6, System.Func selector) - where TSender : class { } - public static System.IObservable WhenAnyObservable(this TSender This, System.Linq.Expressions.Expression>> obs1, System.Linq.Expressions.Expression>> obs2, System.Linq.Expressions.Expression>> obs3, System.Linq.Expressions.Expression>> obs4, System.Linq.Expressions.Expression>> obs5, System.Linq.Expressions.Expression>> obs6, System.Linq.Expressions.Expression>> obs7, System.Func selector) - where TSender : class { } - public static System.IObservable WhenAnyObservable(this TSender This, System.Linq.Expressions.Expression>> obs1, System.Linq.Expressions.Expression>> obs2, System.Linq.Expressions.Expression>> obs3, System.Linq.Expressions.Expression>> obs4, System.Linq.Expressions.Expression>> obs5, System.Linq.Expressions.Expression>> obs6, System.Linq.Expressions.Expression>> obs7, System.Linq.Expressions.Expression>> obs8, System.Func selector) - where TSender : class { } - public static System.IObservable WhenAnyObservable(this TSender This, System.Linq.Expressions.Expression>> obs1, System.Linq.Expressions.Expression>> obs2, System.Linq.Expressions.Expression>> obs3, System.Linq.Expressions.Expression>> obs4, System.Linq.Expressions.Expression>> obs5, System.Linq.Expressions.Expression>> obs6, System.Linq.Expressions.Expression>> obs7, System.Linq.Expressions.Expression>> obs8, System.Linq.Expressions.Expression>> obs9, System.Func selector) - where TSender : class { } - public static System.IObservable WhenAnyObservable(this TSender This, System.Linq.Expressions.Expression>> obs1, System.Linq.Expressions.Expression>> obs2, System.Linq.Expressions.Expression>> obs3, System.Linq.Expressions.Expression>> obs4, System.Linq.Expressions.Expression>> obs5, System.Linq.Expressions.Expression>> obs6, System.Linq.Expressions.Expression>> obs7, System.Linq.Expressions.Expression>> obs8, System.Linq.Expressions.Expression>> obs9, System.Linq.Expressions.Expression>> obs10, System.Func selector) - where TSender : class { } - public static System.IObservable WhenAnyObservable(this TSender This, System.Linq.Expressions.Expression>> obs1, System.Linq.Expressions.Expression>> obs2, System.Linq.Expressions.Expression>> obs3, System.Linq.Expressions.Expression>> obs4, System.Linq.Expressions.Expression>> obs5, System.Linq.Expressions.Expression>> obs6, System.Linq.Expressions.Expression>> obs7, System.Linq.Expressions.Expression>> obs8, System.Linq.Expressions.Expression>> obs9, System.Linq.Expressions.Expression>> obs10, System.Linq.Expressions.Expression>> obs11, System.Func selector) - where TSender : class { } - public static System.IObservable WhenAnyObservable(this TSender This, System.Linq.Expressions.Expression>> obs1, System.Linq.Expressions.Expression>> obs2, System.Linq.Expressions.Expression>> obs3, System.Linq.Expressions.Expression>> obs4, System.Linq.Expressions.Expression>> obs5, System.Linq.Expressions.Expression>> obs6, System.Linq.Expressions.Expression>> obs7, System.Linq.Expressions.Expression>> obs8, System.Linq.Expressions.Expression>> obs9, System.Linq.Expressions.Expression>> obs10, System.Linq.Expressions.Expression>> obs11, System.Linq.Expressions.Expression>> obs12, System.Func selector) - where TSender : class { } - } -} -namespace System.Reactive.Disposables -{ - public class static DisposableMixins { } -} \ No newline at end of file diff --git a/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.net461.approved.txt b/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.net461.approved.txt index 731a077e4c..bfe25a65b4 100644 --- a/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.net461.approved.txt +++ b/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.net461.approved.txt @@ -720,17 +720,6 @@ namespace ReactiveUI public System.IDisposable Schedule(TState state, System.TimeSpan dueTime, System.Func action) { } public System.IDisposable Schedule(TState state, System.DateTimeOffset dueTime, System.Func action) { } } - public class WeakEventManager - where TEventSource : class - where TEventHandler : class - { - protected WeakEventManager() { } - public static void AddHandler(TEventSource source, TEventHandler handler) { } - public static void DeliverEvent(TEventSource sender, TEventArgs args) { } - public static void RemoveHandler(TEventSource source, TEventHandler handler) { } - protected virtual void StartListening(object source) { } - protected virtual void StopListening(object source) { } - } public class static WhenAnyMixin { public static System.IObservable WhenAny(this TSender This, System.Linq.Expressions.Expression> property1, System.Func, TRet> selector) { } diff --git a/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.netcoreapp2.0.approved.txt b/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.netcoreapp2.0.approved.txt index 433a2be5e4..d601c13458 100644 --- a/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.netcoreapp2.0.approved.txt +++ b/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.netcoreapp2.0.approved.txt @@ -199,6 +199,10 @@ namespace ReactiveUI TSender Sender { get; } TValue Value { get; } } + public interface IPlatformOperations + { + string GetOrientation(); + } public interface IPropertyBinderImplementation : Splat.IEnableLogger { [return: System.Runtime.CompilerServices.TupleElementNamesAttribute(new string[] { diff --git a/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.netcoreapp3.0.approved.txt b/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.netcoreapp3.0.approved.txt index b9d0267519..66b38aaa29 100644 --- a/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.netcoreapp3.0.approved.txt +++ b/src/ReactiveUI.Tests/API/ApiApprovalTests.ReactiveUI.netcoreapp3.0.approved.txt @@ -720,17 +720,6 @@ namespace ReactiveUI public System.IDisposable Schedule(TState state, System.TimeSpan dueTime, System.Func action) { } public System.IDisposable Schedule(TState state, System.DateTimeOffset dueTime, System.Func action) { } } - public class WeakEventManager - where TEventSource : class - where TEventHandler : class - { - protected WeakEventManager() { } - public static void AddHandler(TEventSource source, TEventHandler handler) { } - public static void DeliverEvent(TEventSource sender, TEventArgs args) { } - public static void RemoveHandler(TEventSource source, TEventHandler handler) { } - protected virtual void StartListening(object source) { } - protected virtual void StopListening(object source) { } - } public class static WhenAnyMixin { public static System.IObservable WhenAny(this TSender This, System.Linq.Expressions.Expression> property1, System.Func, TRet> selector) { } diff --git a/src/ReactiveUI.Tests/API/ApiApprovalTests.Testing.netcoreapp2.0.approved.txt b/src/ReactiveUI.Tests/API/ApiApprovalTests.Testing.netcoreapp2.0.approved.txt deleted file mode 100644 index 905b59d3dd..0000000000 --- a/src/ReactiveUI.Tests/API/ApiApprovalTests.Testing.netcoreapp2.0.approved.txt +++ /dev/null @@ -1,43 +0,0 @@ -[assembly: System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v2.0", FrameworkDisplayName="")] -namespace ReactiveUI.Testing -{ - 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) { } - public static long FromTimeSpan(this Microsoft.Reactive.Testing.TestScheduler sched, System.TimeSpan span) { } - public static Microsoft.Reactive.Testing.Recorded> OnCompletedAt(this Microsoft.Reactive.Testing.TestScheduler sched, double milliseconds) { } - public static Microsoft.Reactive.Testing.Recorded> OnErrorAt(this Microsoft.Reactive.Testing.TestScheduler sched, double milliseconds, System.Exception ex) { } - public static Microsoft.Reactive.Testing.Recorded> OnNextAt(this Microsoft.Reactive.Testing.TestScheduler sched, double milliseconds, T value) { } - public static TRet With(this T sched, System.Func block) - where T : System.Reactive.Concurrency.IScheduler { } - public static void With(this T sched, System.Action 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.Threading.Tasks.Task WithAsync(this T sched, System.Func block) - where T : System.Reactive.Concurrency.IScheduler { } - public static System.IDisposable WithScheduler(System.Reactive.Concurrency.IScheduler sched) { } - } -} \ No newline at end of file