System.Collections.ICollection IRefContainer.GetManagedRefs() { List <HeapRef> refs = new List <HeapRef> (); foreach (var keypair in strongRefs) { if (keypair.Value is INativeEventObjectWrapper) { refs.Add(new HeapRef(true, (INativeEventObjectWrapper)keypair.Value, NativeDependencyObjectHelper.IdToName(keypair.Key))); } } return(refs); }