using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Drawing.Design; using System.Windows.Forms; using System.Windows.Forms.VisualStyles; using System.Xml.Serialization; using GeoSigma.SigmaDrawerStyle; using GeoSigma.SigmaDrawerStyle.Converter; using SigmaDrawerElement; 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 /// /// 射孔道 /// [XmlRoot("Pcg")] [TypeConverter(typeof(PropertySorter))] public class WellInTrackCoring :baseInTrackObj { private const string ShotTrackCategory = "\t\t取心综合数据"; [XmlIgnore] [Category(ShotTrackCategory)] [DisplayName("顶深")] [PropertyOrder(0)] public double TopDepth { get => coring.Top; set => coring.Top = value; } [XmlIgnore] [Category(ShotTrackCategory)] [DisplayName("底深")] [PropertyOrder(1)] public double BottomDepth { get => coring.Bottom; set => coring.Bottom = value; } [XmlIgnore] [Category(ShotTrackCategory)] [DisplayName("背景颜色")] [PropertyOrder(2)] [Editor(typeof(PropertyEditorColor), typeof(UITypeEditor))] public Color BackgroundColor { get => ColorTranslator2.FromHtml(coring.BackBrush.BackColor); set => coring.BackBrush.BackColor = ColorTranslator2.ToHtml(value); } [XmlIgnore] [Category(ShotTrackCategory)] [DisplayName("名称")] [PropertyOrder(3)] public string Text { get => coring.Name; set => coring.Name = value; } [XmlIgnore] [Category(ShotTrackCategory)] [DisplayName("筒次")] [PropertyOrder(4)] public int Times { get => coring.Times; set => coring.Times = value; } [XmlIgnore] [Category(ShotTrackCategory)] [DisplayName("长度")] [PropertyOrder(5)] public double length { get => coring.Length; set => coring.Length = value; } [XmlIgnore] [PropertyOrder(6)] [Category(ShotTrackCategory)] [DisplayName("显示深度")] [TypeConverter(typeof(YesNoConverter))] public bool IsShowDepth { get { return (coring.TextOption & 1) == 1; } set { if(value) { coring.TextOption = coring.TextOption | 1; } else { coring.TextOption = coring.TextOption & ~1; } } } [XmlIgnore] [PropertyOrder(7)] [Category(ShotTrackCategory)] [DisplayName("显示长度")] [TypeConverter(typeof(YesNoConverter))] public bool IsShowLength { get { return (coring.TextOption & 2) != 0; } set { if (value) { coring.TextOption = coring.TextOption | 2; } else { coring.TextOption = coring.TextOption & ~2; } } } [XmlIgnore] [PropertyOrder(7)] [Category(ShotTrackCategory)] [DisplayName("显示收获率")] [TypeConverter(typeof(YesNoConverter))] public bool IsShowPercent { get { return (coring.TextOption & 4) != 0; } set { if (value) { coring.TextOption = coring.TextOption | 4; } else { coring.TextOption = coring.TextOption & ~4; } } } [XmlAttribute] [Browsable(false)] public int Version { get; set; } [XmlElement("Coring")] [Browsable(false)] public Coring coring { 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 public class Coring { [XmlAttribute("Name")] public string Name { get; set; } = ""; [XmlAttribute("Top")] public double Top { get; set; } [XmlAttribute("Bottom")] public double Bottom { get; set; } [XmlAttribute("Times")] public int Times { get; set; } [XmlAttribute("Length")] public double Length { get; set; } [XmlAttribute("TextOption")] public int TextOption { get; set; } [XmlElement("HunkContent")] public WellHunkContent HunkContent { get; set; } [XmlElement("BackBrush")] public BackBrushInCoring BackBrush { get; set; } [XmlElement("RenderStyle")] public RenderStyleInCoring RenderStyle { get; set; } } public class BackBrushInCoring { [XmlAttribute("Type")] public string Type { get; set; } = "Empty"; [XmlAttribute("BackColor")] public string BackColor { get; set; } = "#FFFFFF"; [XmlAttribute("ForeColor")] public string ForeColor { get; set; } = "#FF0000"; [XmlAttribute("Pattern")] public string Pattern { get; set; } = "Empty"; } public class RenderStyleInCoring { [XmlAttribute("Type")] public string Type { get; set; } = ""; [XmlAttribute("LeftSpace")] public double LeftSpace { get; set; } [XmlAttribute("RightSpace")] public double RightSpace { get; set; } [XmlAttribute("ShowDepthText")] public bool ShowDepthText { get; set; } } }