NotifyAttached() public method

Internal method to notify a page that it is attached
public NotifyAttached ( PagedWorldSection parent ) : void
parent PagedWorldSection
return void
Beispiel #1
0
 /// <summary>
 /// Detach a page to this section. 
 /// </summary>
 /// <param name="page"></param>
 public virtual void DetachPage(Page page)
 {
     Page pageFound;
     if (mPages.TryGetValue(page.PageID, out pageFound))
     {
         if (page != pageFound)
         {
             mPages.Remove(pageFound.PageID);
             page.NotifyAttached(null);
         }
     }
 }
Beispiel #2
0
        /// <summary>
        /// Attach a page to this section. 
        /// </summary>
        /// <param name="page"></param>
        public virtual void AttachPage(Page page)
        {
            if (mPages.ContainsKey(page.PageID))
            {
                //page with this id allready in map
                Page existingPage;
                mPages.TryGetValue(page.PageID,out existingPage);

                if (existingPage != page)
                {
                    Manager.Queue.CancelOperationsForPage(existingPage);
                    mPages.Remove(existingPage.PageID);
                    existingPage = null;
                }
            }
            page.NotifyAttached(this);
        }