NBTExplorer/Mac/IconRegistry.cs
Justin Aquadro f6aeb77ffe Merge commit '491b13aec3002d075f9dc7bc3c05833951234176' into mac-ui
Conflicts:
	NBTExplorer.csproj
Restructuring project
2012-11-04 23:34:59 -05:00

32 lines
560 B
C#

using System;
using System.Collections.Generic;
using MonoMac.AppKit;
namespace NBTExplorer.Mac
{
public class IconRegistry
{
private Dictionary<Type, NSImage> _iconRegistry;
public IconRegistry ()
{
_iconRegistry = new Dictionary<Type, NSImage>();
}
public NSImage DefaultIcon { get; set; }
public NSImage Lookup (Type type)
{
if (_iconRegistry.ContainsKey(type))
return _iconRegistry[type];
else
return DefaultIcon;
}
public void Register (Type type, NSImage icon)
{
_iconRegistry[type] = icon;
}
}
}