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.
158 lines
4.2 KiB
C#
158 lines
4.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Drawing;
|
|
#if WEB_SERVICE
|
|
#else
|
|
using System.Drawing.Design;
|
|
#endif
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Xml.Serialization;
|
|
using GeoSigmaDrawLib;
|
|
|
|
namespace GeoSigma.SigmaDrawerStyle
|
|
{
|
|
[XmlRoot("CenterName")]
|
|
public class CurveCenterName : CurveView
|
|
{
|
|
/// <summary>
|
|
/// 属性类别排序
|
|
/// </summary>
|
|
private List<string> categorys = new List<string>() { "基础属性", "名字", "其他", "杂项" };
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="CurveCenterName"/> class.
|
|
/// </summary>
|
|
public CurveCenterName()
|
|
{
|
|
TypeName = "中心上名字";
|
|
}
|
|
|
|
[XmlIgnore]
|
|
[Category("其他"), DisplayName("小数位数"), Description("小数位数")]
|
|
public int DecimalName
|
|
{
|
|
get
|
|
{
|
|
return Base.DecimalName;
|
|
}
|
|
set
|
|
{
|
|
Base.DecimalName = value;
|
|
}
|
|
}
|
|
|
|
[XmlIgnore]
|
|
[Category("\t名字"), DisplayName("\t\t\t\t高度"),Description("高度")]
|
|
[TypeConverter(typeof(PropertyDoubleConverter))]
|
|
public double TextHeight
|
|
{
|
|
get
|
|
{
|
|
return Base.Height;
|
|
}
|
|
set
|
|
{
|
|
Base.Height = value;
|
|
}
|
|
}
|
|
[XmlIgnore]
|
|
[Category("\t名字"), DisplayName("\t\t\t偏移"),Description("偏移")]
|
|
//[TypeConverterAttribute(typeof(PropertyPointConvert))]
|
|
public PropertyPoint Offset
|
|
{
|
|
get
|
|
{
|
|
PropertyPoint pt = new PropertyPoint();
|
|
pt.X = Base.OffsetX;
|
|
pt.Y = Base.OffsetY;
|
|
return pt;
|
|
}
|
|
set
|
|
{
|
|
Base.OffsetX = value.X;
|
|
Base.OffsetY = value.Y;
|
|
}
|
|
}
|
|
[XmlIgnore]
|
|
[Category("\t名字"), DisplayName("\t\t角度"),Description("角度")]
|
|
[TypeConverter(typeof(PropertyDoubleConverter))]
|
|
public double Angle
|
|
{
|
|
get
|
|
{
|
|
return Base.Angle;
|
|
}
|
|
set
|
|
{
|
|
Base.Angle = value;
|
|
}
|
|
}
|
|
|
|
[XmlIgnore]
|
|
[Category("\t名字"), DisplayName("\t颜色"), Description("颜色")]
|
|
#if WEB_SERVICE
|
|
#else
|
|
[Editor(typeof(PropertyEditorColor), typeof(UITypeEditor))]
|
|
#endif
|
|
//[TypeConverter(typeof(PropertyColorIndicatorConvert))]
|
|
public Color CurveColor
|
|
{
|
|
get
|
|
{
|
|
return ColorTranslator.FromWin32(Base.ColorRef);
|
|
}
|
|
set
|
|
{
|
|
Base.ColorRef = ColorTranslator.ToWin32(value);
|
|
}
|
|
}
|
|
private Font _TextFont;
|
|
[XmlIgnore]
|
|
[Category("\t名字"), DisplayName("字体")]
|
|
public Font TextFont
|
|
{
|
|
get
|
|
{
|
|
_TextFont = Font.FromLogFont(NameFont);
|
|
return _TextFont;
|
|
}
|
|
set
|
|
{
|
|
_TextFont = value;
|
|
NameFont = LogFontConverter.convert(_TextFont);
|
|
}
|
|
}
|
|
|
|
[Browsable(false)]
|
|
[Category("基础属性"), DisplayName("基本")]
|
|
public CurveCenterNameBase Base { get; set; } = new CurveCenterNameBase();
|
|
|
|
[Browsable(false)]
|
|
[XmlElement("Font")]
|
|
public LogFont NameFont { get; set; } = LogFont.Default;
|
|
}
|
|
|
|
public class CurveCenterNameBase
|
|
{
|
|
[XmlAttribute("Height")]
|
|
public double Height { get; set; } = 60;
|
|
[XmlAttribute("Width")]
|
|
public double Width { get; set; }
|
|
[XmlAttribute("OffsetX")]
|
|
public double OffsetX { get; set; }
|
|
[XmlAttribute("OffsetY")]
|
|
public double OffsetY { get; set; }
|
|
[XmlAttribute("Angle")]
|
|
public double Angle { get; set; }
|
|
[XmlAttribute("Style")]
|
|
public int Style { get; set; }
|
|
[XmlAttribute("Color")]
|
|
public int ColorRef { get; set; }
|
|
|
|
[XmlAttribute]
|
|
public int DecimalName { get; set; } = -1;
|
|
}
|
|
}
|