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 /// /// 层组属性 /// [XmlRoot("Pcg")] [TypeConverter(typeof(PropertySorter))] public class WellLayerGroup : baseInTrackObj { private const string layerGroupCategory = "\t\t层组"; [XmlIgnore] [Category(layerGroupCategory)] [DisplayName("顶深")] [PropertyOrder(0)] public double TopDepth { get => layerGroup.Top; set => layerGroup.Top = value; } [XmlIgnore] [Category(layerGroupCategory)] [DisplayName("底深")] [PropertyOrder(1)] public double BottomDepth { get => layerGroup.Bottom; set => layerGroup.Bottom = value; } [XmlIgnore] [Category(layerGroupCategory)] [DisplayName("层名")] [PropertyOrder(2)] public string LayerName { get => layerGroup.Name; set => layerGroup.Name = value; } [XmlIgnore] [Category(layerGroupCategory)] [DisplayName("文本内容")] [PropertyOrder(3)] public string TextContent { get => layerGroup.LayerText; set => layerGroup.LayerText = value; } [XmlIgnore] [Category(layerGroupCategory)] [DisplayName("背景颜色")] [PropertyOrder(4)] [Editor(typeof(PropertyEditorColor), typeof(UITypeEditor))] public Color BackgroundColor { get => ColorTranslator2.FromHtml(layerGroup.BackColor); set => layerGroup.BackColor = ColorTranslator2.ToHtml(value); } [XmlIgnore] [Category(layerGroupCategory)] [DisplayName("字体")] [PropertyOrder(5)] [Editor(typeof(PropertyEditorWellFontEx), typeof(UITypeEditor))] public WellFontEx Font { get => layerGroup.Font; set => layerGroup.Font = value; } [XmlIgnore] [Category(layerGroupCategory)] [DisplayName("岩性")] [PropertyOrder(6)] [TypeConverter(typeof(YesNoConverter))] [ListBoxEditor("Stratigraphic")] [Editor(typeof(PropertyEditorListBox), typeof(UITypeEditor))] public string Lithology { get => layerGroup.Facies; set => layerGroup.Facies = value; } [XmlIgnore] [Category(layerGroupCategory)] [DisplayName("是否顶部不整合")] [PropertyOrder(7)] [TypeConverter(typeof(YesNoConverter))] public bool IsTopUnconformity { get => layerGroup.TopUncomformity; set => layerGroup.TopUncomformity = value; } [XmlIgnore] [Category(layerGroupCategory)] [DisplayName("底部未穿孔")] [PropertyOrder(8)] [TypeConverter(typeof(YesNoConverter))] public bool IsBottomUnPerforated { get => layerGroup.BottomUnacross; set => layerGroup.BottomUnacross = value; } [XmlAttribute("Version")] [Browsable(false)] public int Version { get; set; } private IWellLayerGroup layerGroup { get { if (StratiUnit != null) { return StratiUnit; } else if(SandSet != null) { return SandSet; } else { return ReservoirGroup; } } } [XmlElement("StratiUnit")] [Browsable(false)] public WellLayerGroupStratiUnit StratiUnit { get; set; } [XmlElement("SandSet")] [Browsable(false)] public WellLayerGroupSandSet SandSet { get; set; } [XmlElement("ReservoirGroup")] [Browsable(false)] public WellLayerGroupSandSet ReservoirGroup { get; set; } } public interface IWellLayerGroup { double Top { get; set; } double Bottom { get; set; } string Name { get; set; } string LayerText { get; set; } string BackColor { get; set; } WellFontEx Font { get; set; } bool TopUncomformity { get; set; } bool BottomUnacross { get; set; } string Facies { get; set; } } public class WellLayerGroupStratiUnit : IWellLayerGroup { [XmlAttribute("Name")] public string Name { get; set; } [XmlAttribute("Top")] public double Top { get; set; } [XmlAttribute("Bottom")] public double Bottom { get; set; } [XmlAttribute("Align")] public string Align { get; set; } [XmlAttribute("BackColor")] public string BackColor { get; set; } [XmlAttribute("LayerText")] public string LayerText { get; set; } [XmlAttribute("TopUncomformity")] public bool TopUncomformity { get; set; } [XmlAttribute("BottomUnacross")] public bool BottomUnacross { get; set; } [XmlAttribute("Facies")] public string Facies { get; set; } [XmlElement("Font")] public WellFontEx Font { get; set; } [XmlElement("RenderStyle")] public WellRenderStyle RenderStyle { get; set; } } public class WellLayerGroupSandSet : IWellLayerGroup { [XmlAttribute("Name")] public string Name { get; set; } [XmlAttribute("Top")] public double Top { get; set; } [XmlAttribute("Bottom")] public double Bottom { get; set; } [XmlAttribute("Align")] public string Align { get; set; } [XmlAttribute("BackColor")] public string BackColor { get; set; } [XmlAttribute("LayerText")] public string LayerText { get; set; } [XmlAttribute("TopUncomformity")] public bool TopUncomformity { get; set; } [XmlAttribute("BottomUnacross")] public bool BottomUnacross { get; set; } [XmlAttribute("Facies")] public string Facies { get; set; } [XmlElement("Font")] public WellFontEx Font { 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 }