示例#1
0
 public void Insert(int index, DeckPairModel value)
 {
     List.Insert(index, value);
 }
示例#2
0
 public void Remove(DeckPairModel value)
 {
     List.Remove(value);
 }
示例#3
0
 public bool Contains(DeckPairModel value)
 {
     return List.Contains(value);
 }
示例#4
0
 public int IndexOf(DeckPairModel value)
 {
     return List.IndexOf(value);
 }
示例#5
0
 public void Insert(int index, DeckPairModel value)
 {
     List.Insert(index, value);
 }
示例#6
0
 public int Add(DeckPairModel value)
 {
     return List.Add(value);
 }
示例#7
0
 public int IndexOf(DeckPairModel value)
 {
     return(List.IndexOf(value));
 }
示例#8
0
 public int Add(DeckPairModel value)
 {
     return(List.Add(value));
 }
示例#9
0
 public bool Contains(DeckPairModel value)
 {
     return(List.Contains(value));
 }
示例#10
0
 public void Remove(DeckPairModel value)
 {
     List.Remove(value);
 }
示例#11
0
        // 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 );
            }
        }