/*
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.Extensions;
using Everest.Library.Versioning;
namespace Everest.Providers.Versioning.DB4O{
public class VersionItem : IVersionItem
{
public VersionItem()
{
}
public VersionItem(Versioning versioning)
{
this.Versioning = versioning;
}
#region IVersionItem Members
public IVersioning Versioning
{
get;
set;
}
public Guid UUID
{
get;
set;
}
public string CheckinUser
{
get;
set;
}
public string CheckinComment
{
get;
set;
}
public int? Size
{
get;
set;
}
public DateTime DateTime
{
get;
set;
}
public int Revision
{
get;
set;
}
public bool IsCheckout
{
get { return !string.IsNullOrEmpty(this.CheckoutBy); }
}
public string CheckoutBy
{
get;
set;
}
public string CheckoutComment
{
get;
set;
}
public IVersionItem GetPredecessor()
{
return ((Versioning)Versioning).GetPredecessor(this.UUID, this.Revision);
}
public IVersionItem GetSuccessor()
{
return ((Versioning)Versioning).GetSuccessor(this.UUID, this.Revision);
}
public string GetBody()
{
return this.Body;
}
private object o = null;
public object GetObject()
{
if (o == null)
{
Type type = Type.GetType(this.ObjectType);
o = ObjectExtensions.DeserializeFromXmlString(GetBody(),type);
}
return o;
}
public string SnapshotFormName
{
get;
set;
}
#endregion
public string ObjectType
{
get;
set;
}
public string Body
{
get;
set;
}
}
}
|