Exemple #1
0
 private void ConnectVisuals()
 {
     if (SelectedShapes == null || SelectedShapes.Count() != 2)
     {
         return;
     }
     AddConnection(SelectedShapes.First(), SelectedShapes.Last());
 }
Exemple #2
0
        private void EditorCanvas_Draw(CanvasControl sender, CanvasDrawEventArgs args)
        {
            var ds    = args.DrawingSession;
            var scale = EditSize / 2;

            DrawEditorBackgroundGrid(ds);

            if (EditContact == Edit_Contact.Contacts)
            {
                foreach (var shape in SymbolShapes)
                {
                    var strokeWidth = shape.StrokeWidth * 5;
                    shape.Draw(EditorCanvas, ds, scale, Center, strokeWidth, Shape.Coloring.Light);
                }

                DrawTargetContacts(ds);
            }
            else
            {
                if (SelectedShapes.Count > 0)
                {
                    foreach (var shape in SymbolShapes)
                    {
                        var coloring    = SelectedShapes.Contains(shape) ? Shape.Coloring.Light : Shape.Coloring.Gray;
                        var strokeWidth = shape.StrokeWidth * 5;
                        shape.Draw(EditorCanvas, ds, scale, Center, strokeWidth, coloring);
                    }

                    _polylineTarget = SelectedShapes.First() as Polyline;
                    _targetPoints.Clear();
                    Shape.DrawTargets(SelectedShapes, _targetPoints, ds, scale, Center);
                }
                else
                {
                    foreach (var shape in SymbolShapes)
                    {
                        var strokeWidth = shape.StrokeWidth * 5;
                        shape.Draw(EditorCanvas, ds, scale, Center, strokeWidth, Shape.Coloring.Normal);
                    }
                }
                SymbolCanvas.Invalidate();
                SelectorCanvas.Invalidate();
            }
        }