private bool TryGetResult(TArg arg, out Memoizer <TArg, TResult> .Result result)
 {
     this._lock.EnterReadLock();
     try
     {
         return(this._resultCache.TryGetValue(arg, out result));
     }
     finally
     {
         this._lock.ExitReadLock();
     }
 }
        internal TResult Evaluate(TArg arg)
        {
            Memoizer <TArg, TResult> .Result result;
            if (!this.TryGetResult(arg, out result))
            {
                this._lock.EnterWriteLock();
                try
                {
                    if (!this._resultCache.TryGetValue(arg, out result))
                    {
                        result = new Memoizer <TArg, TResult> .Result((Func <TResult>)(() => this._function(arg)));

                        this._resultCache.Add(arg, result);
                    }
                }
                finally
                {
                    this._lock.ExitWriteLock();
                }
            }
            return(result.GetValue());
        }