Exemple #1
0
 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();
 }
Exemple #2
0
    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();
    }
Exemple #3
0
 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();
 }
Exemple #4
0
 public void Add(Anchor anchor)
 {
     anchors.Add(anchor);
     OnSolutionChange?.Invoke();
 }