From c4c3040206a218ef6b3e24d9ccdb575d478aba15 Mon Sep 17 00:00:00 2001 From: Nigel Sampson Date: Tue, 29 Dec 2015 10:43:21 +1300 Subject: [PATCH] Fix up minor compiler warnings --- .../Caliburn.Micro.Platform.iOS.csproj | 5 --- .../android/AndroidPlatformProvider.cs | 42 +++++++++++++++++++ .../iOS/iOSPlatformProvider.cs | 42 +++++++++++++++++++ .../win8/INavigationService.cs | 2 +- .../xforms/AttachedCollection.cs | 4 ++ src/Caliburn.Micro.sln.DotSettings | 1 + 6 files changed, 90 insertions(+), 6 deletions(-) diff --git a/src/Caliburn.Micro.Platform/Caliburn.Micro.Platform.iOS.csproj b/src/Caliburn.Micro.Platform/Caliburn.Micro.Platform.iOS.csproj index 016450ce..5b59b899 100644 --- a/src/Caliburn.Micro.Platform/Caliburn.Micro.Platform.iOS.csproj +++ b/src/Caliburn.Micro.Platform/Caliburn.Micro.Platform.iOS.csproj @@ -59,11 +59,6 @@ - - - - - diff --git a/src/Caliburn.Micro.Platform/android/AndroidPlatformProvider.cs b/src/Caliburn.Micro.Platform/android/AndroidPlatformProvider.cs index 62e395c0..09a15373 100644 --- a/src/Caliburn.Micro.Platform/android/AndroidPlatformProvider.cs +++ b/src/Caliburn.Micro.Platform/android/AndroidPlatformProvider.cs @@ -26,15 +26,26 @@ public class AndroidPlatformProvider : IPlatformProvider return SynchronizationContext.Current != null; } + /// + /// Indicates whether or not the framework is in design-time mode. + /// public bool InDesignMode { get { return false; } } + /// + /// Executes the action on the UI thread asynchronously. + /// + /// The action to execute. public void BeginOnUIThread(Action action) { Application.SynchronizationContext.Post(s => action(), null); } + /// + /// Executes the action on the UI thread asynchronously. + /// + /// The action to execute. public Task OnUIThreadAsync(Action action) { var completionSource = new TaskCompletionSource(); @@ -60,6 +71,10 @@ public class AndroidPlatformProvider : IPlatformProvider return completionSource.Task; } + /// + /// Executes the action on the UI thread. + /// + /// The action to execute. public void OnUIThread(Action action) { if (CheckAccess()) @@ -68,10 +83,25 @@ public class AndroidPlatformProvider : IPlatformProvider OnUIThreadAsync(action).Wait(); } + /// + /// Used to retrieve the root, non-framework-created view. + /// + /// The view to search. + /// The root element that was not created by the framework. + /// In certain instances the services create UI elements. + /// For example, if you ask the window manager to show a UserControl as a dialog, it creates a window to host the UserControl in. + /// The WindowManager marks that element as a framework-created element so that it can determine what it created vs. what was intended by the developer. + /// Calling GetFirstNonGeneratedView allows the framework to discover what the original element was. + /// public object GetFirstNonGeneratedView(object view) { return view; } + /// + /// Executes the handler the fist time the view is loaded. + /// + /// The view. + /// The handler. public void ExecuteOnFirstLoad(object view, Action handler) { var activity = view as Activity; @@ -94,6 +124,11 @@ public class AndroidPlatformProvider : IPlatformProvider } + /// + /// Executes the handler the next time the view's LayoutUpdated event fires. + /// + /// The view. + /// The handler. public void ExecuteOnLayoutUpdated(object view, Action handler) { var activity = view as Activity; @@ -115,6 +150,13 @@ public class AndroidPlatformProvider : IPlatformProvider } } + /// + /// Get the close action for the specified view model. + /// + /// The view model to close. + /// The associated views. + /// The dialog result. + /// An to close the view model. public Action GetViewCloseAction(object viewModel, ICollection views, bool? dialogResult) { var child = viewModel as IChild; diff --git a/src/Caliburn.Micro.Platform/iOS/iOSPlatformProvider.cs b/src/Caliburn.Micro.Platform/iOS/iOSPlatformProvider.cs index df737853..76503885 100644 --- a/src/Caliburn.Micro.Platform/iOS/iOSPlatformProvider.cs +++ b/src/Caliburn.Micro.Platform/iOS/iOSPlatformProvider.cs @@ -15,16 +15,27 @@ public class IOSPlatformProvider : IPlatformProvider return NSThread.IsMain; } + /// + /// Indicates whether or not the framework is in design-time mode. + /// public bool InDesignMode { get { return false; } } + /// + /// Executes the action on the UI thread asynchronously. + /// + /// The action to execute. public void BeginOnUIThread(Action action) { UIApplication.SharedApplication.InvokeOnMainThread(action); } + /// + /// Executes the action on the UI thread asynchronously. + /// + /// The action to execute. public Task OnUIThreadAsync(Action action) { var completionSource = new TaskCompletionSource(); @@ -53,6 +64,10 @@ public Task OnUIThreadAsync(Action action) return completionSource.Task; } + /// + /// Executes the action on the UI thread. + /// + /// The action to execute. public void OnUIThread(Action action) { if (CheckAccess()) action(); @@ -60,11 +75,26 @@ public Task OnUIThreadAsync(Action action) OnUIThreadAsync(action).Wait(); } + /// + /// Used to retrieve the root, non-framework-created view. + /// + /// The view to search. + /// The root element that was not created by the framework. + /// In certain instances the services create UI elements. + /// For example, if you ask the window manager to show a UserControl as a dialog, it creates a window to host the UserControl in. + /// The WindowManager marks that element as a framework-created element so that it can determine what it created vs. what was intended by the developer. + /// Calling GetFirstNonGeneratedView allows the framework to discover what the original element was. + /// public object GetFirstNonGeneratedView(object view) { return view; } + /// + /// Executes the handler the fist time the view is loaded. + /// + /// The view. + /// The handler. public void ExecuteOnFirstLoad(object view, Action handler) { var viewController = view as IUIViewController; @@ -84,6 +114,11 @@ public void ExecuteOnFirstLoad(object view, Action handler) } } + /// + /// Executes the handler the next time the view's LayoutUpdated event fires. + /// + /// The view. + /// The handler. public void ExecuteOnLayoutUpdated(object view, Action handler) { var viewController = view as IUIViewController; @@ -103,6 +138,13 @@ public void ExecuteOnLayoutUpdated(object view, Action handler) } } + /// + /// Get the close action for the specified view model. + /// + /// The view model to close. + /// The associated views. + /// The dialog result. + /// An to close the view model. public Action GetViewCloseAction(object viewModel, ICollection views, bool? dialogResult) { var child = viewModel as IChild; diff --git a/src/Caliburn.Micro.Platform/win8/INavigationService.cs b/src/Caliburn.Micro.Platform/win8/INavigationService.cs index 1596bc09..560ab27b 100644 --- a/src/Caliburn.Micro.Platform/win8/INavigationService.cs +++ b/src/Caliburn.Micro.Platform/win8/INavigationService.cs @@ -15,7 +15,7 @@ namespace Caliburn.Micro { #endif /// - /// Implemented by services that provide ( based) navigation. + /// Implemented by services that provide ( based) navigation. /// public interface INavigationService { /// diff --git a/src/Caliburn.Micro.Platform/xforms/AttachedCollection.cs b/src/Caliburn.Micro.Platform/xforms/AttachedCollection.cs index 452c23a4..51640756 100644 --- a/src/Caliburn.Micro.Platform/xforms/AttachedCollection.cs +++ b/src/Caliburn.Micro.Platform/xforms/AttachedCollection.cs @@ -61,6 +61,10 @@ public void Attach(BindableObject dependencyObject) } } + /// + /// Raises the event with the provided arguments. + /// + /// Arguments of the event being raised. protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e) { base.OnCollectionChanged(e); diff --git a/src/Caliburn.Micro.sln.DotSettings b/src/Caliburn.Micro.sln.DotSettings index c43ef719..d0f94004 100644 --- a/src/Caliburn.Micro.sln.DotSettings +++ b/src/Caliburn.Micro.sln.DotSettings @@ -3,6 +3,7 @@ END_OF_LINE END_OF_LINE END_OF_LINE + UI <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> True