public void DeleteItemsFromAssociation(FolderAssociation association)
 {
     using (var query = Connection.Prepare($"delete from Item where AssociationId='{association.Id}'"))
     {
         query.Step();
     }
 }
Esempio n. 2
0
 public LocalItem(FolderAssociation association, IStorageItem storageItem, BasicProperties basicProperties)
 {
     Association  = association;
     IsCollection = storageItem is StorageFolder;
     ChangeKey    = SQLite.DateTimeHelper.DateTimeSQLite(basicProperties.DateModified.UtcDateTime);
     EntityId     = storageItem.Path;
     ChangeNumber = 0;
     Size         = basicProperties.Size;
 }
Esempio n. 3
0
        public LocalItem(FolderAssociation association, IStorageItem storageItem, IDictionary <string, object> properties)
        {
            Association  = association;
            IsCollection = storageItem is StorageFolder;
            var s = properties["System.DateModified"];

            ChangeKey    = SQLite.DateTimeHelper.DateTimeSQLite(((DateTimeOffset)properties["System.DateModified"]).UtcDateTime);
            EntityId     = storageItem.Path;
            ChangeNumber = 0;
            if (!IsCollection)
            {
                Size = (ulong)properties["System.Size"];
            }
        }
        public ObservableCollection <BaseItem> GetFilesForFolder(FolderAssociation association, Type adapterType)
        {
            var items = new ObservableCollection <BaseItem>();

            using (var query = Connection.Prepare("select i.Id, i.AssociationId, i.EntityId, i.IsCollection, i.ChangeKey, i.ChangeNumber, i.SyncPostponed, AdapterType, LastModified, Size, ContentType from Item i " +
                                                  $"where i.AssociationId = '{association.Id}' AND i.AdapterType = '{adapterType.AssemblyQualifiedName}' ORDER BY EntityId ASC"))
            {
                while (query.Step() == SQLiteResult.ROW)
                {
                    var item = CreateInstance(query);
                    items.Add(item);
                }
            }
            return(items);
        }
Esempio n. 5
0
 /// <summary>
 /// Get the delted items which updated since <see cref="Configuration.LastSync"/>. If errors occured in the last sync <see cref="Configuration.LastSync"/> must not change.
 /// </summary>
 /// <param name="association">The pair of folders in which you want to search</param>
 /// <returns>A list of <see cref="BaseItem"/> which were deleted since <see cref="Configuration.LastSync"/></returns>
 public abstract Task <List <BaseItem> > GetDeletedItemsAsync(FolderAssociation association);
Esempio n. 6
0
 /// <summary>
 /// Get the updated items which updated since <see cref="Configuration.LastSync"/>. If errors occured in the last sync <see cref="Configuration.LastSync"/> must not change.
 /// </summary>
 /// <param name="association">The pair of folders in which you want to search</param>
 /// <returns>A list of <see cref="BaseItem"/> which were changed since <see cref="Configuration.LastSync"/></returns>
 public abstract Task <List <BaseItem> > GetUpdatedItems(FolderAssociation association);