Ejemplo n.º 1
0
        /// <summary>
        /// Delete a watch item and send it to the Pebble (if connected)
        /// </summary>
        /// <param name="_deleteItem"></param>
        /// <returns></returns>
        public async Task <bool> DeleteWatchItemAsync(WatchItem _deleteItem)
        {
            try
            {
                //Remove from app
                await WatchItems.DeleteWatchItem(_deleteItem);

                //Remove from storage
                await LocalStorage.Delete(_deleteItem.File);

                await LocalStorage.Delete(_deleteItem.File.Replace(".zip", ".gif"));

                //Remove from watch
                if (IsConnected)
                {
                    await Pebble.DeleteWatchItemAsync(_deleteItem);
                }

                return(true);
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine("DeleteWatchItemAsync exception: " + e.Message);
            }

            return(false);
        }