Exemplo n.º 1
0
        private async Task UpdateAvailableRoamingSpace()
        {
            ulong space = 0;

            if (FileGroups.All(x => x.Location != FileService.FileLocation.Roamed))
            {
                return;
            }
            var syncedFiles = FileGroups.First(x => x.Location == FileService.FileLocation.Roamed).Files;

            for (int i = syncedFiles.Count - 1; i >= 0; i--)
            {
                if (syncedFiles[i].Name == Constants.IV_FILE_NAME)
                {
                    continue;
                }
                space += await syncedFiles[i].GetFileSizeInBytes();
            }
            ulong ivFileSize = await _ivService.GetIVFileSize(FileService.FileLocation.Roamed);

            space           += ivFileSize;
            RoamingSpaceUsed = (double)space / 1024;
        }