72 lines
2.3 KiB
C#
72 lines
2.3 KiB
C#
//-----------------------------------------------------------------------
|
|
// <copyright file="BinaryModel.cs" company="BTU/IIT">
|
|
// Company copyright tag.
|
|
// </copyright>
|
|
// <author>stubbfel</author>
|
|
// <sience>03.09.2013</sience>
|
|
//----------------------------------------------------------------------
|
|
|
|
using CampusAppWPortalLib8.Model;
|
|
namespace CampusAppWP8.Model
|
|
{
|
|
/// <summary>Binary model.</summary>
|
|
/// <remarks>Stubbfel, 03.09.2013.</remarks>
|
|
public abstract class BinaryModel : MainModel<byte[]>
|
|
{
|
|
#region Constructor
|
|
|
|
/// <summary>Initializes a new instance of the BinaryModel class.</summary>
|
|
/// <remarks>Stubbfel, 03.09.2013.</remarks>
|
|
/// <param name="modelType">Type of the model.</param>
|
|
/// <param name="fileName"> Filename of the file.</param>
|
|
/// <param name="url"> URL of the document.</param>
|
|
public BinaryModel(ModelType modelType, string fileName, string url)
|
|
: base(modelType, fileName, url)
|
|
{
|
|
}
|
|
|
|
/// <summary>Initializes a new instance of the BinaryModel class.</summary>
|
|
/// <remarks>Stubbfel, 03.09.2013.</remarks>
|
|
/// <param name="modelType"> Type of the model.</param>
|
|
/// <param name="sourceName">Name of the source.</param>
|
|
public BinaryModel(ModelType modelType, string sourceName)
|
|
: base(modelType, sourceName)
|
|
{
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Method
|
|
|
|
/// <summary>Deserialize model.</summary>
|
|
/// <remarks>Stubbfel, 03.09.2013.</remarks>
|
|
/// <param name="modelData">Information describing the model.</param>
|
|
/// <returns>true if it succeeds, false if it fails.</returns>
|
|
public override bool DeserializeModel(byte[] modelData)
|
|
{
|
|
bool retValue = true;
|
|
|
|
if (modelData != null)
|
|
{
|
|
this.Model = modelData;
|
|
}
|
|
else
|
|
{
|
|
retValue = false;
|
|
}
|
|
|
|
return retValue;
|
|
}
|
|
|
|
/// <summary>Gets the serialize model.</summary>
|
|
/// <remarks>Stubbfel, 03.09.2013.</remarks>
|
|
/// <returns>an byte Array.</returns>
|
|
public override byte[] SerializeModel()
|
|
{
|
|
return this.Model;
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|