using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Text; namespace WmData { /// /// WmDataTransaction: designed to register mutation on the data backend for /// high availability syncing support. /// Created 2nd of August 2010 /// public class WmDataTransaction : IComparable{ protected int id; protected long localMomentUtcTicks; protected long remoteMomentUtcTicks; protected string tableName; protected int objectId; protected int dataRowActionId; protected string nameValueQueryString; protected long tableChecksumAfterThisTransaction; public int Id { get { return id; } set { id = value; } } public long LocalMomentUtcTicks { get { return localMomentUtcTicks; } set { localMomentUtcTicks = value; } } public long RemoteMomentUtcTicks { get { return remoteMomentUtcTicks; } set { remoteMomentUtcTicks = value; } } public string TableName { get { return tableName; } set { tableName = value; } } public int ObjectId { get { return objectId; } set { objectId = value; } } public int DataRowActionId { get { return dataRowActionId; } set { dataRowActionId = value; } } public WmDataRowAction DataRowAction { get { return (WmDataRowAction)Enum.ToObject(typeof(WmDataRowAction), DataRowActionId); } set { DataRowActionId = (int)value; } } public string NameValueQueryString { get { return nameValueQueryString; } set { nameValueQueryString = value; } } public long TableChecksumAfterThisTransaction { get { return tableChecksumAfterThisTransaction; } set { tableChecksumAfterThisTransaction = value; } } public NameValueCollection getNameValueCollection() { return WmDataTools.getNameValueCollectionFromQueryString(NameValueQueryString); } public int CompareTo(object obj) { if (!(obj is WmDataTransaction)) { throw new InvalidCastException("This object is not of type WmDataTransaction"); } WmDataTransaction other = (WmDataTransaction)obj; return this.LocalMomentUtcTicks.CompareTo(other.LocalMomentUtcTicks) ; } } }