Esempio n. 1
0
        public void Dispose()
        {
            if (IsDisposed)
            {
                throw new ObjectDisposedException("Can't get access to disposed object.");
            }

            IsDisposed = true;
            RemoveRelationLine();
            ecosystemPathLine = default(EcosystemPathLine);
            aControl          = null;
            bControl          = null;
            frameworkElement  = null;
            panel             = null;
            ellipse           = null;
            curveLine         = null;
            Parent            = null;
        }
Esempio n. 2
0
        public bool DrawRelationLine(string ellipseColor = "#ffff", string lineColor = "#ffff")
        {
            if (IsDisposed)
            {
                throw new ObjectDisposedException("Can't get access to disposed object.");
            }
            if (ellipse != null)
            {
                return(false);
            }
            if (curveLine != null)
            {
                return(false);
            }

            ellipse = DrawPointer(frameworkElement, Parent, ellipseWidth, ellipseHeight, ellipseColor);
            aControl.childHolderGrid.Children.Add(ellipse);
            ellipse.UpdateLayout();

            curveLine   = DrawCurveLine(ellipse, Parent, aControl, lineColor);
            ellipse.Tag = curveLine;
            //panel.Children.Insert(panel.Children.Count - 1, curveLine);
            panel.Children.Insert(0, curveLine);
            curveLine.UpdateLayout();

            ecosystemPathLine = new EcosystemPathLine(((PathGeometry)curveLine.Data).Figures[0]);

            UpdatePositions();

            aControl.OnPositionChanged += Control_OnEventTriggered;
            bControl.OnPositionChanged += Control_OnEventTriggered;
            aControl.SizeChanged       += Control_OnEventTriggered;
            bControl.SizeChanged       += Control_OnEventTriggered;

            return(true);
        }