Exemplo n.º 1
0
        //ToDo: AddLocationFolders
        public async Task <int> AddLocationFolder(MapLocationFolderModel locationFolder)
        {
            SQLiteAsyncConnection connection = new SQLiteAsyncConnection(SQLiteConfiguration.ConnectionString);

            _locationFolders.Add(locationFolder);

            return(await connection.InsertAsync(locationFolder));
        }
Exemplo n.º 2
0
        private async void UpdateMapFolderList(Guid mapLocationId)
        {
            _mapLocationFolderAccess.MapLocationId = mapLocationId;
            _mapLocationFolders = await _mapLocationFolderAccess.GetSources(DataSourceType.Sqlite);

            DefaultViewModel["MapLocationFolders"] = _mapLocationFolders;

            List <MapLocationFolderModel> removedFoders = new List <MapLocationFolderModel>();

            foreach (MapLocationFolderModel removedFolder in _mapLocationFolders)
            {
                StorageFolder folder = await StorageApplicationPermissions.FutureAccessList.GetFolderAsync(removedFolder.Token, AccessCacheOptions.FastLocationsOnly);

                if (folder == null || !DataSource.SelectedStorageFolders.Any(storageFolder => storageFolder.EqualTo(folder)))
                {
                    removedFoders.Add(removedFolder);
                }
            }

            await _mapLocationFolderAccess.RemoveMany(DataSourceType.Sqlite, removedFoders);

            foreach (StorageFolder folder in DataSource.SelectedStorageFolders)
            {
                string token = StorageApplicationPermissions.FutureAccessList.Add(folder, "link");
                if (!_mapLocationFolders.Any(locationFolder => locationFolder.Token.Equals(token)))
                {
                    MapLocationFolderModel locationFolder = new MapLocationFolderModel
                    {
                        ID            = Guid.NewGuid(),
                        Name          = folder.Name,
                        Description   = folder.DateCreated.ToString(),
                        MapLocationId = mapLocationId,
                        Token         = token
                    };
                    await _mapLocationFolderAccess.Add(DataSourceType.Sqlite, locationFolder);
                }
            }
        }
Exemplo n.º 3
0
 public Task UpdateLocationFolder(MapLocationFolderModel locationFolder)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 4
0
 public Task UpdateLocationFolder(MapLocationFolderModel locationFolder)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 5
0
 public Task<int> AddLocationFolder(MapLocationFolderModel locationFolder)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 6
0
        private async void UpdateMapFolderList(Guid mapLocationId)
        {
            _mapLocationFolderAccess.MapLocationId = mapLocationId;
            _mapLocationFolders = await _mapLocationFolderAccess.GetSources(DataSourceType.Sqlite);
            DefaultViewModel["MapLocationFolders"] = _mapLocationFolders;

            List<MapLocationFolderModel> removedFoders = new List<MapLocationFolderModel>();
            foreach (MapLocationFolderModel removedFolder in _mapLocationFolders)
            {
                StorageFolder folder = await StorageApplicationPermissions.FutureAccessList.GetFolderAsync(removedFolder.Token, AccessCacheOptions.FastLocationsOnly);
                if (folder == null || !DataSource.SelectedStorageFolders.Any(storageFolder => storageFolder.EqualTo(folder)))
                    removedFoders.Add(removedFolder);
            }

            await _mapLocationFolderAccess.RemoveMany(DataSourceType.Sqlite, removedFoders);

            foreach (StorageFolder folder in DataSource.SelectedStorageFolders)
            {
                string token = StorageApplicationPermissions.FutureAccessList.Add(folder, "link");
                if (!_mapLocationFolders.Any(locationFolder => locationFolder.Token.Equals(token)))
                {
                    MapLocationFolderModel locationFolder = new MapLocationFolderModel
                    {
                        ID = Guid.NewGuid(),
                        Name = folder.Name,
                        Description = folder.DateCreated.ToString(),
                        MapLocationId = mapLocationId,
                        Token = token
                    };
                    await _mapLocationFolderAccess.Add(DataSourceType.Sqlite, locationFolder);
                }
            }
        }
Exemplo n.º 7
0
        //ToDo: AddLocationFolders
        public async Task<int> AddLocationFolder(MapLocationFolderModel locationFolder)
        {
            SQLiteAsyncConnection connection = new SQLiteAsyncConnection(SQLiteConfiguration.ConnectionString);

            _locationFolders.Add(locationFolder);

            return await connection.InsertAsync(locationFolder);
        }
Exemplo n.º 8
0
 public Task <int> AddLocationFolder(MapLocationFolderModel locationFolder)
 {
     throw new NotImplementedException();
 }