Exemple #1
0
        static void CreateSvgGroupElement(SvgElement parentNode, HtmlElement elem)
        {
            SvgVisualSpec   spec            = new SvgVisualSpec();
            SvgGroupElement svgGroupElement = new SvgGroupElement(spec, elem);

            parentNode.AddChild(svgGroupElement);
            foreach (WebDom.DomAttribute attr in elem.GetAttributeIterForward())
            {
                WebDom.WellknownName wellknownName = (WebDom.WellknownName)attr.LocalNameIndex;
                switch (wellknownName)
                {
                case WebDom.WellknownName.Svg_Fill:
                {
                    spec.ActualColor = CssValueParser.GetActualColor(attr.Value);
                }
                break;

                case WebDom.WellknownName.Svg_Stroke:
                {
                    spec.StrokeColor = CssValueParser.GetActualColor(attr.Value);
                }
                break;

                case WebDom.WellknownName.Svg_Stroke_Width:
                {
                    spec.StrokeWidth = UserMapUtil.ParseGenericLength(attr.Value);
                }
                break;

                default:
                {
                    //other attrs
                }
                break;
                }
            }

            CreateSvgBoxContent(svgGroupElement, elem);
        }
        //'g' element

        public SvgGroupElement(SvgVisualSpec spec, object controller)
            : base(controller)
        {
            this.spec = spec;
        }
 //'g' element
 public SvgGroupElement(SvgVisualSpec spec)
     : base(null)
 {
     this.spec = spec;
 }
Exemple #4
0
        static void CreateSvgGroupElement(SvgElement parentNode, HtmlElement elem)
        {
            SvgVisualSpec spec = new SvgVisualSpec();
            SvgGroupElement svgGroupElement = new SvgGroupElement(spec, elem);
            parentNode.AddChild(svgGroupElement);
            foreach (WebDom.DomAttribute attr in elem.GetAttributeIterForward())
            {
                WebDom.WellknownName wellknownName = (WebDom.WellknownName)attr.LocalNameIndex;
                switch (wellknownName)
                {
                    case WebDom.WellknownName.Svg_Fill:
                        {
                            spec.ActualColor = CssValueParser.GetActualColor(attr.Value);
                        }
                        break;
                    case WebDom.WellknownName.Svg_Stroke:
                        {
                            spec.StrokeColor = CssValueParser.GetActualColor(attr.Value);
                        }
                        break;
                    case WebDom.WellknownName.Svg_Stroke_Width:
                        {
                            spec.StrokeWidth = UserMapUtil.ParseGenericLength(attr.Value);
                        }
                        break;
                    default:
                        {
                            //other attrs
                        }
                        break;
                }
            }

            CreateSvgBoxContent(svgGroupElement, elem);
        }
        //'g' element

        public SvgGroupElement(SvgVisualSpec spec, object controller)
            : base(controller)
        {
            this.spec = spec;
        }