/*
Kooboo is a content management system based on ASP.NET MVC framework. Copyright 2009 Yardi Technology Limited.
This program is free software: you can redistribute it and/or modify it under the terms of the
GNU General Public License version 3 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program.
If not, see http://www.kooboo.com/gpl3/.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Everest.Library.ExtensionMethod;
using Everest.Library.Versioning;
namespace Everest.Providers.Versioning.DB{
partial class Everest_VersionItem : IVersionItem
{
public Everest_VersionItem()
{
this.VersionUUID = Guid.NewGuid();
}
public Everest_VersionItem(DBVersioning dbVersioning)
: this()
{
this.Versioning = dbVersioning;
}
#region IVersionItem Members
/// <summary>
/// Gets the predecessor.
/// </summary>
/// <returns></returns>
public IVersionItem GetPredecessor()
{
return ((DBVersioning)Versioning).GetPredecessor(this.UUID, this.Revision);
}
/// <summary>
/// Gets the successor.
/// </summary>
/// <returns></returns>
public IVersionItem GetSuccessor()
{
return ((DBVersioning)Versioning).GetSuccessor(this.UUID, this.Revision);
}
/// <summary>
/// Gets the body.
/// </summary>
/// <returns></returns>
public string GetBody()
{
return this.Body;
}
private object o = null;
/// <summary>
/// Gets the object.
/// </summary>
/// <returns></returns>
public object GetObject()
{
if (o == null)
{
Type type = Type.GetType(this.ObjectType);
o = ObjectExtensions.DeserializeFromXmlString(GetBody(), type);
}
return o;
}
public bool IsCheckout
{
get { return !string.IsNullOrEmpty(this.CheckoutBy); }
}
public IVersioning Versioning
{
get;
private set;
}
#endregion
}
}
|