Skip to content

Commit

Permalink
Add some comments and fix nuget
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmontemagno committed Dec 7, 2015
1 parent dda1dc7 commit 553e924
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 8 deletions.
6 changes: 2 additions & 4 deletions MvvmHelpers.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<owners>James Montemagno</owners>
<licenseUrl>https://raw.githubusercontent.com/jamesmontemagno/mvvm-helpers/master/LICENSE.md</licenseUrl>
<projectUrl>https://github.com/jamesmontemagno/mvvm-helpers</projectUrl>
<iconUrl></iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>
Collection of Mvvm Helpers such as ObservableRangeCollection, BaseViewModel, Grouping, and others.
Expand All @@ -22,8 +21,7 @@
</metadata>
<files>
<!--Core-->
<file src="MvvmHelpers\bin\Release\MvvmHelpers.dll" target="lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10+UAP10\MvvmHelpers.dll" />
<file src="MvvmHelpers\bin\Release\MvvmHelpers.xml" target="lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10+UAP10\MvvmHelpers.xml" />
<file src="MvvmHelpers\bin\Release\MvvmHelpers.pdb" target="lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10+UAP10\MvvmHelpers.pdb" />
<file src="MvvmHelpers/bin/Release/MvvmHelpers.dll" target="lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10+UAP10\MvvmHelpers.dll" />
<file src="MvvmHelpers/bin/Release/MvvmHelpers.xml" target="lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10+UAP10\MvvmHelpers.xml" />
</files>
</package>
17 changes: 14 additions & 3 deletions MvvmHelpers/Grouping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,26 @@

namespace MvvmHelpers
{
public class Grouping<T, TV> : ObservableCollection<TV>
/// <summary>
/// Grouping of items by key into ObservableRange
/// </summary>
public class Grouping<T, TV> : ObservableRangeCollection<TV>
{
/// <summary>
/// Gets the key.
/// </summary>
/// <value>The key.</value>
public T Key { get; private set; }

/// <summary>
/// Initializes a new instance of the Grouping class.
/// </summary>
/// <param name="key">Key.</param>
/// <param name="items">Items.</param>
public Grouping(T key, IList<TV> items)
{
Key = key;
foreach (var item in items)
Items.Add(item);
AddRange(items);
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion MvvmHelpers/ObservableObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

namespace MvvmHelpers
{
/// <summary>
/// Observable object with INotifyPropertyChanged implemented
/// </summary>
public class ObservableObject : INotifyPropertyChanged
{
/// <summary>
Expand All @@ -30,7 +33,9 @@ protected bool SetProperty<T>(
return true;
}


/// <summary>
/// Occurs when property changed.
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;
/// <summary>
/// Raises the property changed event.
Expand Down
10 changes: 10 additions & 0 deletions MvvmHelpers/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,18 @@

namespace MvvmHelpers
{
/// <summary>
/// Extension Utils
/// </summary>
public static class Utils
{
/// <summary>
/// Task extension to add a timeout.
/// </summary>
/// <returns>The timeout.</returns>
/// <param name="task">Task.</param>
/// <param name="duration">Duration.</param>
/// <typeparam name="T">The 1st type parameter.</typeparam>
public async static Task<T> WithTimeout<T>(this Task<T> task, int duration)
{
var retTask = await Task.WhenAny(task, Task.Delay(duration))
Expand Down

0 comments on commit 553e924

Please sign in to comment.