コード例 #1
0
        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);
                    }
                }
            }
        }
コード例 #2
0
ファイル: RPCMethodCache.cs プロジェクト: waqashaneef/NosDB
        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() + ")");
                    }
                }
            }
        }