using GeoSigmaDrawLib; using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml.Serialization; namespace SigmaDrawerElement { /// /// 坐标边框类. /// public class DrawerFrame : ElementBase { /// /// Initializes a new instance of the class. /// public DrawerFrame() { ElementType = DrawElementType.ELEMENT_FRAME; } #region Coordinate [Browsable(false)] [XmlElement("Coordinate")] public DrawerCoordinateLBTR Coordinate { get; set; } = new DrawerCoordinateLBTR(); [XmlIgnore] [Category("边框"), DisplayName("\t\t\t坐标范围")] [TypeConverter(typeof(GeoSigma.SigmaDrawerStyle.Converter.BaseExpandableConverter))] public DrawerRange RangeDelta { get { return Coordinate.RangeDelta; } set { Coordinate.Create(value.Left, value.Right, value.Bottom, value.Top); } } public SizeF sizeDelta; [XmlIgnore] [Category("边框"), DisplayName("\t\t尺寸")]//, ReadOnlyAttribte(true) public SizeF SizeDelta { get { sizeDelta = new SizeF((float)Coordinate.SizeDelta.Width, (float)Coordinate.SizeDelta.Height); return sizeDelta; } private set { } } #endregion #region Other public class DfOther { [XmlAttribute] public double Thickness { get; set; } [XmlAttribute] public int BlackFrame { get; set; } [XmlAttribute] public string SymbolName { get; set; } [XmlAttribute] public int Style { get; set; } = (int)FrameStyle.FRAME_BLACK_LINE | (int)FrameStyle.modeCenter | (int)FrameStyle.COORDINATE_LEFT_BOTTOM | (int)FrameStyle.INSERT_DRAW_PLUS; } [Browsable(false)] [XmlElement("Other")] //[TypeConverter(typeof(SigmaDrawerStyle.Converter.BaseExpandableConverter))] public DfOther Other { get; set; } = new DfOther(); [XmlIgnore] [Category("边框"), DisplayName("边框厚度")] public double Thickness { get => Other.Thickness; set => Other.Thickness = value; } [XmlIgnore] [Category("边框"), DisplayName("显示为黑边框"),Browsable(false)] [TypeConverter(typeof(GeoSigma.SigmaDrawerStyle.Converter.YesNoConverter))] public bool BlackFrame { get => Other.BlackFrame == 1; set => Other.BlackFrame = value ? 1 : 0; } #endregion } }