/// <summary>
        /// Get start point of the possible selection operation.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
        {
            base.OnMouseLeftButtonDown(e);

            DesignerCanvas designer = DiagramHelper.GetDiagramDesigner(this);

            if (designer != null)
            {
                // position relative to DesignerCanvas
                this.dragStartPoint = new Point?(e.GetPosition(designer));
                e.Handled           = true;
            }
        }
Beispiel #2
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="designer">Diagram designer.</param>
        /// <param name="sourceConnector">Source item of the relationship.</param>
        public DiagramConnectorAdorner(DesignerCanvas designer, DiagramConnector sourceConnector, Point startPoint)
            : base(designer)
        {
            this.diagramDesigner = designer;
            this.sourceConnector = sourceConnector;
            this.startPoint      = startPoint;

            sourceItem = sourceConnector.DiagramItem;

            drawingPen          = new Pen(Brushes.LightSlateGray, 1);
            drawingPen.LineJoin = PenLineJoin.Round;

            this.Cursor = Cursors.Cross;
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="designer">Diagram designer.</param>
        /// <param name="sourceConnector">Source item of the relationship.</param>
        public DiagramConnectorAdorner(DesignerCanvas designer, DiagramConnector sourceConnector, Point startPoint)
            : base(designer)
        {
            this.diagramDesigner = designer;
            this.sourceConnector = sourceConnector;
            this.startPoint = startPoint;

            sourceItem = sourceConnector.DiagramItem;

            drawingPen = new Pen(Brushes.LightSlateGray, 1);
            drawingPen.LineJoin = PenLineJoin.Round;

            this.Cursor = Cursors.Cross;
        }
Beispiel #4
0
        private static void SelectedItemsPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
        {
            DesignerCanvas designer = obj as DesignerCanvas;

            if (designer != null)
            {
                if (designer.SelectedItems == null)
                {
                    designer.SelectionService.ClearSelection(false);
                }
                else
                {
                    if (designer.SelectedItems.Count == 0)
                    {
                        designer.SelectionService.ClearSelection(false);
                    }
                    else
                    {
                    }
                }
            }
        }
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="diagramDesigner">Designer for which this service is to be initialized.</param>
 public SelectionService(DesignerCanvas diagramDesigner)
 {
     this.currentSelection = new List<ISelectable>();
     this.diagramDesigner = diagramDesigner;
 }
Beispiel #6
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="diagramDesigner">Designer for which this service is to be initialized.</param>
 public SelectionService(DesignerCanvas diagramDesigner)
 {
     this.currentSelection = new List <ISelectable>();
     this.diagramDesigner  = diagramDesigner;
 }