using GeoSigmaDrawLib;
using System;
using System.Linq;
using System.Windows.Forms;
namespace GeoSigma.SigmaDrawerStyle
{
///
/// ListBox 子类
///
public static class ListBoxEditorFactory
{
///
/// 创建不同子类的 ListBox
///
/// 控件关键字
/// ListBox
public static ListBox Create(string controlKey)
{
switch (controlKey)
{
case "Lithology":
return new SymbolListBox(new LithologyListBoxProvider());
case "PointType":
return new SymbolListBox(new PointTypeListBoxProvider());
case "LineType":
return new SymbolListBox(new LineTypeListBoxProvider());
case "LithFront":
return new SymbolListBox(new LithFrontListBoxProvider());
case "LithConstitution":
return new SymbolListBox(new LithConstitutionListBoxProvider());
case "OilGas":
return new SymbolListBox(new OilGasListBoxProvider());
case "LithContent":
return new SymbolListBox(new LithContentListBoxProvider());
case "LithologyColor":
return new SymbolListBox(new LithologyColorListBoxProvider());
case "Symbol":
return new SymbolListBox(new SymbolListBoxProvider());
case "InterpResult":
return new SymbolListBox(new InterpResultListBoxProvider());
case "Stratigraphic":
return new SymbolListBox(new StratigraphicListBoxProvider());
case "BendStyle":
return new SymbolListBox(new BendStyleListBoxProvider());
default:
throw new NotSupportedException($"Unknown ListBox editor type: {controlKey}");
}
}
}
///
/// 含油气性
///
public class LithologyColorListBoxProvider : ISymbolListBoxProvider
{
///
public bool Draw(string name, IntPtr hdc, int width, int height)
{
return GeoSigmaWellPoleXY.GetDrawSymbolForLithologyColor(name, hdc, width, height);
}
///
public string[] GetNames()
{
if (GeoSigmaWellPoleXY.GetSymbolNamesForLithologyColor(out string[] names))
{
return new[] { string.Empty }.Concat(names).ToArray();
}
return new string[] { };
}
}
///
/// 含油气性
///
public class OilGasListBoxProvider : ISymbolListBoxProvider
{
///
public bool Draw(string name, IntPtr hdc, int width, int height)
{
return GeoSigmaWellPoleXY.GetDrawSymbolForLithOilGas(name, hdc, width, height);
}
///
public string[] GetNames()
{
if (GeoSigmaWellPoleXY.GetSymbolNamesForLithOilGas(out string[] names))
{
return new[] { string.Empty }.Concat(names).ToArray();
}
return new string[] { };
}
}
///
/// 含有物
///
public class LithContentListBoxProvider : ISymbolListBoxProvider
{
///
public bool Draw(string name, IntPtr hdc, int width, int height)
{
return GeoSigmaWellPoleXY.GetDrawSymbolForLithContent(name, hdc, width, height);
}
///
public string[] GetNames()
{
if (GeoSigmaWellPoleXY.GetSymbolNamesForLithContent(out string[] names))
{
return new[] { string.Empty }.Concat(names).ToArray();
}
return new string[] { };
}
}
///
/// 构造
///
public class LithConstitutionListBoxProvider : ISymbolListBoxProvider
{
///
public bool Draw(string name, IntPtr hdc, int width, int height)
{
return GeoSigmaWellPoleXY.GetDrawSymbolForLithConstitution(name, hdc, width, height);
}
///
public string[] GetNames()
{
if (GeoSigmaWellPoleXY.GetSymbolNamesForLithConstitution(out string[] names))
{
return new[] { string.Empty }.Concat(names).ToArray();
}
return new string[] { };
}
}
///
/// 岩性前缀
///
public class LithFrontListBoxProvider : ISymbolListBoxProvider
{
///
public bool Draw(string name, IntPtr hdc, int width, int height)
{
return GeoSigmaWellPoleXY.GetDrawSymbolForLithFront(name, hdc, width, height);
}
///
public string[] GetNames()
{
if (GeoSigmaWellPoleXY.GetSymbolNamesForLithFront(out string[] names))
{
return new[] { string.Empty }.Concat(names).ToArray();
}
return new string[] { };
}
}
///
/// 点符号
///
public class PointTypeListBoxProvider : ISymbolListBoxProvider
{
///
public bool Draw(string name, IntPtr hdc, int width, int height)
{
return GeoSigmaWellPoleXY.GetDrawCurvePointSymbol(name, hdc, width, height);
}
///
public string[] GetNames()
{
if (GeoSigmaWellPoleXY.GetCurvePointSymbolNames(out string[] names))
{
return names;
}
return new string[] { };
}
}
///
/// 线型
///
public class LineTypeListBoxProvider : ISymbolListBoxProvider
{
///
public bool Draw(string name, IntPtr hdc, int width, int height)
{
return GeoSigmaWellPoleXY.GetDrawWellCurveLine(name, hdc, width, height);
}
///
public string[] GetNames()
{
if (GeoSigmaWellPoleXY.GetWellCurveLineNames(out string[] names))
{
return names;
}
return new string[] { };
}
}
///
/// 岩性
///
public class LithologyListBoxProvider : ISymbolListBoxProvider
{
///
public bool Draw(string name, IntPtr hdc, int width, int height)
{
return GeoSigmaWellPoleXY.GetDrawSymbolForLithology(name, hdc, width, height);
}
///
public string[] GetNames()
{
if (GeoSigmaWellPoleXY.GetSymbolNamesForLithology(out string[] names))
{
return names;
}
return new string[] { };
}
}
///
/// 符号
///
public class SymbolListBoxProvider : ISymbolListBoxProvider
{
///
public bool Draw(string name, IntPtr hdc, int width, int height)
{
return GeoSigmaWellPoleXY.GetDrawNormalSymbol(name, hdc, width, height);
}
///
public string[] GetNames()
{
if (GeoSigmaWellPoleXY.GetNormalSymbolNames(out string[] names))
{
return names;
}
return new string[] { };
}
}
///
/// 解释结果
///
public class InterpResultListBoxProvider : ISymbolListBoxProvider
{
///
public bool Draw(string name, IntPtr hdc, int width, int height)
{
return GeoSigmaWellPoleXY.GetDrawSymbolForResult(name, hdc, width, height);
}
///
public string[] GetNames()
{
if (GeoSigmaWellPoleXY.GetSymbolNamesForResult(out string[] names))
{
return names;
}
return new string[] { };
}
}
///
/// 解释结果
///
public class StratigraphicListBoxProvider : ISymbolListBoxProvider
{
///
public bool Draw(string name, IntPtr hdc, int width, int height)
{
return GeoSigmaWellPoleXY.GetDrawStratumLith(name, hdc, width, height);
}
///
public string[] GetNames()
{
if (GeoSigmaWellPoleXY.GetStratumLithNames(out string[] names))
{
return names;
}
return new string[] { };
}
}
///
/// 连层样式
///
public class BendStyleListBoxProvider : ISymbolListBoxProvider
{
///
public bool Draw(string name, IntPtr hdc, int width, int height)
{
return GeoSigmaWellPoleXY.GetDrawSymbolBendStyle(name, hdc, width, height);
}
///
public string[] GetNames()
{
if (GeoSigmaWellPoleXY.GetStratumBendStyleNames(out string[] names))
{
return names;
}
return new string[] { };
}
}
}