public void RegisterGenericChild(IMethodParent parent, IMethodMember genericChild) { lock (syncObject) { if (this.disposing) { return; } if (!(genericChild is TMethod)) { throw new ArgumentException(ThrowHelper.GetExceptionMessage(ExceptionMessageId.ValueIsWrongType, "genericChild", genericChild.GetType().FullName, typeof(TMethod).FullName), "genericChild"); } if (this.genericChildCache == null) { this.genericChildCache = new Dictionary <IMethodParent, TMethod>(); } if (!genericChildCache.ContainsKey(parent)) { genericChildCache.Add(parent, (TMethod)genericChild); } } }