Ejemplo n.º 1
0
        private IBitmap GetBitmap(TdApi.File file)
        {
            if (file?.Local?.Path != null && _cache.TryGetValue(file.Local.Path, out var bitmap))
            {
                return((IBitmap)bitmap);
            }

            return(null);
        }
Ejemplo n.º 2
0
        private IBitmap GetBitmap(TdApi.File file, int size)
        {
            if (file?.Local?.Path != null)
            {
                var resizedFilePath = GetResizedPath(file.Local.Path, size);
                if (_cache.TryGetValue(resizedFilePath, out var bitmap))
                {
                    return((IBitmap)bitmap);
                }
            }

            return(null);
        }
Ejemplo n.º 3
0
        private IBitmap GetBitmap(TdApi.File file, long id, AvatarSize size)
        {
            var filename = GetFilename(file, id, size);

            if (_cache.TryGetValue(filename, out var bitmap))
            {
                return((IBitmap)bitmap);
            }

            return(null);
        }