|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media.Imaging;
namespace SongBird.Infrastructure
{
/// <summary>
/// This class allows the application to download an image once and use it multiple times.
/// </summary>
public static class ImageManager
{
private static Dictionary<string, BitmapImage> _profileImages = new Dictionary<string,BitmapImage>();
public static BitmapImage GetImage(string key)
{
return _profileImages[key];
}
public static void AddImage(string key)
{
if (!_profileImages.ContainsKey(key))
{
_profileImages.Add(key, new BitmapImage(new Uri(key)));
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
A developer for over 30 years, I've been lucky enough to write articles and applications for Code Project as well as the Intel Ultimate Coder - Going Perceptual challenge. I live in the North East of England with 2 wonderful daughters and a wonderful wife.
I am not the Stig, but I do wish I had Lotus Tuned Suspension.