public void Remove(Connection connection) { connections.RemoveAll(conn => { return ((conn.IdA == connection.IdA && conn.IdB == connection.IdB) || (conn.IdA == connection.IdB && conn.IdB == connection.IdA)); }); OnSolutionChange?.Invoke(); }
public void Add(Connection connection) { var hasConnection = connections.Any(conn => { return ((conn.IdA == connection.IdA && conn.IdB == connection.IdB) || (conn.IdA == connection.IdB && conn.IdB == connection.IdA)); }); if (hasConnection) { return; } connections.Add(connection); OnSolutionChange?.Invoke(); }
public void Remove(Anchor anchor) { anchors.RemoveAll(x => x.Id == anchor.Id); connections.RemoveAll(x => x.IdA == anchor.Id || x.IdB == anchor.Id); OnSolutionChange?.Invoke(); }
public void Add(Anchor anchor) { anchors.Add(anchor); OnSolutionChange?.Invoke(); }