// Token: 0x060076F9 RID: 30457 RVA: 0x0021FE80 File Offset: 0x0021E080 private CollectionRecord EnsureCollectionRecord(object collection, Func <object, object> GetSourceItem = null) { CollectionRecord collectionRecord = this[collection]; if (collectionRecord == null) { collectionRecord = new CollectionRecord(); this.Add(collection, collectionRecord); object parent = (GetSourceItem != null) ? GetSourceItem(collection) : null; IEnumerable enumerable = collection as IEnumerable; if (enumerable != null) { BindingOperations.OnCollectionRegistering(enumerable, parent); } } return(collectionRecord); }
// return the CollectionRecord for the given collection. If one doesn't // exist yet, create it and raise the CollectionRegistering event CollectionRecord EnsureCollectionRecord(object collection, Func <object, object> GetSourceItem = null) { CollectionRecord cr = this[collection]; if (cr == null) { cr = new CollectionRecord(); Add(collection, cr); object parent = (GetSourceItem != null) ? GetSourceItem(collection) : null; IEnumerable ie = collection as IEnumerable; if (ie != null) { BindingOperations.OnCollectionRegistering(ie, parent); } } return(cr); }