Did a lot of work just unit testing left
This commit is contained in:
33
Shapes/ImageManager.cs
Normal file
33
Shapes/ImageManager.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Collections;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
|
||||
namespace Shapes
|
||||
{
|
||||
public static class ImageManager
|
||||
{
|
||||
private static Hashtable _images;
|
||||
static ImageManager()
|
||||
{
|
||||
_images = new Hashtable();
|
||||
}
|
||||
|
||||
internal static Bitmap GetImage(Stream stream)
|
||||
{
|
||||
if (_images.ContainsKey(stream))
|
||||
{
|
||||
return (Bitmap) _images[stream];
|
||||
}
|
||||
else
|
||||
{
|
||||
Bitmap bitmap = new Bitmap(stream);
|
||||
_images.Add(stream, bitmap);
|
||||
return bitmap;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user