Пример #1
0
        /// <summary>
        /// Retourne en % l'espace occupé par le fichier dans le dossier de roaming
        /// </summary>
        /// <returns></returns>
        public static async Task <int> GetEspaceFichierOccupePourcent()
        {
            var espaceMax = (ApplicationData.Current.RoamingStorageQuota > 0)
                ? ApplicationData.Current.RoamingStorageQuota * 1000 : ContexteStatic.RoaminsStorageQuotaBis * 1000;
            var espaceOccupe = await Fichier.GetSizeFile();

            var ret = (100 * espaceOccupe) / espaceMax;

            return((espaceOccupe > 0 && ret == 0) ? 1 : (int)ret);
        }