예제 #1
0
        public void Dump(XmlWriter writer, SwfTagCode shapeType)
        {
            writer.WriteStartElement("line-style");
            writer.WriteAttributeString("width", Width.ToString());
            if (shapeType == SwfTagCode.DefineMorphShape)
            {
                writer.WriteAttributeString("end-width", EndWidth.ToString());
                writer.WriteAttributeString("color", Color.ToHtmlHex());
                writer.WriteAttributeString("end-color", EndColor.ToHtmlHex());
            }
            else if (shapeType == SwfTagCode.DefineShape4 || shapeType == SwfTagCode.DefineMorphShape2)
            {
                bool isMorph = shapeType == SwfTagCode.DefineMorphShape2;
                if (isMorph)
                {
                    writer.WriteAttributeString("end-width", EndWidth.ToString());
                }

                writer.WriteAttributeString("start-cap", StartCapStyle.ToString());
                writer.WriteAttributeString("end-cap", EndCapStyle.ToString());
                writer.WriteAttributeString("flags", Flags.ToString());

                if (JoinStyle == SwfJoinStyle.Miter)
                {
                    writer.WriteAttributeString("miter-limit", MiterLimit.ToString());
                }

                if (Fill != null)
                {
                    Fill.Dump(writer, shapeType);
                }
                else
                {
                    writer.WriteAttributeString("color", Color.ToHtmlHex());
                    if (isMorph)
                    {
                        writer.WriteAttributeString("end-color", EndColor.ToHtmlHex());
                    }
                }
            }
            else
            {
                writer.WriteAttributeString("color", Color.ToHtmlHex(shapeType == SwfTagCode.DefineShape3));
            }
            writer.WriteEndElement();
        }