using GeoSigma.SigmaDrawerStyle; using GeoSigma.SigmaDrawerStyle.Converter; using SigmaDrawerElement; using SigmaDrawerStyle; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Drawing.Design; using System.Globalization; using System.Windows.Forms; using System.Windows.Forms.VisualStyles; using System.Xml.Serialization; 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 WellInTrackCommonData : WellObjectXmlBase { private const string ShotTrackCategory = "\t\t数据"; [XmlIgnore] [Category(ShotTrackCategory)] [DisplayName("顶深")] [PropertyOrder(0)] public double TopDepth { get => rowData.Top; set => rowData.Top = value; } [XmlIgnore] [Category(ShotTrackCategory)] [DisplayName("底深")] [PropertyOrder(1)] public double BottomDepth { get => rowData.Bottom; set => rowData.Bottom = value; } [XmlIgnore] [Category("数据设置")] [DisplayName("数据"), PropertyOrder(7)] [Editor(typeof(PropertyEditorInTrackCommonData), typeof(UITypeEditor))] public CDataItemInTrackList dataItems { get { return rowData.DataItems; } set { rowData.DataItems.Clear(); rowData.DataItems.AddRange(value); } } [XmlAttribute] [Browsable(false)] public int Version { get; set; } [XmlElement("RowData")] [Browsable(false)] public RowData rowData { get; set; } private const string vDepthCategory = "\t垂深"; [XmlIgnore] [Category(vDepthCategory)] [DisplayName("顶深")] [ReadOnly(true)] [PropertyOrder(1)] public string topStr { get { if (vdpeth.vid == 0) return ""; else return vdpeth.top.ToString(); } } [XmlIgnore] [Category(vDepthCategory)] [DisplayName("底深")] [ReadOnly(true)] [PropertyOrder(2)] public string bottomStr { get { if (vdpeth.vid == 0) return ""; else return vdpeth.bottom.ToString(); } } [XmlElement("VerticalDepth")] [Browsable(false)] public VerticalDepth vdpeth { get; set; } } public class RowData { [XmlAttribute("Top")] public double Top { get; set; } [XmlAttribute("Bottom")] public double Bottom { get; set; } [XmlElement("RenderStyle")] public RenderStyleInTrackCommonData RenderStyle { get; set; } [XmlElement("DataItem")] // public List DataItems { get; set; } = new List(); public CDataItemInTrackList DataItems { get; set; } } [TypeConverter(typeof(CDataItemInTrackListConverter))] public class CDataItemInTrackList : List { public CDataItemInTrackList() { } public override string ToString() { //string rstr = RefTableId; //rstr = tableInfoQuery.tableChsName(rstr); string rstr = ""; foreach (DataItemInTrack item in this) { rstr = rstr + ' ' + item.Value; } rstr = rstr.TrimStart(' '); return rstr; } } public class CDataItemInTrackListConverter : CollectionConverter { public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { if (destinationType == typeof(string) && value is CDataItemInTrackList list) { return list.ToString(); // 使用自定义 ToString } return base.ConvertTo(context, culture, value, destinationType); } } public class RenderStyleInTrackCommonData { [XmlAttribute("Type")] public string Type { get; set; } [XmlAttribute("LayerBorderColor")] public string LayerBorderColor { get; set; } [XmlAttribute("LayerBorderWidth")] public string LayerBorderWidth { get; set; } [XmlAttribute("BackColor")] public string BackColor { get; set; } } public class DataItemInTrack { [XmlAttribute("Value")] public string Value { get; set; } [XmlAttribute("RefColId")] public string RefColId { get; set; } public override string ToString() { string str = Value??""; return str; } } #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 }