private void OnDeleteShape() { ShapesFullList.Remove(SelectedShape); ShapesFullList = new CustomList <Shape>(ShapesFullList); ApplyFilter(); SelectedShape = ShapesList.LastOrDefault(); }
protected void Page_Load(object sender, EventArgs e) { ShapesList.DataSource = new[] { new { ID = "Option", Text = "Option", Background = "#619eea" } }; ShapesList.DataBind(); }
public override void AddShape() { Point point1 = new Point(int.Parse(Point1X.Text), int.Parse(Point1Y.Text)); Rectangle rectangle = new Rectangle(new PolygonVisitor(), point1, int.Parse(Width.Text), int.Parse(Height.Text)); ShapesList.AddShape(rectangle); MessageBox.Show(@"Success"); Clean(); }
public override void AddShape() { Point point1 = new Point(int.Parse(Point1X.Text), int.Parse(Point1Y.Text)); Point point2 = new Point(int.Parse(Point2X.Text), int.Parse(Point2Y.Text)); Segment segment = new Segment(new PolygonVisitor(), point1, point2); ShapesList.AddShape(segment); Clean(); MessageBox.Show(@"Success"); }
public override void AddShape() { Point topleft = new Point(int.Parse(Point1X.Text), int.Parse(Point1Y.Text)); Square square = new Square(topleft, int.Parse(Width.Text)); ShapesList.AddShape(square); MessageBox.Show(@"Success"); Clean(); }
public override void AddShape() { int radius = int.Parse(RadiusX.Text); Point topLeft = new Point(int.Parse(X.Text) - radius, int.Parse(Y.Text) - radius); Circle circle = new Circle(topLeft, radius); ShapesList.AddShape(circle); MessageBox.Show(@"Success"); Clean(); }
public override void AddShape() { Point point1 = new Point(int.Parse(Point1X.Text), int.Parse(Point1Y.Text)); Point point2 = new Point(int.Parse(Point2X.Text), int.Parse(Point2Y.Text)); Point point3 = new Point(int.Parse(Point3X.Text), int.Parse(Point3Y.Text)); Triangle triangle = new Triangle(point1, point2, point3); ShapesList.AddShape(triangle); MessageBox.Show(@"Success"); Clean(); }
public override void AddShape() { Point point1 = new Point(int.Parse(Point1X.Text), int.Parse(Point1Y.Text)); Point point2 = new Point(int.Parse(Point2X.Text), int.Parse(Point2Y.Text)); Point point3 = new Point(int.Parse(Point3X.Text), int.Parse(Point3Y.Text)); Angle angle = new Angle(new DrawPolyline(), point1, point2, point3); ShapesList.AddShape(angle); MessageBox.Show(@"Success"); Clean(); }
public override void AddShape() { int radiusX = int.Parse(RadiusX.Text); int radiusY = int.Parse(RadiusY.Text); Point topLeft = new Point(int.Parse(X.Text) - radiusX, int.Parse(Y.Text) - radiusY); Ellipse ellipse = new Ellipse(topLeft, radiusX * 2, radiusY * 2); ShapesList.AddShape(ellipse); MessageBox.Show(@"Success"); Clean(); }
private void button2_Click(object sender, EventArgs e) { if (openFileDialog1.ShowDialog() == DialogResult.OK) { string processed = deprocessor.Deprocess(openFileDialog1.FileName); list = serializer.Deserialize(processed); listView1.Items.Clear(); foreach (Figure fig in list.list) { ListViewItem item = new ListViewItem(fig.Name); item.Tag = fig; listView1.Items.Add(item); } } panel1.Refresh(); }
private void button4_Click(object sender, EventArgs e) { if (ShapesList.SelectedItems.Count == 0) { Shapes.Clear(); ShapesList.Items.Clear(); pictureBox1.Refresh(); } for (int i = 0; i < ShapesList.Items.Count; i++) { if (ShapesList.GetSelected(i)) { DeleteShape(i); i--; } } }
private void iPaint_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { int q = 0; foreach (Shape obj in shapes) { if (obj.Near(e.Location)) { ShapesList.SetSelected(q, true); } q++; } } if (e.Button == MouseButtons.Left) { if (radioCross.Checked) { flag = false; this.Text = Convert.ToString(e.Location); addShape(tempShape); } else { if (!flag) { LS = e.Location; flag = true; } else { this.Text = Convert.ToString(e.Location) + " " + Convert.ToString(LS); addShape(tempShape); flag = false; } } Refresh(); } }
private void Form1_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { int q = 0; foreach (Shape shape in Shapes) { if (shape.IsNearTo(e.Location)) { ShapesList.SetSelected(q, true); } q++; } } if (e.Button == MouseButtons.Left) { this.Text = Convert.ToString(e.X) + " " + Convert.ToString(e.Y); if (RCross.Checked) { AddShape(tempShape); isShapeStart = true; } else { if (isShapeStart == true) { ShapeStart = e.Location; isShapeStart = false; } else { AddShape(tempShape); isShapeStart = true; } } Refresh(); } }
public ShapesList Deserialize(string jsonstring) { ShapesList Slist = JsonConvert.DeserializeObject <ShapesList>(jsonstring, settings); return(Slist); }
public string Serialize(ShapesList shapes) { string jsonstring = JsonConvert.SerializeObject(shapes, Formatting.Indented, settings); return(jsonstring); }