Beispiel #1
0
        public static FileSize Sum <TSource>(this IEnumerable <TSource> source, Func <TSource, FileSize> selector)
        {
            FileSize result = FileSize.FromKiloBytes(0);

            foreach (var x in source)
            {
                result += selector(x);
            }
            return(result);
        }
Beispiel #2
0
        public bool GetDirectoryInfo(string path, out int assetsCount, out int usedAssetsCount, out int editorAssetsCount, out FileSize size)
        {
            var idx = paths.IndexOf(path);

            if (idx < 0)
            {
                assetsCount       = 0;
                usedAssetsCount   = 0;
                editorAssetsCount = 0;
                size = FileSize.Zero;
                return(false);
            }

            assetsCount       = entries[idx].assetsCount;
            usedAssetsCount   = entries[idx].usedAssetsCount;
            editorAssetsCount = entries[idx].editorAssetsCount;
            size = entries[idx].size;
            return(true);
        }