Esempio n. 1
0
        public void MoveToTrash(Db.Sqlite.DbAdapterSwitch db)
        {
            if (File.Exists(Path))
            {
                try
                {
                    string destFile =
                        Configuration.GetTrashFileFromPath(Path);

                    if (!File.Exists(destFile))
                    {
                        File.Move(Path, destFile);
                    }
                    else
                    {
                        File.Delete(Path);
                    }
                }
                catch (Exception ex)
                {
                    Display.Exception(ex);
                }
            }

            //even if it doesn't exist, purge from db (it
            //exists as a file element for a reason, most
            //likely loaded from a stale entry)
            db.DeleteFile(Path);
        }