protected override void FormatTagElement(DefineEditTextTag tag, XElement xTag)
        {
            xTag.Add(new XElement(SIZE_ELEM, XRect.ToXml(tag.Bounds)));

            xTag.Add(new XAttribute(WORD_WRAP_ATTRIB, SwfMillPrimitives.GetStringValue(tag.WordWrap)));
            xTag.Add(new XAttribute(MULTILINE_ATTRIB, SwfMillPrimitives.GetStringValue(tag.Multiline)));
            xTag.Add(new XAttribute(PASSWORD_ATTRIB, SwfMillPrimitives.GetStringValue(tag.Password)));
            xTag.Add(new XAttribute(READONLY_ATTRIB, SwfMillPrimitives.GetStringValue(tag.ReadOnly)));

            xTag.Add(new XAttribute(AUTOSIZE_ATTRIB, SwfMillPrimitives.GetStringValue(tag.AutoSize)));
            xTag.Add(new XAttribute(HAS_LAYOUT_ATTRIB, CommonFormatter.Format(tag.HasLayout)));
            xTag.Add(new XAttribute(NOT_SELECTABLE_ATTRIB, CommonFormatter.Format(tag.NoSelect)));
            xTag.Add(new XAttribute(BORDER_ATTRIB, CommonFormatter.Format(tag.Border)));
            xTag.Add(new XAttribute("static", CommonFormatter.Format(tag.WasStatic)));
            xTag.Add(new XAttribute(IS_HTML_ATTRIB, CommonFormatter.Format(tag.HTML)));
            xTag.Add(new XAttribute(USE_OUTLINES_ATTRIB, CommonFormatter.Format(tag.UseOutlines)));

            if (tag.HasFont)
            {
                xTag.Add(new XAttribute(FONT_REF_ATTRIB, tag.FontID));
            }
            if (tag.FontClass != null)
            {
                xTag.Add(new XAttribute("fontClass", tag.FontClass));
            }
            if (tag.HasFont)
            {
                xTag.Add(new XAttribute(FONT_HEIGHT_ATTRIB, tag.FontHeight));
            }
            if (tag.TextColor.HasValue)
            {
                xTag.Add(new XElement("color", XColorRGBA.ToXml(tag.TextColor.Value)));
            }
            if (tag.MaxLength.HasValue)
            {
                xTag.Add(new XAttribute(MAX_LENGTH_ATTRIB, tag.MaxLength.Value));
            }
            if (tag.HasLayout)
            {
                xTag.Add(new XAttribute(ALIGN_ATTRIB, tag.Align));
                xTag.Add(new XAttribute(LEFT_MARGIN_ATTRIB, tag.LeftMargin));
                xTag.Add(new XAttribute(RIGHT_MARGIN_ATTRIB, tag.RightMargin));
                xTag.Add(new XAttribute(INDENT_ATTRIB, tag.Indent));
                xTag.Add(new XAttribute(LEADING_ATTRIB, tag.Leading));
            }
            xTag.Add(new XAttribute(VARIABLE_NAME_ATTRIB, tag.VariableName));
            if (tag.InitialText != null)
            {
                xTag.Add(new XAttribute(INITIAL_TEXT_ATTRIB, tag.InitialText));
            }
        }
        protected override bool AcceptTagAttribute(FileAttributesTag tag, XAttribute attrib)
        {
            switch (attrib.Name.LocalName)
            {
            case "reserved0":
                tag.Reserved0 = CommonFormatter.ParseBool(attrib.Value);
                break;

            case USE_DIRECT_BLIT:
                tag.UseDirectBlit = SwfMillPrimitives.ParseBoolean(attrib);
                break;

            case USE_GPU:
                tag.UseGPU = SwfMillPrimitives.ParseBoolean(attrib);
                break;

            case HAS_METADATA_ATTRIB:
                tag.HasMetadata = CommonFormatter.ParseBool(attrib.Value);
                break;

            case ALLOW_ABC_ATTRIB:
                tag.AllowAbc = CommonFormatter.ParseBool(attrib.Value);
                break;

            case SUPPRESS_CROSSDOMAIN_CACHING_ATTRIB:
                tag.SuppressCrossDomainCaching = CommonFormatter.ParseBool(attrib.Value);
                break;

            case SWF_RELATIVE_URLS_ATTRIB:
                tag.SwfRelativeUrls = CommonFormatter.ParseBool(attrib.Value);
                break;

            case USE_NETWORK_ATTRIB:
                tag.UseNetwork = CommonFormatter.ParseBool(attrib.Value);
                break;

            case "reserved":
                tag.Reserved = uint.Parse(attrib.Value);
                break;

            default:
                return(false);
            }
            return(true);
        }
        protected override bool AcceptTagAttribute(DefineEditTextTag tag, XAttribute attrib)
        {
            switch (attrib.Name.LocalName)
            {
            case INITIAL_TEXT_ATTRIB:
                tag.InitialText = attrib.Value;
                break;

            case WORD_WRAP_ATTRIB:
                tag.WordWrap = SwfMillPrimitives.ParseBoolean(attrib);
                break;

            case MULTILINE_ATTRIB:
                tag.Multiline = SwfMillPrimitives.ParseBoolean(attrib);
                break;

            case PASSWORD_ATTRIB:
                tag.Password = SwfMillPrimitives.ParseBoolean(attrib);
                break;

            case READONLY_ATTRIB:
                tag.ReadOnly = SwfMillPrimitives.ParseBoolean(attrib);
                break;

            case AUTOSIZE_ATTRIB:
                tag.AutoSize = SwfMillPrimitives.ParseBoolean(attrib);
                break;

            case HAS_LAYOUT_ATTRIB:
                tag.HasLayout = CommonFormatter.ParseBool(attrib.Value);
                break;

            case NOT_SELECTABLE_ATTRIB:
                tag.NoSelect = SwfMillPrimitives.ParseBoolean(attrib);
                break;

            case HAS_BORDER_ATTRIB:
                tag.Border = SwfMillPrimitives.ParseBoolean(attrib);
                break;

            case "static":
                tag.WasStatic = CommonFormatter.ParseBool(attrib.Value);
                break;

            case IS_HTML_ATTRIB:
                tag.HTML = SwfMillPrimitives.ParseBoolean(attrib);
                break;

            case USE_OUTLINES_ATTRIB:
                tag.UseOutlines = SwfMillPrimitives.ParseBoolean(attrib);
                break;

            case FONT_REF_ATTRIB:
                tag.FontID  = ushort.Parse(attrib.Value);
                tag.HasFont = true;
                break;

            case "fontClass":
                tag.FontClass = attrib.Value;
                break;

            case FONT_HEIGHT_ATTRIB:
                tag.FontHeight = ushort.Parse(attrib.Value);
                tag.HasFont    = true;
                break;

            case MAX_LENGTH_ATTRIB:
                tag.MaxLength = ushort.Parse(attrib.Value);
                break;

            case ALIGN_ATTRIB:
                tag.Align     = byte.Parse(attrib.Value);
                tag.HasLayout = true;
                break;

            case LEFT_MARGIN_ATTRIB:
                tag.LeftMargin = ushort.Parse(attrib.Value);
                tag.HasLayout  = true;
                break;

            case RIGHT_MARGIN_ATTRIB:
                tag.RightMargin = ushort.Parse(attrib.Value);
                tag.HasLayout   = true;
                break;

            case INDENT_ATTRIB:
                tag.Indent    = ushort.Parse(attrib.Value);
                tag.HasLayout = true;
                break;

            case LEADING_ATTRIB:
                tag.Leading   = short.Parse(attrib.Value);
                tag.HasLayout = true;
                break;

            case VARIABLE_NAME_ATTRIB:
                tag.VariableName = attrib.Value;
                break;

            default:
                return(false);
            }
            return(true);
        }