You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Zero/ZeroLevel/Services/DOM/Model/AttachContent.cs

68 lines
1.7 KiB

6 years ago
using System;
using ZeroLevel.Services.Serialization;
namespace ZeroLevel.DocumentObjectModel
{
public sealed class AttachContent
6 years ago
: IBinarySerializable
{
/// <summary>
/// ID
6 years ago
/// </summary>
public string Identity;
6 years ago
/// <summary>
/// Title
6 years ago
/// </summary>
public string Caption;
6 years ago
/// <summary>
/// Description (optional)
6 years ago
/// </summary>
public string Summary;
6 years ago
/// <summary>
/// Content type
6 years ago
/// </summary>
public ContentType ContentType;
6 years ago
/// <summary>
/// Binary content
6 years ago
/// </summary>
public byte[] Payload;
public AttachContent()
{
}
public AttachContent(IBinaryReader reader)
{
Deserialize(reader);
}
public AttachContent(string identity, string caption, string description)
6 years ago
{ Identity = identity; Summary = description; Caption = caption; }
#region IBinarySerializable
6 years ago
public void Serialize(IBinaryWriter writer)
{
writer.WriteString(this.Identity);
writer.WriteString(this.Caption);
writer.WriteString(this.Summary);
writer.WriteInt32((Int32)this.ContentType);
writer.WriteBytes(this.Payload);
}
public void Deserialize(IBinaryReader reader)
{
this.Identity = reader.ReadString();
this.Caption = reader.ReadString();
this.Summary = reader.ReadString();
this.ContentType = (ContentType)reader.ReadInt32();
this.Payload = reader.ReadBytes();
}
#endregion IBinarySerializable
6 years ago
}
}

Powered by TurnKey Linux.