using System.Collections.Generic; using System.ComponentModel; using System.Drawing.Design; 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 public enum WellSymbolFillType { Center, Stretch, HorizontalFill, VerticalFill, } public class WellSymbolFillTypeConverter : EnumConverter { public static readonly Dictionary Maps = new Dictionary() { { WellSymbolFillType.Center, "居中" }, { WellSymbolFillType.Stretch, "铺满" }, { WellSymbolFillType.HorizontalFill, "横向拉伸" }, { WellSymbolFillType.VerticalFill, "纵向拉伸" }, }; protected override Dictionary CreateMaps() { return Maps; } } /// /// 射孔道 /// [XmlRoot("Pcg")] [TypeConverter(typeof(PropertySorter))] public class WellSymbolInnerTrack : baseInTrackObj { private const string SymbolCategory = "\t\t设置符号"; private static readonly Dictionary FillTypeMap = new Dictionary { { WellSymbolFillType.Center, "None" }, { WellSymbolFillType.Stretch, "All" }, { WellSymbolFillType.HorizontalFill, "Horz" }, { WellSymbolFillType.VerticalFill, "Vert" }, }; [XmlIgnore] [Category(SymbolCategory)] [DisplayName("顶深")] [PropertyOrder(0)] public double TopDepth { get => SymbolData.Top; set => SymbolData.Top = value; } [XmlIgnore] [Category(SymbolCategory)] [DisplayName("底深")] [PropertyOrder(1)] public double BottomDepth { get => SymbolData.Bottom; set => SymbolData.Bottom = value; } [XmlIgnore] [Category(SymbolCategory)] [DisplayName("符号")] [PropertyOrder(2)] [ListBoxEditor("Symbol")] [Editor(typeof(PropertyEditorListBox), typeof(UITypeEditor))] public string Symbol { get => SymbolData.SymbolName; set => SymbolData.SymbolName = value; } [XmlIgnore] [Category(SymbolCategory)] [DisplayName("显示方式")] [PropertyOrder(3)] [TypeConverter(typeof(WellSymbolFillTypeConverter))] public WellSymbolFillType ShowType { get => DictionaryHelper.Reverse(FillTypeMap)[SymbolData.FillMode]; set => SymbolData.FillMode = FillTypeMap[value]; } [Browsable(false)] [XmlAttribute("Version")] public string Version { get; set; } [Browsable(false)] [XmlElement("Symbol")] public WellSymbolInnerSymbol SymbolData { get; set; } } public class WellSymbolInnerSymbol { [XmlAttribute("Top")] public double Top { get; set; } [XmlAttribute("Bottom")] public double Bottom { get; set; } [XmlAttribute("FillMode")] public string FillMode { get; set; } [XmlAttribute("SymbolName")] public string SymbolName { get; set; } [XmlElement("RenderStyle")] public WellRenderStyle RenderStyle { 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 }