JD2022-TU1/main/tools/framework/JD.Application/Properties/ResourcesCache.cs

97 lines
No EOL
3.5 KiB
C#

using System.Drawing;
using System.IO;
using JD.Collections;
namespace JD.Application.Properties
{
/// <summary>
/// Caches a static version of the resources so they are not reloaded from stream each time we request them for a painting.
/// </summary>
public class ResourcesCache
{
/// <summary>
/// The cache of images.
/// </summary>
private static readonly KeyedCache<string, Bitmap> m_cache = new KeyedCache<string, Bitmap>();
public static Bitmap Icons_16x16_Add
{
get { return m_cache["Icons_16x16_Add", delegate { return Properties.Resources.Icons_16x16_Add; }]; }
}
public static Bitmap Icons_16x16_Remove
{
get { return m_cache["Icons_16x16_Remove", delegate { return Properties.Resources.Icons_16x16_Remove; }]; }
}
public static Bitmap Icons_12x12_Pick
{
get { return m_cache["Icons_12x12_Pick", delegate { return Properties.Resources.Icons_12x12_Pick; }]; }
}
public static Bitmap Icons_16x16_Marker
{
get { return m_cache["Icons_16x16_Marker", delegate { return Properties.Resources.Icons_16x16_Marker; }]; }
}
public static Bitmap Icons_16x16_BlueMarker
{
get { return m_cache["Icons_16x16_BlueMarker", delegate { return Properties.Resources.Icons_16x16_BlueMarker; }]; }
}
public static Bitmap Icons_16x16_YellowMarker
{
get { return m_cache["Icons_16x16_YellowMarker", delegate { return Properties.Resources.Icons_16x16_YellowMarker; }]; }
}
public static Bitmap Icons_16x16_WhiteMarker
{
get { return m_cache["Icons_16x16_WhiteMarker", delegate { return Properties.Resources.Icons_16x16_WhiteMarker; }]; }
}
public static Bitmap Icons_16x16_DarkBlueMarker
{
get { return m_cache["Icons_16x16_DarkBlueMarker", delegate { return Properties.Resources.Icons_16x16_DarkBlueMarker; }]; }
}
public static Bitmap Icons_30x30_Play
{
get { return m_cache["Icons_30x30_Play", delegate { return Properties.Resources.Icons_30x30_Play; }]; }
}
public static Bitmap Icons_30x30_Pause
{
get { return m_cache["Icons_30x30_Pause", delegate { return Properties.Resources.Icons_30x30_Pause; }]; }
}
public static Bitmap Icons_30x30_Step
{
get { return m_cache["Icons_30x30_Step", delegate { return Properties.Resources.Icons_30x30_Step; }]; }
}
public static Bitmap Icons_30x30_StepBack
{
get { return m_cache["Icons_30x30_StepBack", delegate { return Properties.Resources.Icons_30x30_StepBack; }]; }
}
public static Bitmap Icons_30x30_Record
{
get { return m_cache["Icons_30x30_Record", delegate { return Properties.Resources.Icons_30x30_Record; }]; }
}
public static Bitmap Icons_30x30_Stop
{
get { return m_cache["Icons_30x30_Stop", delegate { return Properties.Resources.Icons_30x30_Stop; }]; }
}
public static Bitmap Icons_16x16_Comment
{
get { return m_cache["Icons_16x16_Comment", delegate { return Properties.Resources.Icons_16x16_Comment; }]; }
}
public static Bitmap Icon_16x16_Song
{
get { return m_cache["Icon_16x16_Song", delegate { return Properties.Resources.Icon_16x16_Song; }]; }
}
}
}