Replace old charting curves with new version

This commit is contained in:
2015-12-09 09:48:26 -05:00
parent 8fb8276a73
commit b95bb7dd17
15 changed files with 28 additions and 595 deletions
+21
View File
@@ -1,4 +1,5 @@
using System;
using System.Collections.Concurrent;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
@@ -8,6 +9,26 @@ using Fasterflect;
namespace LeafWeb.Core.Utility
{
public static class MemoizationExtensions
{
static Func<A, R> ThreadsafeMemoize<A, R>(this Func<A, R> f)
{
var cache = new ConcurrentDictionary<A, R>();
return argument => cache.GetOrAdd(argument, f);
}
//static Func<A, B, R> ThreadsafeMemoize<A, B, R>(this Func<A, B, R> f)
//{
// var cache = new ConcurrentDictionary<A, ConcurrentDictionary<B,R>>();
// return (a, b) =>
// {
// return cache.GetOrAdd(a, new ConcurrentDictionary<B, R>()).GetOrAdd(b, f);
// };
//}
}
public static class ReflectionExtensions
{
public static string GetPropertyDisplayName<T>(Expression<Func<T, object>> propertyExpression)