public bool TryCreateObject(ObjectType objectType, out IPersistable persistObj)
        {
            switch (objectType)
            {
            case ObjectType.WordOpenXmlTableGrid:
                persistObj = new OpenXmlTableGridModel();
                break;

            case ObjectType.WordOpenXmlTableRowProperties:
                persistObj = new OpenXmlTableRowPropertiesModel();
                break;

            case ObjectType.WordOpenXmlBorderProperties:
                persistObj = new OpenXmlBorderPropertiesModel();
                break;

            case ObjectType.WordOpenXmlHeaderFooterReferences:
                persistObj = new HeaderFooterReferences();
                break;

            default:
                persistObj = null;
                return(false);
            }
            return(true);
        }
        public override void Deserialize(IntermediateFormatReader reader)
        {
            base.Deserialize(reader);
            reader.RegisterDeclaration(OpenXmlTableRowPropertiesModel.GetDeclaration());
            while (reader.NextMember())
            {
                switch (reader.CurrentMember.MemberName)
                {
                case MemberName.RowHeight:
                    this._height = reader.ReadSingle();
                    break;

                case MemberName.LeftIndent:
                    this._rowIndent = reader.ReadSingle();
                    break;

                case MemberName.ExactRowHeight:
                    this._exactRowHeight = reader.ReadBoolean();
                    break;

                case MemberName.IgnoreRowHeight:
                    this._ignoreRowHeight = reader.ReadBoolean();
                    break;

                case MemberName.TopPadding:
                    this._maxPaddingTop = reader.ReadSingle();
                    break;

                case MemberName.BottomPadding:
                    this._maxPaddingBottom = reader.ReadSingle();
                    break;

                case MemberName.TopBorder:
                    this._borderTop = (OpenXmlBorderPropertiesModel)reader.ReadRIFObject();
                    break;

                case MemberName.BottomBorder:
                    this._borderBottom = (OpenXmlBorderPropertiesModel)reader.ReadRIFObject();
                    break;

                case MemberName.LeftBorder:
                    this._borderLeft = (OpenXmlBorderPropertiesModel)reader.ReadRIFObject();
                    break;

                case MemberName.RightBorder:
                    this._borderRight = (OpenXmlBorderPropertiesModel)reader.ReadRIFObject();
                    break;

                case MemberName.Color:
                    this._bgColor = reader.ReadString();
                    break;

                default:
                    WordOpenXmlUtils.FailSerializable();
                    break;
                }
            }
        }
        public override void Serialize(IntermediateFormatWriter writer)
        {
            base.Serialize(writer);
            writer.RegisterDeclaration(OpenXmlTableRowPropertiesModel.GetDeclaration());
            while (writer.NextMember())
            {
                switch (writer.CurrentMember.MemberName)
                {
                case MemberName.RowHeight:
                    writer.Write(this._height);
                    break;

                case MemberName.LeftIndent:
                    writer.Write(this._rowIndent);
                    break;

                case MemberName.ExactRowHeight:
                    writer.Write(this._exactRowHeight);
                    break;

                case MemberName.IgnoreRowHeight:
                    writer.Write(this._ignoreRowHeight);
                    break;

                case MemberName.TopPadding:
                    writer.Write(this._maxPaddingTop);
                    break;

                case MemberName.BottomPadding:
                    writer.Write(this._maxPaddingBottom);
                    break;

                case MemberName.TopBorder:
                    writer.Write(this._borderTop);
                    break;

                case MemberName.BottomBorder:
                    writer.Write(this._borderBottom);
                    break;

                case MemberName.LeftBorder:
                    writer.Write(this._borderLeft);
                    break;

                case MemberName.RightBorder:
                    writer.Write(this._borderRight);
                    break;

                case MemberName.Color:
                    writer.Write(this._bgColor);
                    break;

                default:
                    WordOpenXmlUtils.FailSerializable();
                    break;
                }
            }
        }
        private static List <Declaration> BuildDeclarations()
        {
            List <Declaration> list = new List <Declaration>(6);

            list.Add(BaseInterleaver.GetDeclaration());
            list.Add(OpenXmlTableGridModel.GetDeclaration());
            list.Add(OpenXmlTableRowPropertiesModel.GetDeclaration());
            list.Add(OpenXmlBorderPropertiesModel.GetDeclaration());
            list.Add(HeaderFooterReferences.GetDeclaration());
            return(list);
        }