public void Insert(int index, DeckPairModel value) { List.Insert(index, value); }
public void Remove(DeckPairModel value) { List.Remove(value); }
public bool Contains(DeckPairModel value) { return List.Contains(value); }
public int IndexOf(DeckPairModel value) { return List.IndexOf(value); }
public int Add(DeckPairModel value) { return List.Add(value); }
public int IndexOf(DeckPairModel value) { return(List.IndexOf(value)); }
public int Add(DeckPairModel value) { return(List.Add(value)); }
public bool Contains(DeckPairModel value) { return(List.Contains(value)); }
// Destroy a matching public void Unmatch( Guid LocalDeckId, Guid RemoteDeckId ) { DeckTraversalModel remoteModel = null; DeckTraversalModel localModel = null; using( this.m_Model.Workspace.Lock() ) { // Look up the RemoteDeckId using( Synchronizer.Lock( (~this.m_Model.Workspace.CurrentPresentation).SyncRoot ) ) { foreach( DeckTraversalModel m in (~this.m_Model.Workspace.CurrentPresentation).DeckTraversals ) { if( m.Id == RemoteDeckId ) { remoteModel = m; break; } } } // Look up the LocalDeckId if( LocalDeckId == Guid.Empty ) localModel = remoteModel; else { foreach( DeckTraversalModel m in this.m_Model.Workspace.DeckTraversals ) { if( m.Id == LocalDeckId ) { localModel = m; break; } } } } // Ensure the model actually exists if( localModel == null || remoteModel == null) return; // Add a matching to the Matched Deck's List this.m_MatchedControls.RemoveMatch( LocalDeckId, RemoteDeckId ); // Prevent Duplicates from being inserted into the local list if( LocalDeckId == Guid.Empty ) this.m_UnmatchedControls.RemoveLocal( RemoteDeckId ); else { this.m_UnmatchedControls.RemoveLocal( LocalDeckId ); this.m_UnmatchedControls.AddLocal( localModel ); } // Return the item to the remote list this.m_UnmatchedControls.RemoveRemote( RemoteDeckId ); this.m_UnmatchedControls.AddRemote( remoteModel ); // Add a matching to the Matched Deck's List using( this.m_Model.Workspace.Lock() ) { DeckPairModel toRemove = new DeckPairModel( localModel, remoteModel ); if( this.m_Model.Workspace.DeckMatches.Contains( toRemove ) ) this.m_Model.Workspace.DeckMatches.Remove( toRemove ); } }