public DvMediaReference AddDvMediaReference(DvMediaItem underlyingItem) { underlyingItem.LockReferenceList(); DvMediaReference newItem = underlyingItem.CreateDvMediaReference(); this.AddObject(newItem, false); underlyingItem.UnlockReferenceList(); return(newItem); }
/// <summary> /// This method should only be used when deserializing a media items. /// /// <para> /// A media item can point to another media item. The item doing the pointing /// is called the reference item. The item that is being pointed to is the /// underlying item. /// </para> /// /// <para> /// The standard binary serialization process destroys the object reference /// between a reference item and its underlying item. This method provides a means /// to restore the reference relationship. /// </para> /// </summary> /// <param name="underlyingItem"> /// The media item that is being referred. /// </param> /// <param name="refItem"> /// The media item that is doing the referring. /// </param> public static void AttachRefItem(DvMediaItem underlyingItem, DvMediaItem refItem) { underlyingItem.LockReferenceList(); if (underlyingItem.m_ReferringItems == null) { underlyingItem.m_ReferringItems = new ArrayList(); } //underlyingItem.m_ReferringItems.Add(new WeakReference(refItem)); underlyingItem.m_ReferringItems.Add(refItem); // Just to avoid confusion - a refitem is actually an underlying item. // The naming convention follows the AV spec - the spec opted to use // "refID" notation instead of using "underlyingItem"... refItem.m_RefItem = underlyingItem; refItem.m_RefID = ""; underlyingItem.UnlockReferenceList(); }
public DvMediaReference AddDvMediaReference(DvMediaItem underlyingItem) { underlyingItem.LockReferenceList(); DvMediaReference newItem = underlyingItem.CreateDvMediaReference(); this.AddObject(newItem, false); underlyingItem.UnlockReferenceList(); return newItem; }