/// <summary> /// Creates a matching between the two decks and recursively creates matchings amongst all /// child objects /// </summary> /// <param name="sender">The EventQueue to invoke async things on</param> /// <param name="srcDeck">The deck to marshal changes from</param> /// <param name="destDeck">The deck to marshal changes to</param> public DeckMatch( EventQueue sender, DeckModel srcDeck, DeckModel destDeck ) { this.m_Sender = sender; this.m_SrcDeck = srcDeck; this.m_DestDeck = destDeck; this.m_SlideMatches = new ArrayList(); this.m_TableOfContentsMatch = new TableOfContentsMatch( this.m_Sender, this.m_SrcDeck, this.m_DestDeck ); this.SetupInitialMappings(); this.m_SlideRemovedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_Sender, new PropertyEventHandler(this.HandleSlideRemoved)); this.m_SlideAddedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_Sender, new PropertyEventHandler(this.HandleSlideAdded)); this.m_SlideContentAddedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_Sender, new PropertyEventHandler(this.HandleSlideContentAdded)); // Lock the deck so no content can be added between registering the event listeners. using(Synchronizer.Lock(this.m_SrcDeck.SyncRoot)) { this.m_SrcDeck.SlideRemoved += this.m_SlideRemovedDispatcher.Dispatcher; this.m_SrcDeck.SlideAdded += this.m_SlideAddedDispatcher.Dispatcher; this.m_SrcDeck.SlideContentAdded += this.m_SlideContentAddedDispatcher.Dispatcher; } }
/// <summary> /// Creates a matching between the two decks and recursively creates matchings amongst all /// child objects /// </summary> /// <param name="sender">The EventQueue to invoke async things on</param> /// <param name="srcDeck">The deck to marshal changes from</param> /// <param name="destDeck">The deck to marshal changes to</param> public DeckMatch(EventQueue sender, DeckModel srcDeck, DeckModel destDeck) { this.m_Sender = sender; this.m_SrcDeck = srcDeck; this.m_DestDeck = destDeck; this.m_SlideMatches = new ArrayList(); this.m_TableOfContentsMatch = new TableOfContentsMatch(this.m_Sender, this.m_SrcDeck, this.m_DestDeck); this.SetupInitialMappings(); this.m_SlideRemovedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_Sender, new PropertyEventHandler(this.HandleSlideRemoved)); this.m_SlideAddedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_Sender, new PropertyEventHandler(this.HandleSlideAdded)); this.m_SlideContentAddedDispatcher = new EventQueue.PropertyEventDispatcher(this.m_Sender, new PropertyEventHandler(this.HandleSlideContentAdded)); // Lock the deck so no content can be added between registering the event listeners. using (Synchronizer.Lock(this.m_SrcDeck.SyncRoot)) { this.m_SrcDeck.SlideRemoved += this.m_SlideRemovedDispatcher.Dispatcher; this.m_SrcDeck.SlideAdded += this.m_SlideAddedDispatcher.Dispatcher; this.m_SrcDeck.SlideContentAdded += this.m_SlideContentAddedDispatcher.Dispatcher; } }
/// <summary> /// Construct the helper /// </summary> /// <param name="owner">Owner class</param> public EntriesCollectionHelper(TableOfContentsMatch owner) : base(owner.m_Sender, owner.m_SrcDeck.TableOfContents, "Entries") { this.m_Owner = owner; base.Initialize(); }