You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

99 lines
2.9 KiB
C#

1 month ago
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
/// <summary>
/// 图片道属性
/// </summary>
[XmlRoot("Pcg")]
[TypeConverter(typeof(PropertySorter))]
public class WellPictureTrack
{
private const string PictureTrackCategory = "\u200B\u200B图片道";
private const string PictureBorderCategory = "\u200B图片边框";
// --- 图片道 ---
[XmlIgnore]
[Category(PictureTrackCategory)]
[DisplayName("标题")]
[PropertyOrder(0)]
public string Title
{
get => WellTrack.Name;
set => WellTrack.Name = value;
}
[XmlIgnore]
[Category(PictureTrackCategory)]
[DisplayName("宽度")]
[PropertyOrder(1)]
public double Width
{
get => WellTrack.Width;
set => WellTrack.Width = value;
}
[XmlIgnore]
[Category(PictureTrackCategory)]
[DisplayName("填充")]
[PropertyOrder(2)]
[TypeConverter(typeof(YesNoConverter))]
public bool IsFill
{
get => WellTrack.BackFill != 0;
set => WellTrack.BackFill = value ? 1 : 0;
}
[XmlIgnore]
[Category(PictureTrackCategory)]
[DisplayName("背景颜色")]
[PropertyOrder(3)]
[Editor(typeof(PropertyEditorColor), typeof(UITypeEditor))]
public Color BackgroundColor
{
get => ColorTranslator2.FromHtml(WellTrack.BackColor);
set => WellTrack.BackColor = ColorTranslator2.ToHtml(value);
}
[XmlIgnore]
[Category(PictureTrackCategory)]
[DisplayName("道头字体")]
[PropertyOrder(4)]
[Editor(typeof(PropertyEditorWellFontEx), typeof(UITypeEditor))]
public WellFontEx HeaderFont
{
get => WellTrack.Title.Font;
set => WellTrack.Title.Font = value;
}
// --- 图片边框 ---
[XmlIgnore]
[Category(PictureBorderCategory)]
[DisplayName("边框线")]
[PropertyOrder(5)]
public string BorderLine { get; set; }
[XmlAttribute]
[Browsable(false)]
public int Version { get; set; }
[XmlElement("WellTrack")]
[Browsable(false)]
public WellTrackWellTrack WellTrack { 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
}