Beispiel #1
0
 private void UpdateSelection()
 {
     ShapeSelection.BeginUpdate();
     ShapeSelection.Shapes
     .Where(p => !Scene.Shapes.Contains(p))
     .ToList()
     .ForEach(p => ShapeSelection.Remove(p));
     ShapeSelection.EndUpdate();
 }
Beispiel #2
0
        private void DeleteSelection()
        {
            if (ShapeSelection.IsEmpty)
            {
                return;
            }
            var indices = ShapeSelection.GetShapeIndices().OrderByDescending(p => p).ToList();

            foreach (var index in indices)
            {
                CommandCon.DeleteShape(index);
            }
            ShapeSelection.Clear();
        }
Beispiel #3
0
        private void EditPaste_Click(object sender, EventArgs e)
        {
            var shapes = JsonCon.ClipboardPaste().ToList();

            if (!shapes.Any())
            {
                return;
            }
            var index = Scene.Shapes.Count;

            foreach (var shape in shapes)
            {
                shape.Scene = Scene;
                Run(new ShapeInsertCommand(index++, shape));
            }
            ShapeSelection.Set(shapes);
        }
Beispiel #4
0
 private void EditSelectAll_Click(object sender, EventArgs e) => ShapeSelection.AddRange(Scene.Shapes);
Beispiel #5
0
 private void EditInvertSelection_Click(object sender, EventArgs e) => ShapeSelection.Set(Scene.Shapes.Where(p => !ShapeSelection.Shapes.Contains(p)).ToList());
Beispiel #6
0
 private void AddShape(Shape shape)
 {
     shape.Scene = Scene;
     CommandCon.AppendShape(shape);
     ShapeSelection.Set(new[] { shape });
 }
Beispiel #7
0
 protected override void RunShaderCommand(string text) => ShapeSelection.ForEach(p => Run(new ShapeShaderCommand(p.Index, ShaderType, text)));