/// <summary> /// Adds a new child item that points to another item in the content hierarchy. /// /// <para> /// WARNING: This method does not check to see if the referred item is actually /// in the content hierarchy because of performance reasons of traversing /// up the ancestor's of the referred item. Programmers are warned /// to take caution. /// </para> /// /// <para> /// The proper way to enforce consistency is to ensure that referred item /// and the container share a common ancestor. /// </para> /// </summary> /// <param name="underlyingItem">An item that shares a common ancestor as this container, or is a direct child of this parent.</param> /// <returns>A new media item (referring to "underlyingItem") that is a child of this container.</returns> public IDvItem AddReference(IDvItem underlyingItem) { underlyingItem.LockReferenceList(); IDvItem newItem = underlyingItem.CreateReference(); this.AddObject(newItem, false); underlyingItem.UnlockReferenceList(); return(newItem); }
/// <summary> /// Adds a new child item that points to another item in the content hierarchy. /// /// <para> /// WARNING: This method does not check to see if the referred item is actually /// in the content hierarchy because of performance reasons of traversing /// up the ancestor's of the referred item. Programmers are warned /// to take caution. /// </para> /// /// <para> /// The proper way to enforce consistency is to ensure that referred item /// and the container share a common ancestor. /// </para> /// </summary> /// <param name="underlyingItem">An item that shares a common ancestor as this container, or is a direct child of this parent.</param> /// <returns>A new media item (referring to "underlyingItem") that is a child of this container.</returns> public IDvItem AddReference(IDvItem underlyingItem) { underlyingItem.LockReferenceList(); IDvItem newItem = underlyingItem.CreateReference(); this.AddObject(newItem, false); underlyingItem.UnlockReferenceList(); return newItem; }