using DevExpress.Utils;
|
using System.Drawing;
|
|
namespace IStation.WinFrmUI
|
{
|
/// <summary>
|
/// 图标仓库
|
/// </summary>
|
public class ImageLib
|
{
|
public static ImageCollection Lib
|
{
|
get
|
{
|
if (_lib == null)
|
{
|
_lib = new ImageCollection();
|
_lib.ImageSize = new Size(16, 16);
|
|
_lib.Images.Add(Properties.Resources.Group, "Group");
|
_lib.Images.Add(Properties.Resources.MonitorPoint, "MonitorPoint");
|
_lib.Images.Add(Properties.Resources.Signal, "Signal");
|
|
_lib.Images.Add(Properties.Resources.Station, "Station");
|
_lib.Images.Add(Properties.Resources.EnginePump, "EnginePump");
|
_lib.Images.Add(Properties.Resources.Motor, "Motor");
|
_lib.Images.Add(Properties.Resources.Pump, "Pump");
|
_lib.Images.Add(Properties.Resources.PumpCurve, "PumpCurve");
|
_lib.Images.Add(Properties.Resources.WorkPumpCurve, "WorkPumpCurve");
|
|
_lib.Images.Add(Properties.Resources.Question, "Question");
|
}
|
return _lib;
|
}
|
}
|
|
private static ImageCollection _lib;
|
public static int Group
|
{
|
get => GetImageIndex("Group");
|
}
|
|
public static int MonitorPoint
|
{
|
get => GetImageIndex("MonitorPoint");
|
}
|
|
public static int Signal
|
{
|
get => GetImageIndex("Signal");
|
}
|
|
public static int Station
|
{
|
get => GetImageIndex("Station");
|
}
|
|
public static int EnginePump
|
{
|
get => GetImageIndex("EnginePump");
|
}
|
|
public static int Motor
|
{
|
get => GetImageIndex("Motor");
|
}
|
|
public static int Pump
|
{
|
get => GetImageIndex("Pump");
|
}
|
|
public static int PumpCurve
|
{
|
get => GetImageIndex("PumpCurve");
|
}
|
|
public static int WorkPumpCurve
|
{
|
get => GetImageIndex("WorkPumpCurve");
|
}
|
|
private static int GetImageIndex(string imgName)
|
{
|
var img = Lib.Images[imgName];
|
if (img == null)
|
img = Lib.Images["Question"];
|
|
return _lib.Images.IndexOf(img);
|
}
|
|
}
|
}
|