private void PopulateCache() { if (_targetObject != null) { ITargetMethod[] methods = _targetObject.GetAllMethods(); for (int i = 0; i < methods.Length; i++) { ITargetMethod method = methods[i]; string key = GetCacheKey(method.GetMethodName(), method.GetOverlaod()); if (!_cache.ContainsKey(key)) { _cache.Add(key, method); } } } }
private void PopulateCache() { if (_targetObject != null) { ITargetMethod[] methods = _targetObject.GetAllMethods(); for (int i = 0; i < methods.Length; i++) { ITargetMethod method = methods[i]; string key = GetCacheKey(method.GetMethodName(), method.GetOverlaod()); if (!_cache.ContainsKey(key)) { _cache.Add(key, method); } else { throw new Exception("Duplicate method exists in the target object. (Method :" + method.GetMethodName() + " , overlaod :" + method.GetOverlaod() + ")"); } } } }