using DevExpress.Utils;
|
using DevExpress.Utils.Svg;
|
using HStation.WinFrmUI.Core.Lib;
|
|
namespace HStation.WinFrmUI
|
{
|
/// <summary>
|
/// 图标仓库
|
/// </summary>
|
public class ImageLib
|
{
|
#region 16
|
|
public static ImageCollection Lib
|
{
|
get
|
{
|
if (_lib == null)
|
{
|
_lib = new ImageCollection();
|
_lib.ImageSize = new Size(16, 16);
|
_lib.Images.Add(Resource1.Group, "Group");
|
_lib.Images.Add(Resource1.Series, "Series");
|
_lib.Images.Add(Resource1.Question, "Question");
|
_lib.Images.Add(Resource1.Type, "Type");
|
_lib.Images.Add(Resource1.ListView, "ListView");
|
_lib.Images.Add(Resource1.Notlmported, "NotImported");
|
}
|
return _lib;
|
}
|
}
|
|
private static ImageCollection _lib;
|
|
public static int Group
|
{
|
get => GetImage16Index("Group");
|
}
|
|
public static int Series
|
{
|
get => GetImage16Index("Series");
|
}
|
|
public static int Type
|
{
|
get => GetImage16Index("Type");
|
}
|
|
public static int Listview
|
{
|
get => GetImage16Index("Listview");
|
}
|
|
public static int Question
|
{
|
get => GetImage16Index("Question");
|
}
|
|
public static int NotImported
|
{
|
get => GetImage16Index("NotImported");
|
}
|
|
public static int Imported
|
{
|
get => GetImage16Index("Imported");
|
}
|
|
private static int GetImage16Index(string imgName)
|
{
|
var img = Lib.Images[imgName];
|
if (img == null)
|
img = Lib.Images["Question"];
|
|
return _lib.Images.IndexOf(img);
|
}
|
|
#endregion 16
|
|
#region Svg
|
|
public static SvgImageCollection LibSvg
|
{
|
get
|
{
|
if (_lib_svg == null)
|
{
|
_lib_svg = new SvgImageCollection();
|
_lib_svg.ImageSize = new Size(254, 254);
|
_lib_svg.Add("Project", Resource1.Project);
|
_lib_svg.Add("PumpMain", Resource1.PumpMain);
|
_lib_svg.Add("Valve", Resource1.Valve);
|
_lib_svg.Add("CoolingTower", Resource1.CoolingTower);
|
}
|
return _lib_svg;
|
}
|
}
|
|
private static SvgImageCollection _lib_svg;
|
|
public static SvgImage Project
|
{
|
get => LibSvg[0];
|
}
|
|
public static SvgImage PumpMain
|
{
|
get => LibSvg[1];
|
}
|
|
public static SvgImage Valve
|
{
|
get => LibSvg[2];
|
}
|
|
public static SvgImage CoolingTower
|
{
|
get => LibSvg[3];
|
}
|
|
#endregion Svg
|
}
|
}
|