public override NodeControl RenderChildren(RenderingContextInfo info)
        {
            if (_nodeControl == null)
            {
                double centreX = GetSurfaceCentreX(info);
                double centreY = GetSurfaceCentreY(info);

                if (SkinName != "Focal")
                {
                    NodeLocationOrganiser locationOrganiser = new NodeLocationOrganiser();
                    locationOrganiser.CentreX = centreX;
                    locationOrganiser.CentreY = centreY;
                    locationOrganiser.NumberOfNodes = NodeCount;
                    locationOrganiser.Radius = GetRadius(info);

                    Location = locationOrganiser.GetLocation(this);
                }
                else
                {
                    double focalXLocation = centreX - (Skin.NodeSkinWidth / 2); // Centre the focal node image along the x-axis.
                    double focalYLocation = centreY - (Skin.NodeSkinHeight / 2); // Centre the focal node image along the y-axis.

                    Location = new Point(focalXLocation, focalYLocation);
                }

                _nodeControl = Skin.RenderSkinElements(Node, SkinName, SkinProperties);
            }

            return _nodeControl;
        }
Esempio n. 2
0
        public override NodeControl RenderChildren(RenderingContextInfo info)
        {
            if (_nodeControl == null)
            {
                double centreX = GetSurfaceCentreX(info);
                double centreY = GetSurfaceCentreY(info);

                if (SkinName != "Focal")
                {
                    NodeLocationOrganiser locationOrganiser = new NodeLocationOrganiser();
                    locationOrganiser.CentreX       = centreX;
                    locationOrganiser.CentreY       = centreY;
                    locationOrganiser.NumberOfNodes = NodeCount;
                    locationOrganiser.Radius        = GetRadius(info);

                    Location = locationOrganiser.GetLocation(this);
                }
                else
                {
                    double focalXLocation = centreX - (Skin.NodeSkinWidth / 2);  // Centre the focal node image along the x-axis.
                    double focalYLocation = centreY - (Skin.NodeSkinHeight / 2); // Centre the focal node image along the y-axis.

                    Location = new Point(focalXLocation, focalYLocation);
                }

                _nodeControl = Skin.RenderSkinElements(Node, SkinName, SkinProperties);
            }

            return(_nodeControl);
        }