public override void delete(Forme_simple entry) { Type t = typeof(Polygone); Type t2 = entry.GetType(); if (t.Equals(t2)) { base.delete(entry); } else if (successor != null) { successor.delete(entry); } }
public override void createorupdate(Forme_simple entry) { Type t = typeof(Segment); Type t2 = entry.GetType(); if (t.Equals(t2)) { base.createorupdate(entry); } else if (successor != null) { successor.createorupdate(entry); } }
public override void createorupdate(Forme_simple entry) { Type t = typeof(Triangle); Type t2 = entry.GetType(); if (t.Equals(t2)) { base.createorupdate(entry); } else if (successor != null) { successor.createorupdate(entry); } }
public override void delete(Forme_simple entry) { Type t = typeof(Polygone); Type t2 = entry.GetType(); if (t.Equals(t2)) { base.delete(entry); } else if (successor != null) { successor.delete(entry); } }
public override void dessiner(Forme_simple entry, Graphics g) { Type t = typeof(Segment); Type t2 = entry.GetType(); if (t.Equals(t2)) { Segment s = (Segment)entry; Pen pen = new Pen(Color.FromArgb(entry.Couleur), 4); g.DrawLine(pen, s.Point1.X, s.Point1.Y, s.Point2.X, s.Point2.Y); } else if (successor != null) { successor.dessiner(entry, g); } }
public override void dessiner(Forme_simple entry, Graphics g) { Type t = typeof(Triangle); Type t2 = entry.GetType(); if (t.Equals(t2)) { Triangle tr = (Triangle)entry; SolidBrush brush = new SolidBrush(Color.FromArgb(entry.Couleur)); g.FillPolygon(brush, tr.Tableau_points); } else if (successor != null) { successor.dessiner(entry, g); } }
public override void contourSelection(Forme_simple forme, Graphics g, Color couleur) { Type t = typeof(Triangle); Type t2 = forme.GetType(); if (t.Equals(t2)) { Triangle tr = (Triangle)forme; Pen pen = new Pen(couleur, 10); //Couleur de selection g.DrawPolygon(pen, tr.Tableau_points); } else if (successor != null) { successor.contourSelection(forme, g, couleur); } }
public override void contourSelection(Forme_simple forme, Graphics g, Color couleur) { Type t = typeof(Rectangle); Type t2 = forme.GetType(); if (t.Equals(t2)) { Rectangle e = (Rectangle)forme; Pen pen = new Pen(couleur, 10); //Couleur de selection g.DrawRectangle(pen, e.Point1.X, e.Point1.Y, e.Largeur, e.Hauteur); } else if (successor != null) { successor.contourSelection(forme, g, couleur); } }
public override void dessiner(Forme_simple entry, Graphics g) { Type t = typeof(Rectangle); Type t2 = entry.GetType(); if (t.Equals(t2)) { Rectangle r = (Rectangle)entry; SolidBrush brush = new SolidBrush(Color.FromArgb(entry.Couleur)); g.FillRectangle(brush, r.Point1.X, r.Point1.Y, r.Largeur, r.Hauteur); } else if (successor != null) { successor.dessiner(entry, g); } }
public override void contourSelection(Forme_simple forme, Graphics g, Color couleur) { Type t = typeof(Segment); Type t2 = forme.GetType(); if (t.Equals(t2)) { Segment s = (Segment)forme; Pen pen = new Pen(couleur, 10); //Couleur de selection g.DrawLine(pen, s.Point1.X, s.Point1.Y, s.Point2.X, s.Point2.Y); } else if (successor != null) { successor.contourSelection(forme, g, couleur); } }
public override void contourSelection(Forme_simple forme, Graphics g, Color couleur) { Type t = typeof(Ellipse); Type t2 = forme.GetType(); if (t.Equals(t2)) { Ellipse e = (Ellipse)forme; //Pen pen = new Pen(Color.FromArgb(255, 0, 255, 0), 10); //Couleur de selection Pen pen = new Pen(couleur, 10); //Couleur de selection g.DrawEllipse(pen, e.Point1.X, e.Point1.Y, e.Largeur, e.Hauteur); } else if (successor != null) { successor.contourSelection(forme, g, couleur); } }
public override void contourSelection(Forme_simple forme, Graphics g, Color couleur) { Type t = typeof(Rectangle); Type t2 = forme.GetType(); if (t.Equals(t2)) { Rectangle e = (Rectangle)forme; Pen pen = new Pen(couleur, 10); //Couleur de selection g.DrawRectangle(pen, e.Point1.X, e.Point1.Y, e.Largeur, e.Hauteur); } else if (successor != null) { successor.contourSelection(forme, g, couleur); } }
public override void dessiner(Forme_simple entry, Graphics g) { Type t = typeof(Rectangle); Type t2 = entry.GetType(); if (t.Equals(t2)) { Rectangle r = (Rectangle)entry; SolidBrush brush = new SolidBrush(Color.FromArgb(entry.Couleur)); g.FillRectangle(brush, r.Point1.X, r.Point1.Y, r.Largeur, r.Hauteur); } else if (successor != null) { successor.dessiner(entry, g); } }
public override void contourSelection(Forme_simple forme, Graphics g, Color couleur) { Type t = typeof(Polygone); Type t2 = forme.GetType(); if (t.Equals(t2)) { Polygone e = (Polygone)forme; Pen pen = new Pen(couleur, 10); //Couleur de selection g.DrawPolygon(pen, e.Tableau_points); } else if (successor != null) { successor.contourSelection(forme, g, couleur); } }
public override void dessiner(Forme_simple entry, Graphics g) { Type t = typeof(Polygone); Type t2 = entry.GetType(); if (t.Equals(t2)) { Polygone p = (Polygone)entry; SolidBrush brush = new SolidBrush(Color.FromArgb(entry.Couleur)); g.FillPolygon(brush, p.Tableau_points); } else if (successor != null) { successor.dessiner(entry, g); } }
public override void contourSelection(Forme_simple forme, Graphics g, Color couleur) { Type t = typeof(Segment); Type t2 = forme.GetType(); if (t.Equals(t2)) { Segment s = (Segment)forme; Pen pen = new Pen(couleur, 10); //Couleur de selection g.DrawLine(pen, s.Point1.X, s.Point1.Y, s.Point2.X, s.Point2.Y); } else if (successor != null) { successor.contourSelection(forme, g, couleur); } }
public override void dessiner(Forme_simple entry, Graphics g) { Type t = typeof(Segment); Type t2 = entry.GetType(); if (t.Equals(t2)) { Segment s = (Segment)entry; Pen pen = new Pen(Color.FromArgb(entry.Couleur), 4); g.DrawLine(pen, s.Point1.X, s.Point1.Y, s.Point2.X, s.Point2.Y); } else if (successor != null) { successor.dessiner(entry, g); } }
public override void create(Forme_simple entry) { Type t = typeof(Ellipse); Type t2 = entry.GetType(); if (t.Equals(t2)) { base.create(entry); Ellipse e = (Ellipse)entry; //Données membres this._command.Parameters.AddWithValue("@x1", e.Point1.X); this._command.Parameters.AddWithValue("@y1", e.Point1.Y); this._command.Parameters.AddWithValue("@hauteur", e.Hauteur); this._command.Parameters.AddWithValue("@largeur", e.Largeur); //Définition des requetes String[] tabRequete = new String[] { //ellipse @"INSERT INTO ellipse(id, hauteur, largeur) VALUES (@id, @hauteur, @largeur);", //point @"INSERT INTO point(id, ordre, x, y) VALUES (@id, 1, @x1, @y1);" }; foreach (String r in tabRequete) { //Définition de la requete this._command.CommandText = r; try { //Execution de la requete this._command.ExecuteNonQuery(); } catch (MySqlException ex) { Console.WriteLine("Error: {0}", ex.ToString()); throw ex; } } } else if (successor != null) { successor.create(entry); } }
public override void create(Forme_simple entry) { Type t = typeof(Segment); Type t2 = entry.GetType(); if (t.Equals(t2)) { base.create(entry); Segment s = (Segment)entry; this._command.Parameters.AddWithValue("@x1", s.Point1.X); this._command.Parameters.AddWithValue("@y1", s.Point1.Y); this._command.Parameters.AddWithValue("@x2", s.Point2.X); this._command.Parameters.AddWithValue("@y2", s.Point2.Y); //Définition des requetes String[] tabRequete = new String[] { //segment @"INSERT INTO segment(id) VALUES (@id);", //point @"INSERT INTO point(id, ordre, x, y) VALUES (@id, 1, @x1, @y1);", @"INSERT INTO point(id, ordre, x, y) VALUES (@id, 2, @x2, @y2);" }; foreach (String r in tabRequete) { //Définition de la requete this._command.CommandText = r; try { //Execution de la requete this._command.ExecuteNonQuery(); } catch (MySqlException ex) { Console.WriteLine("Error: {0}", ex.ToString()); throw ex; } } } else if (successor != null) { successor.create(entry); } }
public override void contourSelection(Forme_simple forme, Graphics g, Color couleur) { Type t = typeof(Ellipse); Type t2 = forme.GetType(); if (t.Equals(t2)) { Ellipse e = (Ellipse)forme; //Pen pen = new Pen(Color.FromArgb(255, 0, 255, 0), 10); //Couleur de selection Pen pen = new Pen(couleur, 10); //Couleur de selection g.DrawEllipse(pen, e.Point1.X, e.Point1.Y, e.Largeur, e.Hauteur); } else if (successor != null) { successor.contourSelection(forme, g, couleur); } }
public override void update(Forme_simple entry) { Type t = typeof(Ellipse); Type t2 = entry.GetType(); if (t.Equals(t2)) { base.update(entry); Ellipse e = (Ellipse)entry; //Données membres this._command.Parameters.AddWithValue("@x1", e.Point1.X); this._command.Parameters.AddWithValue("@y1", e.Point1.Y); this._command.Parameters.AddWithValue("@hauteur", e.Hauteur); this._command.Parameters.AddWithValue("@largeur", e.Largeur); //Définition des requetes String[] tabRequete = new String[] { //ellipse @"UPDATE ellipse SET hauteur = @hauteur, largeur = @largeur WHERE id = @id;", //point @"UPDATE point SET x = @x1, y = @y1 WHERE id = @id AND ordre = 1;" }; foreach (String r in tabRequete) { //Définition de la requete this._command.CommandText = r; try { //Execution de la requete this._command.ExecuteNonQuery(); } catch (MySqlException ex) { Console.WriteLine("Error: {0}", ex.ToString()); throw ex; } } } else if (successor != null) { successor.update(entry); } }
public override void create(Forme_simple entry) { Type t = typeof(Ellipse); Type t2 = entry.GetType(); if (t.Equals(t2)) { base.create(entry); Ellipse e = (Ellipse)entry; //Données membres this._command.Parameters.AddWithValue("@x1", e.Point1.X); this._command.Parameters.AddWithValue("@y1", e.Point1.Y); this._command.Parameters.AddWithValue("@hauteur", e.Hauteur); this._command.Parameters.AddWithValue("@largeur", e.Largeur); //Définition des requetes String[] tabRequete = new String[] { //ellipse @"INSERT INTO ellipse(id, hauteur, largeur) VALUES (@id, @hauteur, @largeur);", //point @"INSERT INTO point(id, ordre, x, y) VALUES (@id, 1, @x1, @y1);" }; foreach (String r in tabRequete) { //Définition de la requete this._command.CommandText = r; try { //Execution de la requete this._command.ExecuteNonQuery(); } catch (MySqlException ex) { Console.WriteLine("Error: {0}", ex.ToString()); throw ex; } } } else if (successor != null) { successor.create(entry); } }
public override void update(Forme_simple entry) { Type t = typeof(Segment); Type t2 = entry.GetType(); if (t.Equals(t2)) { base.update(entry); Segment s = (Segment)entry; this._command.Parameters.AddWithValue("@x1", s.Point1.X); this._command.Parameters.AddWithValue("@y1", s.Point1.Y); this._command.Parameters.AddWithValue("@x2", s.Point2.X); this._command.Parameters.AddWithValue("@y2", s.Point2.Y); //Définition des requetes String[] tabRequete = new String[] { //point @"UPDATE point SET x = @x1, y = @y1 WHERE id = @id AND ordre = 1;", @"UPDATE point SET x = @x2, y = @y2 WHERE id = @id AND ordre = 2;" }; foreach (String r in tabRequete) { //Définition de la requete this._command.CommandText = r; try { //Execution de la requete this._command.ExecuteNonQuery(); } catch (MySqlException ex) { Console.WriteLine("Error: {0}", ex.ToString()); throw ex; } } } else if (successor != null) { successor.update(entry); } }
public override void create(Forme_simple entry) { Type t = typeof(Segment); Type t2 = entry.GetType(); if (t.Equals(t2)) { base.create(entry); Segment s = (Segment)entry; this._command.Parameters.AddWithValue("@x1", s.Point1.X); this._command.Parameters.AddWithValue("@y1", s.Point1.Y); this._command.Parameters.AddWithValue("@x2", s.Point2.X); this._command.Parameters.AddWithValue("@y2", s.Point2.Y); //Définition des requetes String[] tabRequete = new String[] { //segment @"INSERT INTO segment(id) VALUES (@id);", //point @"INSERT INTO point(id, ordre, x, y) VALUES (@id, 1, @x1, @y1);", @"INSERT INTO point(id, ordre, x, y) VALUES (@id, 2, @x2, @y2);" }; foreach (String r in tabRequete) { //Définition de la requete this._command.CommandText = r; try { //Execution de la requete this._command.ExecuteNonQuery(); } catch (MySqlException ex) { Console.WriteLine("Error: {0}", ex.ToString()); throw ex; } } } else if (successor != null) { successor.create(entry); } }
public override void create(Forme_simple entry) { Type t = typeof(Polygone); Type t2 = entry.GetType(); if (t.Equals(t2)) { base.create(entry); Polygone p = (Polygone)entry; //Définition des requetes List <String> tabRequete_poly = new List <String>(); //polygone tabRequete_poly.Add(@"INSERT INTO polygone(id) VALUES (@id);"); //point for (int i = 1; i <= p.Tableau_points.Length; i++) { tabRequete_poly.Add(@"INSERT INTO point(id, ordre, x, y) VALUES (@id, " + i + ", " + p.Tableau_points[i - 1].X + ", " + p.Tableau_points[i - 1].Y + ");"); } foreach (String r in tabRequete_poly) { //Définition de la requete this._command.CommandText = r; try { //Execution de la requete this._command.ExecuteNonQuery(); } catch (MySqlException ex) { Console.WriteLine("Error: {0}", ex.ToString()); throw ex; } } } else if (successor != null) { successor.create(entry); } }
public override void create(Forme_simple entry) { Type t = typeof(Polygone); Type t2 = entry.GetType(); if (t.Equals(t2)) { base.create(entry); Polygone p = (Polygone)entry; //Définition des requetes List<String> tabRequete_poly = new List<String>(); //polygone tabRequete_poly.Add(@"INSERT INTO polygone(id) VALUES (@id);"); //point for (int i = 1; i <= p.Tableau_points.Length; i++) { tabRequete_poly.Add(@"INSERT INTO point(id, ordre, x, y) VALUES (@id, " + i + ", " + p.Tableau_points[i - 1].X + ", " + p.Tableau_points[i - 1].Y + ");"); } foreach (String r in tabRequete_poly) { //Définition de la requete this._command.CommandText = r; try { //Execution de la requete this._command.ExecuteNonQuery(); } catch (MySqlException ex) { Console.WriteLine("Error: {0}", ex.ToString()); throw ex; } } } else if (successor != null) { successor.create(entry); } }
public override void update(Forme_simple entry) { Type t = typeof(Triangle); Type t2 = entry.GetType(); if (t.Equals(t2)) { base.update(entry); Triangle tr = (Triangle)entry; //Définition des requetes List <String> tabRequete_triangle = new List <String>(); //point for (int i = 1; i <= tr.Tableau_points.Length; i++) { tabRequete_triangle.Add(@"UPDATE point SET x = " + tr.Tableau_points[i - 1].X + ", y = " + tr.Tableau_points[i - 1].Y + " WHERE id = @id AND ordre = " + i + ";"); } foreach (String r in tabRequete_triangle) { //Définition de la requete this._command.CommandText = r; try { //Execution de la requete this._command.ExecuteNonQuery(); } catch (MySqlException ex) { Console.WriteLine("Error: {0}", ex.ToString()); throw ex; } } } else if (successor != null) { successor.update(entry); } }
public override void update(Forme_simple entry) { Type t = typeof(Segment); Type t2 = entry.GetType(); if (t.Equals(t2)) { base.update(entry); Segment s = (Segment)entry; this._command.Parameters.AddWithValue("@x1", s.Point1.X); this._command.Parameters.AddWithValue("@y1", s.Point1.Y); this._command.Parameters.AddWithValue("@x2", s.Point2.X); this._command.Parameters.AddWithValue("@y2", s.Point2.Y); //Définition des requetes String[] tabRequete = new String[] { //point @"UPDATE point SET x = @x1, y = @y1 WHERE id = @id AND ordre = 1;", @"UPDATE point SET x = @x2, y = @y2 WHERE id = @id AND ordre = 2;" }; foreach (String r in tabRequete) { //Définition de la requete this._command.CommandText = r; try { //Execution de la requete this._command.ExecuteNonQuery(); } catch (MySqlException ex) { Console.WriteLine("Error: {0}", ex.ToString()); throw ex; } } } else if (successor != null) { successor.update(entry); } }
public override void update(Forme_simple entry) { Type t = typeof(Triangle); Type t2 = entry.GetType(); if (t.Equals(t2)) { base.update(entry); Triangle tr = (Triangle)entry; //Définition des requetes List<String> tabRequete_triangle = new List<String>(); //point for (int i = 1; i <= tr.Tableau_points.Length; i++) { tabRequete_triangle.Add(@"UPDATE point SET x = " + tr.Tableau_points[i - 1].X + ", y = " + tr.Tableau_points[i - 1].Y + " WHERE id = @id AND ordre = " + i + ";"); } foreach (String r in tabRequete_triangle) { //Définition de la requete this._command.CommandText = r; try { //Execution de la requete this._command.ExecuteNonQuery(); } catch (MySqlException ex) { Console.WriteLine("Error: {0}", ex.ToString()); throw ex; } } } else if (successor != null) { successor.update(entry); } }
public override void update(Forme_simple entry) { Type t = typeof(Ellipse); Type t2 = entry.GetType(); if (t.Equals(t2)) { base.update(entry); Ellipse e = (Ellipse)entry; //Données membres this._command.Parameters.AddWithValue("@x1", e.Point1.X); this._command.Parameters.AddWithValue("@y1", e.Point1.Y); this._command.Parameters.AddWithValue("@hauteur", e.Hauteur); this._command.Parameters.AddWithValue("@largeur", e.Largeur); //Définition des requetes String[] tabRequete = new String[] { //ellipse @"UPDATE ellipse SET hauteur = @hauteur, largeur = @largeur WHERE id = @id;", //point @"UPDATE point SET x = @x1, y = @y1 WHERE id = @id AND ordre = 1;" }; foreach (String r in tabRequete) { //Définition de la requete this._command.CommandText = r; try { //Execution de la requete this._command.ExecuteNonQuery(); } catch (MySqlException ex) { Console.WriteLine("Error: {0}", ex.ToString()); throw ex; } } } else if (successor != null) { successor.update(entry); } }