Skip to content

Commit

Permalink
StyleCop changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Teodor92 committed Mar 4, 2016
1 parent 6bffb9e commit 755a526
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
30 changes: 15 additions & 15 deletions Source/MoreDotNet/Extentions/LockExtentions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@

public static class LockExtentions
{
//public static IDisposable GetReadLock(this ReaderWriterLockSlim slimLock)
//{
// slimLock.EnterReadLock();
// return new DisposableAction(slimLock.ExitReadLock);
//}
////public static IDisposable GetReadLock(this ReaderWriterLockSlim slimLock)
////{
//// slimLock.EnterReadLock();
//// return new DisposableAction(slimLock.ExitReadLock);
////}

//public static IDisposable GetWriteLock(this ReaderWriterLockSlim slimLock)
//{
// slimLock.EnterWriteLock();
// return new DisposableAction(slimLock.ExitWriteLock);
//}
////public static IDisposable GetWriteLock(this ReaderWriterLockSlim slimLock)
////{
//// slimLock.EnterWriteLock();
//// return new DisposableAction(slimLock.ExitWriteLock);
////}

//public static IDisposable GetUpgradeableReadLock(this ReaderWriterLockSlim slimLock)
//{
// slimLock.EnterUpgradeableReadLock();
// return new DisposableAction(slimLock.ExitUpgradeableReadLock);
//}
////public static IDisposable GetUpgradeableReadLock(this ReaderWriterLockSlim slimLock)
////{
//// slimLock.EnterUpgradeableReadLock();
//// return new DisposableAction(slimLock.ExitUpgradeableReadLock);
////}
}
}
4 changes: 2 additions & 2 deletions Source/MoreDotNet/Extentions/StringExtentions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,12 @@ public static bool IsLike(this string s, string wildcardPattern)
return result;
}


// TODO: Review
public static string ToReadableTime(this DateTime value)
{
TimeSpan span = DateTime.Now.Subtract(value);
const string Plural = "s";


if (span.Days > 7)
{
return value.ToShortDateString();
Expand All @@ -104,13 +102,15 @@ public static string ToReadableTime(this DateTime value)
span.Seconds,
span.Seconds != 1 ? Plural : string.Empty);
}

return string.Format(
"{0} minute{1} ago",
span.Minutes,
span.Minutes != 1 ? Plural : string.Empty);
default:
return string.Format("{0} hour{1} ago", span.Hours, span.Hours != 1 ? Plural : string.Empty);
}

default:
return string.Format("{0} day{1} ago", span.Days, span.Days != 1 ? Plural : string.Empty);
}
Expand Down

0 comments on commit 755a526

Please # to comment.