Skip to content

Commit

Permalink
Updated to v2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCodeTraveler committed Jan 12, 2019
1 parent aa8d07d commit a029068
Show file tree
Hide file tree
Showing 15 changed files with 943 additions and 829 deletions.
4 changes: 2 additions & 2 deletions Src/AsyncAwaitBestPractices.MVVM.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata minClientVersion="2.5">
<id>AsyncAwaitBestPractices.MVVM</id>
<version>2.1.0-pre1</version>
<version>2.1.0</version>
<title>Task Extensions for MVVM</title>
<authors>Brandon Minnick, John Thiriet</authors>
<owners>Brandon Minnick</owners>
Expand All @@ -14,7 +14,7 @@
<summary>Includes AsyncCommand and IAsyncCommand which allows ICommand to safely be used asynchronously with Task.</summary>
<tags>task,fire and forget, threading, extensions, system.threading.tasks,async,await</tags>
<dependencies>
<dependency id="AsyncAwaitBestPractices" version="2.1.0-pre1" />
<dependency id="AsyncAwaitBestPractices" version="2.1.0" />
</dependencies>
<releaseNotes>
New In This Release:
Expand Down
4 changes: 2 additions & 2 deletions Src/AsyncAwaitBestPractices.MVVM/AsyncCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ public sealed class AsyncCommand : IAsyncCommand
/// Initializes a new instance of the <see cref="T:TaskExtensions.MVVM.AsyncCommand`1"/> class.
/// </summary>
/// <param name="execute">The Function executed when Execute or ExecuteAysnc is called. This does not check canExecute before executing and will execute even if canExecute is false</param>
/// <param name="continueOnCapturedContext">If set to <c>true</c> continue on captured context; this will ensure that the Synchronization Context returns to the calling thread. If set to <c>false</c> continue on a different context; this will allow the Synchronization Context to continue on a different thread</param>
/// <param name="onException">If an exception is thrown in the Task, <c>onException</c> will execute. If onException is null, the exception will be re-thrown</param>
/// <param name="canExecute">The Function that verifies whether or not AsyncCommand should execute.</param>
/// <param name="onException">If an exception is thrown in the Task, <c>onException</c> will execute. If onException is null, the exception will be re-thrown</param>
/// <param name="continueOnCapturedContext">If set to <c>true</c> continue on captured context; this will ensure that the Synchronization Context returns to the calling thread. If set to <c>false</c> continue on a different context; this will allow the Synchronization Context to continue on a different thread</param>
public AsyncCommand(Func<Task> execute,
Func<object, bool> canExecute = null,
Action<Exception> onException = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@
<ItemGroup>
<ProjectReference Include="..\AsyncAwaitBestPractices.MVVM\AsyncAwaitBestPractices.MVVM.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="WeakEventManager\" />
</ItemGroup>
</Project>
20 changes: 20 additions & 0 deletions Src/AsyncAwaitBestPractices.UnitTests/BaseTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,27 @@ namespace AsyncAwaitBestPractices.UnitTests
{
public abstract class BaseTest
{
#region Constant Fields
protected const int Delay = 500;
protected readonly WeakEventManager _testWeakEventManager = new WeakEventManager();
protected readonly WeakEventManager<string> _testStringWeakEventManager = new WeakEventManager<string>();
#endregion

#region Events
protected event EventHandler TestEvent
{
add => _testWeakEventManager.AddEventHandler(value);
remove => _testWeakEventManager.RemoveEventHandler(value);
}

protected event EventHandler<string> TestStringEvent
{
add => _testStringWeakEventManager.AddEventHandler(value);
remove => _testStringWeakEventManager.RemoveEventHandler(value);
}
#endregion

#region Methods
protected Task NoParameterTask() => Task.Delay(Delay);
protected Task IntParameterTask(int delay) => Task.Delay(delay);
protected Task StringParameterTask(string text) => Task.Delay(Delay);
Expand All @@ -15,5 +34,6 @@ public abstract class BaseTest

protected bool CanExecuteTrue(object parameter) => true;
protected bool CanExecuteFalse(object parameter) => false;
#endregion
}
}
Loading

0 comments on commit a029068

Please sign in to comment.