Пример #1
0
 public void UnregisterGenericChild(IMethodParent parent)
 {
     lock (syncObject)
     {
         if (this.genericChildCache == null || this.disposing)
         {
             return;
         }
         TMethod toDispose;
         if (genericChildCache.TryGetValue(parent, out toDispose))
         {
             toDispose.Dispose();
             genericChildCache.Remove(parent);
         }
     }
 }
Пример #2
0
 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);
         }
     }
 }
Пример #3
0
 public void UnregisterGenericChild(IMethodParent parent)
 {
     throw new NotSupportedException();
 }
Пример #4
0
 public void RegisterGenericChild(IMethodParent parent, IMethodMember genericChild)
 {
     throw new NotSupportedException();
 }
Пример #5
0
 public void UnregisterGenericChild(IMethodParent parent)
 {
     this.CheckGenericCache();
     this.genericCache.UnregisterGenericChild(parent);
 }
Пример #6
0
 public void RegisterGenericChild(IMethodParent parent, IMethodMember genericChild)
 {
     this.CheckGenericCache();
     this.genericCache.RegisterGenericChild(parent, genericChild);
 }