/// <summary> /// Invoked after a cell has been removed from the model. This recursively /// removes the cell from its terminals and removes the mapping from the Id /// to the cell. /// </summary> /// <param name="cell">Cell that has been removed.</param> protected void CellRemoved(Object cell) { if (cell is mxICell) { mxICell mxc = (mxICell)cell; int childCount = mxc.ChildCount(); for (int i = 0; i < childCount; i++) { CellRemoved(mxc.GetChildAt(i)); } mxc.RemoveFromTerminal(true); mxc.RemoveFromTerminal(false); if (cells != null && mxc.Id != null) { cells.Remove(mxc.Id); } } }
/* (non-Dotnetdoc) * see com.mxgraph.mxICell.InsertEdge(mxICell, bool) */ public mxICell InsertEdge(mxICell edge, bool isOutgoing) { if (edge != null) { edge.RemoveFromTerminal(isOutgoing); edge.SetTerminal(this, isOutgoing); if (edges == null || edge.GetTerminal(!isOutgoing) != this || !edges.Contains(edge)) { if (edges == null) { edges = new List <mxICell>(); } edges.Add(edge); } } return(edge); }
/* (non-Dotnetdoc) * see com.mxgraph.mxICell.InsertEdge(mxICell, bool) */ public mxICell InsertEdge(mxICell edge, bool isOutgoing) { if (edge != null) { edge.RemoveFromTerminal(isOutgoing); edge.SetTerminal(this, isOutgoing); if (edges == null || edge.GetTerminal(!isOutgoing) != this || !edges.Contains(edge)) { if (edges == null) { edges = new List<mxICell>(); } edges.Add(edge); } } return edge; }