示例#1
0
        public override void Serialize(IntermediateFormatWriter writer)
        {
            base.Serialize(writer);
            writer.RegisterDeclaration(HeaderFooterReferences.GetDeclaration());
            while (writer.NextMember())
            {
                switch (writer.CurrentMember.MemberName)
                {
                case MemberName.Header:
                    writer.Write(this.Header);
                    break;

                case MemberName.Footer:
                    writer.Write(this.Footer);
                    break;

                case MemberName.FirstPageHeader:
                    writer.Write(this.FirstPageHeader);
                    break;

                case MemberName.FirstPageFooter:
                    writer.Write(this.FirstPageFooter);
                    break;

                default:
                    WordOpenXmlUtils.FailSerializable();
                    break;
                }
            }
        }
        public void Serialize(IntermediateFormatWriter writer)
        {
            writer.RegisterDeclaration(OpenXmlBorderPropertiesModel.GetDeclaration());
            while (writer.NextMember())
            {
                switch (writer.CurrentMember.MemberName)
                {
                case MemberName.Color:
                    writer.Write(this.Color);
                    break;

                case MemberName.Width:
                    writer.Write(this._widthInEighthPoints);
                    break;

                case MemberName.Style:
                    writer.Write((byte)this.Style);
                    break;

                default:
                    WordOpenXmlUtils.FailSerializable();
                    break;
                }
            }
        }
        public void Deserialize(IntermediateFormatReader reader)
        {
            reader.RegisterDeclaration(OpenXmlBorderPropertiesModel.GetDeclaration());
            while (reader.NextMember())
            {
                switch (reader.CurrentMember.MemberName)
                {
                case MemberName.Color:
                    this.Color = reader.ReadString();
                    break;

                case MemberName.Width:
                    this._widthInEighthPoints = reader.ReadInt32();
                    break;

                case MemberName.Style:
                    this.Style = (BorderStyle)reader.ReadByte();
                    break;

                default:
                    WordOpenXmlUtils.FailSerializable();
                    break;
                }
            }
        }
示例#4
0
        public override void Deserialize(IntermediateFormatReader reader)
        {
            base.Deserialize(reader);
            reader.RegisterDeclaration(GetDeclaration());
            while (reader.NextMember())
            {
                switch (reader.CurrentMember.MemberName)
                {
                case MemberName.Header:
                    Header = reader.ReadString();
                    break;

                case MemberName.Footer:
                    Footer = reader.ReadString();
                    break;

                case MemberName.FirstPageHeader:
                    FirstPageHeader = reader.ReadString();
                    break;

                case MemberName.FirstPageFooter:
                    FirstPageFooter = reader.ReadString();
                    break;

                default:
                    WordOpenXmlUtils.FailSerializable();
                    break;
                }
            }
        }
        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;
                }
            }
        }
示例#7
0
 public override void Deserialize(IntermediateFormatReader reader)
 {
     base.Deserialize(reader);
     reader.RegisterDeclaration(GetDeclaration());
     while (reader.NextMember())
     {
         MemberName memberName = reader.CurrentMember.MemberName;
         if (memberName == MemberName.Columns)
         {
             _columns = reader.ReadListOfPrimitives <int>();
         }
         else
         {
             WordOpenXmlUtils.FailSerializable();
         }
     }
 }
示例#8
0
 public override void Serialize(IntermediateFormatWriter writer)
 {
     base.Serialize(writer);
     writer.RegisterDeclaration(GetDeclaration());
     while (writer.NextMember())
     {
         MemberName memberName = writer.CurrentMember.MemberName;
         if (memberName == MemberName.Columns)
         {
             writer.WriteListOfPrimitives(_columns);
         }
         else
         {
             WordOpenXmlUtils.FailSerializable();
         }
     }
 }
示例#9
0
        public virtual void Deserialize(IntermediateFormatReader reader)
        {
            reader.RegisterDeclaration(GetDeclaration());
            while (reader.NextMember())
            {
                switch (reader.CurrentMember.MemberName)
                {
                case MemberName.Index:
                    _index = reader.ReadInt32();
                    break;

                case MemberName.Location:
                    _location = reader.ReadInt64();
                    break;

                default:
                    WordOpenXmlUtils.FailSerializable();
                    break;
                }
            }
        }
示例#10
0
        public virtual void Serialize(IntermediateFormatWriter writer)
        {
            writer.RegisterDeclaration(GetDeclaration());
            while (writer.NextMember())
            {
                switch (writer.CurrentMember.MemberName)
                {
                case MemberName.Index:
                    writer.Write(_index);
                    break;

                case MemberName.Location:
                    writer.Write(_location);
                    break;

                default:
                    WordOpenXmlUtils.FailSerializable();
                    break;
                }
            }
        }