You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

182 lines
5.5 KiB
C#

using System.ComponentModel;
using System.Drawing;
using System.Drawing.Design;
using System.Xml.Serialization;
using GeoSigma.SigmaDrawerStyle;
using GeoSigma.SigmaDrawerStyle.Converter;
using SigmaDrawerStyle;
namespace GeoSigma.SigmaDrawerElement
{
#pragma warning disable SA1402 // File may only contain a single type
#pragma warning disable SA1600 // Elements should be documented
#pragma warning disable SA1649 // File name should match first type name
/// <summary>
/// 井壁取心道属性
/// </summary>
[XmlRoot("Pcg")]
[TypeConverter(typeof(PropertySorter))]
public class WellWallCoreTrack
{
private const string WellCoreCategory = "\t\t井壁取心道";
private const string TrackObjectSettingsCategory = "\t道内对象设置";
// === 井壁取心道 ===
[XmlIgnore]
[PropertyOrder(0)]
[Category(WellCoreCategory)]
[DisplayName("标题")]
public string Title
{
get => WellTrack.Title.Font.Text;
set => WellTrack.Title.Font.Text = value;
}
[XmlIgnore]
[PropertyOrder(1)]
[Category(WellCoreCategory)]
[DisplayName("宽度")]
public double Width
{
get => WellTrack.Width;
set => WellTrack.Width = value;
}
[XmlIgnore]
[PropertyOrder(2)]
[Category(WellCoreCategory)]
[DisplayName("填充")]
[TypeConverter(typeof(YesNoConverter))]
public bool IsFill
{
get => WellTrack.BackFill != 0;
set => WellTrack.BackFill = value ? 1 : 0;
}
[XmlIgnore]
[PropertyOrder(3)]
[Category(WellCoreCategory)]
[DisplayName("背景颜色")]
[Editor(typeof(PropertyEditorColor), typeof(UITypeEditor))]
public Color BackgroundColor
{
get => ColorTranslator2.FromHtml(WellTrack.BackColor);
set => WellTrack.BackColor = ColorTranslator2.ToHtml(value);
}
[XmlIgnore]
[PropertyOrder(4)]
[Category(WellCoreCategory)]
[DisplayName("道头字体")]
[Editor(typeof(PropertyEditorWellFontEx), typeof(UITypeEditor))]
public WellFontEx HeaderFont
{
get => WellTrack.Title.Font;
set => WellTrack.Title.Font = value;
}
// === 道内对象设置 ===
[XmlIgnore]
[PropertyOrder(5)]
[Category(TrackObjectSettingsCategory)]
[DisplayName("取心数据字体")]
[Editor(typeof(PropertyEditorWellFontEx), typeof(UITypeEditor))]
public WellFontEx CoreDataFont
{
get => LayerStyleHelper.GetFontEx(WellTrack.LayerStyle);
set => LayerStyleHelper.SetFontEx(WellTrack.LayerStyle, value);
}
[XmlIgnore]
[Category(TrackObjectSettingsCategory)]
[DisplayName("边框线")]
[PropertyOrder(6)]
[Editor(typeof(PropertyEditorWellCurveStyle), typeof(UITypeEditor))]
public WellLineStyle BorderLine
{
get => LayerStyleHelper.GetWellLineStyle(WellTrack.LayerStyle);
set => LayerStyleHelper.SetWellLineStyle(WellTrack.LayerStyle, value);
}
[XmlIgnore]
[PropertyOrder(7)]
[Category(TrackObjectSettingsCategory)]
[DisplayName("取心数据颜色填充")]
[TypeConverter(typeof(YesNoConverter))]
public bool FillCoreDataColor
{
get
{
return (WellTrack.coreSideStyle.Style & 4) != 0;
}
set
{
if (value)
{
WellTrack.coreSideStyle.Style = WellTrack.coreSideStyle.Style | 4;
}
else
{
WellTrack.coreSideStyle.Style = WellTrack.coreSideStyle.Style & ~4;
}
}
}
//[XmlIgnore]
//[PropertyOrder(8)]
//[Category(TrackObjectSettingsCategory)]
//[DisplayName("显示取心次数")]
//[TypeConverter(typeof(YesNoConverter))]
//public bool ShowCoreCount { get; set; } = true;
[XmlIgnore]
[PropertyOrder(9)]
[Category(TrackObjectSettingsCategory)]
[DisplayName("取心数据显示左侧")]
[TypeConverter(typeof(YesNoConverter))]
public bool ShowCoreDataLeft
{
get
{
return (WellTrack.coreSideStyle.Style & 1) != 0;
}
set
{
if (value)
{
WellTrack.coreSideStyle.Style = WellTrack.coreSideStyle.Style | 1;
}
else
{
WellTrack.coreSideStyle.Style = WellTrack.coreSideStyle.Style & ~1;
}
}
}
[XmlIgnore]
[PropertyOrder(10)]
[Category(TrackObjectSettingsCategory)]
[DisplayName("符号高度")]
public double Height
{
get => WellTrack.coreSideStyle.DataHeight;
set => WellTrack.coreSideStyle.DataHeight = value;
}
[Browsable(false)]
[XmlAttribute("Version")]
public string Version { get; set; }
[Browsable(false)]
[XmlElement("WellTrack")]
public WellTrackWellTrack WellTrack { get; set; }
}
#pragma warning restore SA1649 // File name should match first type name
#pragma warning restore SA1600 // Elements should be documented
#pragma warning restore SA1402 // File may only contain a single type
}