Skip to content

Commit

Permalink
Fix up minor compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nigel-sampson committed Dec 28, 2015
1 parent f46717a commit c4c3040
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 6 deletions.
Expand Up @@ -59,11 +59,6 @@
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Collections" />
<Reference Include="System.ObjectModel" />
<Reference Include="System.Reflection" />
<Reference Include="System.Runtime" />
<Reference Include="System.Threading.Tasks" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Xamarin.iOS" />
Expand Down
42 changes: 42 additions & 0 deletions src/Caliburn.Micro.Platform/android/AndroidPlatformProvider.cs
Expand Up @@ -26,15 +26,26 @@ public class AndroidPlatformProvider : IPlatformProvider
return SynchronizationContext.Current != null;
}

/// <summary>
/// Indicates whether or not the framework is in design-time mode.
/// </summary>
public bool InDesignMode {
get { return false; }
}

/// <summary>
/// Executes the action on the UI thread asynchronously.
/// </summary>
/// <param name="action">The action to execute.</param>
public void BeginOnUIThread(Action action) {

Application.SynchronizationContext.Post(s => action(), null);
}

/// <summary>
/// Executes the action on the UI thread asynchronously.
/// </summary>
/// <param name = "action">The action to execute.</param>
public Task OnUIThreadAsync(Action action) {

var completionSource = new TaskCompletionSource<bool>();
Expand All @@ -60,6 +71,10 @@ public class AndroidPlatformProvider : IPlatformProvider
return completionSource.Task;
}

/// <summary>
/// Executes the action on the UI thread.
/// </summary>
/// <param name = "action">The action to execute.</param>
public void OnUIThread(Action action) {

if (CheckAccess())
Expand All @@ -68,10 +83,25 @@ public class AndroidPlatformProvider : IPlatformProvider
OnUIThreadAsync(action).Wait();
}

/// <summary>
/// Used to retrieve the root, non-framework-created view.
/// </summary>
/// <param name="view">The view to search.</param>
/// <returns>The root element that was not created by the framework.</returns>
/// <remarks>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.
/// </remarks>
public object GetFirstNonGeneratedView(object view) {
return view;
}

/// <summary>
/// Executes the handler the fist time the view is loaded.
/// </summary>
/// <param name="view">The view.</param>
/// <param name="handler">The handler.</param>
public void ExecuteOnFirstLoad(object view, Action<object> handler) {

var activity = view as Activity;
Expand All @@ -94,6 +124,11 @@ public class AndroidPlatformProvider : IPlatformProvider

}

/// <summary>
/// Executes the handler the next time the view's LayoutUpdated event fires.
/// </summary>
/// <param name="view">The view.</param>
/// <param name="handler">The handler.</param>
public void ExecuteOnLayoutUpdated(object view, Action<object> handler) {
var activity = view as Activity;

Expand All @@ -115,6 +150,13 @@ public class AndroidPlatformProvider : IPlatformProvider
}
}

/// <summary>
/// Get the close action for the specified view model.
/// </summary>
/// <param name="viewModel">The view model to close.</param>
/// <param name="views">The associated views.</param>
/// <param name="dialogResult">The dialog result.</param>
/// <returns>An <see cref="Action"/> to close the view model.</returns>
public Action GetViewCloseAction(object viewModel, ICollection<object> views, bool? dialogResult) {

var child = viewModel as IChild;
Expand Down
42 changes: 42 additions & 0 deletions src/Caliburn.Micro.Platform/iOS/iOSPlatformProvider.cs
Expand Up @@ -15,16 +15,27 @@ public class IOSPlatformProvider : IPlatformProvider
return NSThread.IsMain;
}

/// <summary>
/// Indicates whether or not the framework is in design-time mode.
/// </summary>
public bool InDesignMode
{
get { return false; }
}

/// <summary>
/// Executes the action on the UI thread asynchronously.
/// </summary>
/// <param name="action">The action to execute.</param>
public void BeginOnUIThread(Action action)
{
UIApplication.SharedApplication.InvokeOnMainThread(action);
}

/// <summary>
/// Executes the action on the UI thread asynchronously.
/// </summary>
/// <param name = "action">The action to execute.</param>
public Task OnUIThreadAsync(Action action)
{
var completionSource = new TaskCompletionSource<bool>();
Expand Down Expand Up @@ -53,18 +64,37 @@ public Task OnUIThreadAsync(Action action)
return completionSource.Task;
}

/// <summary>
/// Executes the action on the UI thread.
/// </summary>
/// <param name = "action">The action to execute.</param>
public void OnUIThread(Action action) {
if (CheckAccess())
action();
else
OnUIThreadAsync(action).Wait();
}

/// <summary>
/// Used to retrieve the root, non-framework-created view.
/// </summary>
/// <param name="view">The view to search.</param>
/// <returns>The root element that was not created by the framework.</returns>
/// <remarks>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.
/// </remarks>
public object GetFirstNonGeneratedView(object view)
{
return view;
}

/// <summary>
/// Executes the handler the fist time the view is loaded.
/// </summary>
/// <param name="view">The view.</param>
/// <param name="handler">The handler.</param>
public void ExecuteOnFirstLoad(object view, Action<object> handler)
{
var viewController = view as IUIViewController;
Expand All @@ -84,6 +114,11 @@ public void ExecuteOnFirstLoad(object view, Action<object> handler)
}
}

/// <summary>
/// Executes the handler the next time the view's LayoutUpdated event fires.
/// </summary>
/// <param name="view">The view.</param>
/// <param name="handler">The handler.</param>
public void ExecuteOnLayoutUpdated(object view, Action<object> handler)
{
var viewController = view as IUIViewController;
Expand All @@ -103,6 +138,13 @@ public void ExecuteOnLayoutUpdated(object view, Action<object> handler)
}
}

/// <summary>
/// Get the close action for the specified view model.
/// </summary>
/// <param name="viewModel">The view model to close.</param>
/// <param name="views">The associated views.</param>
/// <param name="dialogResult">The dialog result.</param>
/// <returns>An <see cref="Action"/> to close the view model.</returns>
public Action GetViewCloseAction(object viewModel, ICollection<object> views, bool? dialogResult)
{
var child = viewModel as IChild;
Expand Down
2 changes: 1 addition & 1 deletion src/Caliburn.Micro.Platform/win8/INavigationService.cs
Expand Up @@ -15,7 +15,7 @@ namespace Caliburn.Micro {
#endif

/// <summary>
/// Implemented by services that provide (<see cref="Uri" /> based) navigation.
/// Implemented by services that provide (<see cref="System.Uri" /> based) navigation.
/// </summary>
public interface INavigationService {
/// <summary>
Expand Down
4 changes: 4 additions & 0 deletions src/Caliburn.Micro.Platform/xforms/AttachedCollection.cs
Expand Up @@ -61,6 +61,10 @@ public void Attach(BindableObject dependencyObject)
}
}

/// <summary>
/// Raises the <see cref = "E:System.Collections.ObjectModel.ObservableCollection`1.CollectionChanged" /> event with the provided arguments.
/// </summary>
/// <param name = "e">Arguments of the event being raised.</param>
protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e) {
base.OnCollectionChanged(e);

Expand Down
1 change: 1 addition & 0 deletions src/Caliburn.Micro.sln.DotSettings
Expand Up @@ -3,6 +3,7 @@
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/INVOCABLE_DECLARATION_BRACES/@EntryValue">END_OF_LINE</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/OTHER_BRACES/@EntryValue">END_OF_LINE</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/TYPE_DECLARATION_BRACES/@EntryValue">END_OF_LINE</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=UI/@EntryIndexedValue">UI</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAddAccessorOwnerDeclarationBracesMigration/@EntryIndexedValue">True</s:Boolean>
Expand Down

0 comments on commit c4c3040

Please sign in to comment.