protected override BaseItem CreateInstance(ISQLiteStatement query) { //SELECT Id, AssociationId, EntityId, IsCollection, ChangeKey, ChangeNumber FROM Item WHERE Id = ? var item = new BaseItem(); item.Id = (long)query["Id"]; var associationModel = FolderAssociationTableModel.GetDefault(); item.Association = associationModel.GetItem((long)query["AssociationId"]); item.EntityId = (string)(query["EntityId"] == null ? default(string) : query["EntityId"]); item.IsCollection = (long)query["IsCollection"] == 1; item.ChangeKey = (string)query["ChangeKey"]; item.ChangeNumber = (long)query["ChangeNumber"]; item.SyncPostponed = (long)query["SyncPostponed"] == 1; item.AdapterType = Type.GetType((string)query["AdapterType"]); item.Size = Convert.ToUInt64((long)query["Size"]); DateTime date; if (DateTime.TryParse((string)query["LastModified"], out date)) { item.LastModified = date; } item.ContentType = (string)query["ContentType"]; return(item); }
public static FolderAssociationTableModel GetDefault() { lock (typeof(FolderAssociationTableModel)) { if (instance == null) { instance = new FolderAssociationTableModel(); } return(instance); } }