Exemple #1
0
        public void RenderDiagrams(DrawingGroup renderedGroup)
        {
            DrawingCollection drawings = renderedGroup.Children;
            int linkIndex = -1;
            int drawIndex = -1;

            for (int i = 0; i < drawings.Count; i++)
            {
                Drawing drawing = drawings[i];
                //string drawingName = SvgObject.GetName(drawing);
                string drawingName = SvgLink.GetKey(drawing);
                if (!string.IsNullOrWhiteSpace(drawingName) &&
                    string.Equals(drawingName, SvgObject.DrawLayer))
                {
                    drawIndex = i;
                }
                else if (!string.IsNullOrWhiteSpace(drawingName) &&
                         string.Equals(drawingName, SvgObject.LinksLayer))
                {
                    linkIndex = i;
                }
            }

            DrawingGroup mainGroups = null;

            if (drawIndex >= 0)
            {
                mainGroups = drawings[drawIndex] as DrawingGroup;
            }
            DrawingGroup linkGroups = null;

            if (linkIndex >= 0)
            {
                linkGroups = drawings[linkIndex] as DrawingGroup;
            }

            this.LoadDiagrams(renderedGroup, linkGroups, mainGroups);

            if (linkGroups != null)
            {
                _animationCanvas.LoadDiagrams(linkGroups, renderedGroup);
            }

            _bounds = _wholeDrawing.Bounds;

            this.InvalidateMeasure();
            this.InvalidateVisual();
        }
Exemple #2
0
        public void RenderDiagrams(DrawingGroup renderedGroup)
        {
            DrawingCollection drawings = renderedGroup.Children;
            int linkIndex = -1;
            int drawIndex = -1;

            for (int i = 0; i < drawings.Count; i++)
            {
                Drawing drawing = drawings[i];
                //string drawingName = drawing.GetValue(FrameworkElement.NameProperty) as string;
                string drawingName = SvgLink.GetKey(drawing);
                if (!String.IsNullOrEmpty(drawingName) &&
                    String.Equals(drawingName, SvgObject.DrawLayer))
                {
                    drawIndex = i;
                }
                else if (!String.IsNullOrEmpty(drawingName) &&
                         String.Equals(drawingName, SvgObject.LinksLayer))
                {
                    linkIndex = i;
                }
            }

            DrawingGroup mainGroups = null;

            if (drawIndex >= 0)
            {
                mainGroups = drawings[drawIndex] as DrawingGroup;
            }
            DrawingGroup linkGroups = null;

            if (linkIndex >= 0)
            {
                linkGroups = drawings[linkIndex] as DrawingGroup;
            }

            this.LoadDiagrams(renderedGroup, linkGroups, mainGroups);

            if (linkGroups != null)
            {
                _animationCanvas.LoadDiagrams(linkGroups, renderedGroup);
            }

            this.InvalidateMeasure();
            this.InvalidateVisual();
        }