Пример #1
0
        public Cell Unlink(Cell cell, bool bidirectional = true)
        {
            _Links[cell] = false;

            if (bidirectional)
            {
                cell.Unlink(this, false);
            }

            return(this);
        }
Пример #2
0
        public void TestUnlinkBidirectional()
        {
            var cell1 = new Cell();
            var cell2 = new Cell();

            cell1.Link(cell2);
            cell1.Unlink(cell2);

            Assert.IsFalse(cell1.IsLinked(cell2));
            Assert.IsFalse(cell2.IsLinked(cell1));
        }
Пример #3
0
 public void Unlink(Cell cell, bool bidirectional = true)
 {
     if (_links.ContainsKey(cell))
     {
         _links.Remove(cell);
     }
     if (bidirectional)
     {
         cell.Unlink(this, false);
     }
 }
Пример #4
0
        public void TestUnlink()
        {
            var cell1 = new Cell();
            var cell2 = new Cell();

            cell1.Link(cell2);
            cell1.Unlink(cell2, false);

            Assert.IsFalse(cell1.IsLinked(cell2));
            Assert.IsTrue(cell2.IsLinked(cell1));
        }
Пример #5
0
        public Cell Unlink(Cell cell, bool bidirectional = true)
        {
            _Links[cell] = false;

            if (bidirectional)
            {
                cell.Unlink(this, false);
            }

            return this;
        }