|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
|
#if WEB_SERVICE
|
|
|
|
|
|
#else
|
|
|
|
|
|
using System.Drawing.Design;
|
|
|
|
|
|
#endif
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using System.Xml.Serialization;
|
|
|
|
|
|
using GeoSigmaDrawLib;
|
|
|
|
|
|
using SigmaDrawerStyle;
|
|
|
|
|
|
|
|
|
|
|
|
namespace GeoSigma.SigmaDrawerStyle
|
|
|
|
|
|
{
|
|
|
|
|
|
[XmlRoot("InName")]
|
|
|
|
|
|
[TypeConverter(typeof(PropertySorter))]
|
|
|
|
|
|
public class CurveInName : CurveView
|
|
|
|
|
|
{
|
|
|
|
|
|
// ==================== 分类常量 ====================
|
|
|
|
|
|
private const string TextProperty = "\t\t\t文字";
|
|
|
|
|
|
private const string LineProperty = "\t\t线属性";
|
|
|
|
|
|
private const string WaveProperty = "\t波浪线属性";
|
|
|
|
|
|
private const string OtherProperty = "其它";
|
|
|
|
|
|
|
|
|
|
|
|
public CurveInName()
|
|
|
|
|
|
{
|
|
|
|
|
|
TypeName = "线中心";
|
|
|
|
|
|
_curveWave.T = 30000;
|
|
|
|
|
|
_curveWave.A = 20000;
|
|
|
|
|
|
_curveWave.dnum = 10;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ==================== 文字属性 ====================
|
|
|
|
|
|
|
|
|
|
|
|
private Font _TextFont;
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(TextProperty), DisplayName("字体"), PropertyOrder(1)]
|
|
|
|
|
|
[TypeConverterAttribute(typeof(FontPropertyConvert))]
|
|
|
|
|
|
public Font TextFont
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
_TextFont = Font.FromLogFont(NameFont);
|
|
|
|
|
|
return _TextFont;
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
_TextFont = value;
|
|
|
|
|
|
NameFont = LogFontConverter.convert(_TextFont);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(TextProperty), DisplayName("高度"), PropertyOrder(2)]
|
|
|
|
|
|
[TypeConverter(typeof(PropertyDoubleConverter))]
|
|
|
|
|
|
public double TextHeight
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return Text.Height; }
|
|
|
|
|
|
set { Text.Height = value; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(TextProperty), DisplayName("步长 | 数目"), PropertyOrder(3)]
|
|
|
|
|
|
[TypeConverter(typeof(Converter.CurveNameLineTypeConverter))]
|
|
|
|
|
|
public int InNameType
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return Style.Value & ((int)LineType.PLINE_MARK_NAME_NUM | (int)LineType.PLINE_MARK_NAME_STEP);
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
Style.Value &= ~((int)LineType.PLINE_MARK_NAME_NUM | (int)LineType.PLINE_MARK_NAME_STEP);
|
|
|
|
|
|
Style.Value |= value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Browsable(true)]
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(TextProperty), DisplayName("数目"), PropertyOrder(4)]
|
|
|
|
|
|
[Range(1, 100)]
|
|
|
|
|
|
public int NameNum
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return (int)(Text.NumOrStep + 0.0001); }
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
if (value <= 0) throw new ArgumentOutOfRangeException("数目必须大于 0。");
|
|
|
|
|
|
Text.NumOrStep = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Browsable(true)]
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(TextProperty), DisplayName("步长"), PropertyOrder(5)]
|
|
|
|
|
|
[Range(0.01, double.MaxValue)]
|
|
|
|
|
|
[TypeConverter(typeof(PropertyDoubleConverter))]
|
|
|
|
|
|
public double Step
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return Text.NumOrStep; }
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
if (value <= 0) throw new ArgumentOutOfRangeException("步长必须大于 0。");
|
|
|
|
|
|
Text.NumOrStep = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(TextProperty), DisplayName("偏移"), PropertyOrder(6)]
|
|
|
|
|
|
[TypeConverter(typeof(PropertyDoubleConverter))]
|
|
|
|
|
|
public double Offset
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return Text.Offset; }
|
|
|
|
|
|
set { Text.Offset = value; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(TextProperty), DisplayName("颜色"), PropertyOrder(7)]
|
|
|
|
|
|
#if WEB_SERVICE
|
|
|
|
|
|
#else
|
|
|
|
|
|
[Editor(typeof(PropertyEditorColor), typeof(UITypeEditor))]
|
|
|
|
|
|
#endif
|
|
|
|
|
|
[TypeConverter(typeof(PropertyColorIndicatorConvert))]
|
|
|
|
|
|
public Color TextColor
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return ColorTranslator.FromWin32(Text.ColorRef); }
|
|
|
|
|
|
set { Text.ColorRef = ColorTranslator.ToWin32(value); }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(TextProperty), DisplayName("自动缩小字体"), PropertyOrder(8)]
|
|
|
|
|
|
[TypeConverter(typeof(Converter.YesNoConverter))]
|
|
|
|
|
|
public bool AutoDecrease
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return (Style.Value & (int)Constants.PLINE_IN_NAME_AUTO_DECREASE) != 0; }
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
if (value) Style.Value |= (int)Constants.PLINE_IN_NAME_AUTO_DECREASE;
|
|
|
|
|
|
else Style.Value &= ~(int)Constants.PLINE_IN_NAME_AUTO_DECREASE;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ==================== 线属性 ====================
|
|
|
|
|
|
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(LineProperty), DisplayName("宽度"), PropertyOrder(1)]
|
|
|
|
|
|
[TypeConverter(typeof(PropertyDoubleConverter))]
|
|
|
|
|
|
public double Width
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return Curve.Width; }
|
|
|
|
|
|
set { Curve.Width = value; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(LineProperty), DisplayName("颜色"), PropertyOrder(2)]
|
|
|
|
|
|
#if WEB_SERVICE
|
|
|
|
|
|
#else
|
|
|
|
|
|
[Editor(typeof(PropertyEditorColor), typeof(UITypeEditor))]
|
|
|
|
|
|
#endif
|
|
|
|
|
|
public Color CurveColor
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return ColorTranslator.FromWin32(Curve.ColorRef); }
|
|
|
|
|
|
set { Curve.ColorRef = ColorTranslator.ToWin32(value); }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//关键修改:样式支持平行和波浪线(使用已有的 CurveLineStyle 枚举)
|
|
|
|
|
|
[Category(LineProperty), DisplayName("样式"), PropertyOrder(3)]
|
|
|
|
|
|
[TypeConverter(typeof(Converter.CurveTypeConverter))]
|
|
|
|
|
|
public CurveLineType CurveStyle
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
if (hasLineType(LineType.PLINE_ZERO))
|
|
|
|
|
|
{
|
|
|
|
|
|
return CurveLineType.Default;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (hasLineType(LineType.PLINE_NODRAW))
|
|
|
|
|
|
{
|
|
|
|
|
|
return CurveLineType.NoDraw;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (hasLineType(LineType.PLINE_CLOSE))
|
|
|
|
|
|
{
|
|
|
|
|
|
return CurveLineType.Close;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (hasLineType(LineType.PLINE_OFFSET))
|
|
|
|
|
|
{
|
|
|
|
|
|
return CurveLineType.Offset;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (hasLineType(LineType.PLINE_WAVE))
|
|
|
|
|
|
{
|
|
|
|
|
|
return CurveLineType.Wave;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return CurveLineType.Default;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
clearLineType(LineType.PLINE_ZERO);
|
|
|
|
|
|
clearLineType(LineType.PLINE_NODRAW);
|
|
|
|
|
|
clearLineType(LineType.PLINE_CLOSE);
|
|
|
|
|
|
clearLineType(LineType.PLINE_OFFSET);
|
|
|
|
|
|
clearLineType(LineType.PLINE_WAVE);
|
|
|
|
|
|
|
|
|
|
|
|
if (value == CurveLineType.Default)
|
|
|
|
|
|
{
|
|
|
|
|
|
setLineType(LineType.PLINE_ZERO);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (value == CurveLineType.NoDraw)
|
|
|
|
|
|
{
|
|
|
|
|
|
setLineType(LineType.PLINE_NODRAW);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (value == CurveLineType.Close)
|
|
|
|
|
|
{
|
|
|
|
|
|
setLineType(LineType.PLINE_CLOSE);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (value == CurveLineType.Offset)
|
|
|
|
|
|
{
|
|
|
|
|
|
setLineType(LineType.PLINE_OFFSET);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (value == CurveLineType.Wave)
|
|
|
|
|
|
{
|
|
|
|
|
|
setLineType(LineType.PLINE_WAVE);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
setLineType(LineType.PLINE_ZERO);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(LineProperty), DisplayName("线端"), PropertyOrder(4)]
|
|
|
|
|
|
[TypeConverter(typeof(Converter.CurveCapConverter))]
|
|
|
|
|
|
public CurveCap CurveLineCap
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return hasLineType(LineType.PLINE_SMOOTH_HEAD) ? CurveCap.Round : CurveCap.Square; }
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
if (value == CurveCap.Round) setLineType(LineType.PLINE_SMOOTH_HEAD);
|
|
|
|
|
|
else clearLineType(LineType.PLINE_SMOOTH_HEAD);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(LineProperty), DisplayName("平滑"), PropertyOrder(5)]
|
|
|
|
|
|
[TypeConverter(typeof(Converter.CurveSmoothnessConverter))]
|
|
|
|
|
|
public CurveSmoothness CurveSmoothness
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
if (hasLineType(LineType.PLINE_BEZIER)) return CurveSmoothness.Bezier;
|
|
|
|
|
|
if (hasLineType(LineType.PLINE_SPLINE)) return CurveSmoothness.Spline;
|
|
|
|
|
|
return CurveSmoothness.None;
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
clearLineType(LineType.PLINE_BEZIER);
|
|
|
|
|
|
clearLineType(LineType.PLINE_SPLINE);
|
|
|
|
|
|
if (value == CurveSmoothness.Bezier) setLineType(LineType.PLINE_BEZIER);
|
|
|
|
|
|
else if (value == CurveSmoothness.Spline) setLineType(LineType.PLINE_SPLINE);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(LineProperty), DisplayName("光滑步长"), PropertyOrder(6)]
|
|
|
|
|
|
[TypeConverter(typeof(PropertyDoubleConverter))]
|
|
|
|
|
|
public double SmoothStep
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return Curve.SmoothStep; }
|
|
|
|
|
|
set { Curve.SmoothStep = value; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(LineProperty), DisplayName("透明"), PropertyOrder(7)]
|
|
|
|
|
|
[TypeConverter(typeof(Converter.CurveAlphaModeConverter))]
|
|
|
|
|
|
public CurveAlphaMode CurveAlphaMode
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
if (hasLineType(LineType.PLINE_TRANSPARENT)) return CurveAlphaMode.Transparent;
|
|
|
|
|
|
if (hasLineType(LineType.PLINE_TRANSPARENT_VALUE)) return CurveAlphaMode.Alphand;
|
|
|
|
|
|
return CurveAlphaMode.None;
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
clearLineType(LineType.PLINE_TRANSPARENT);
|
|
|
|
|
|
clearLineType(LineType.PLINE_TRANSPARENT_VALUE);
|
|
|
|
|
|
if (value == CurveAlphaMode.Transparent) setLineType(LineType.PLINE_TRANSPARENT);
|
|
|
|
|
|
else if (value == CurveAlphaMode.Alphand) setLineType(LineType.PLINE_TRANSPARENT_VALUE);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(LineProperty), DisplayName("充填"), PropertyOrder(8)]
|
|
|
|
|
|
[TypeConverter(typeof(Converter.YesNoConverter))]
|
|
|
|
|
|
public bool IsFill
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return hasLineType(LineType.PLINE_SOLID); }
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
if (value) setLineType(LineType.PLINE_SOLID);
|
|
|
|
|
|
else clearLineType(LineType.PLINE_SOLID);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(LineProperty), DisplayName("仅拐点处虚线"), PropertyOrder(9)]
|
|
|
|
|
|
[TypeConverter(typeof(Converter.YesNoConverter))]
|
|
|
|
|
|
public bool OnlyNodeVirture
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return _curveVirture.OnlyNodeVirture; }
|
|
|
|
|
|
set { _curveVirture.OnlyNodeVirture = value; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(LineProperty), DisplayName("虚线 (有线长度 无线长度 ...)"), PropertyOrder(10)]
|
|
|
|
|
|
public string VirtureValues
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return _curveVirture.VirtureValues; }
|
|
|
|
|
|
set { _curveVirture.VirtureValues = value; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(LineProperty), DisplayName("平行间距"), PropertyOrder(11)]
|
|
|
|
|
|
[TypeConverter(typeof(PropertyDoubleConverter))]
|
|
|
|
|
|
public double LineOffset
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return Curve.Offset; }
|
|
|
|
|
|
set { Curve.Offset = value; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ==================== 波浪线属性(独立分类)====================
|
|
|
|
|
|
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(WaveProperty), DisplayName("周期"), PropertyOrder(1)]
|
|
|
|
|
|
[TypeConverter(typeof(PropertyDoubleConverter))]
|
|
|
|
|
|
public double WaveT
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return _curveWave.T; }
|
|
|
|
|
|
set { _curveWave.T = value; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(WaveProperty), DisplayName("振幅"), PropertyOrder(2)]
|
|
|
|
|
|
[TypeConverter(typeof(PropertyDoubleConverter))]
|
|
|
|
|
|
public double WaveA
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return _curveWave.A; }
|
|
|
|
|
|
set { _curveWave.A = value; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(WaveProperty), DisplayName("采样点数"), PropertyOrder(3)]
|
|
|
|
|
|
[TypeConverter(typeof(PropertyIntConverter))]
|
|
|
|
|
|
public int WaveNum
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return _curveWave.dnum; }
|
|
|
|
|
|
set { _curveWave.dnum = value; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ==================== 内部对象 ====================
|
|
|
|
|
|
|
|
|
|
|
|
[Browsable(false)]
|
|
|
|
|
|
public InNameStyle Style { get; set; } = new InNameStyle();
|
|
|
|
|
|
|
|
|
|
|
|
private InNameText text;
|
|
|
|
|
|
[Browsable(false)]
|
|
|
|
|
|
public InNameText Text
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
if (text == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
text = new InNameText();
|
|
|
|
|
|
text.Height = 60;
|
|
|
|
|
|
text.NumOrStep = 1;
|
|
|
|
|
|
text.ColorRef = 255;
|
|
|
|
|
|
}
|
|
|
|
|
|
return text;
|
|
|
|
|
|
}
|
|
|
|
|
|
set { text = value; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Browsable(false)]
|
|
|
|
|
|
public InNameCurve Curve { get; set; } = new InNameCurve();
|
|
|
|
|
|
|
|
|
|
|
|
private CurveVirtureType _curveVirture;
|
|
|
|
|
|
[Browsable(false)]
|
|
|
|
|
|
[XmlElement("VirtualLine")]
|
|
|
|
|
|
public CurveVirtureType CurveVirture
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return _curveVirture; }
|
|
|
|
|
|
set { _curveVirture = value; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private CurveWaveStyle _curveWave;
|
|
|
|
|
|
[Browsable(false)]
|
|
|
|
|
|
[XmlElement("Wave")]
|
|
|
|
|
|
public CurveWaveStyle CurveWave
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return _curveWave; }
|
|
|
|
|
|
set { _curveWave = value; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Browsable(false)]
|
|
|
|
|
|
[XmlElement("Font")]
|
|
|
|
|
|
public LogFont NameFont { get; set; } = LogFont.Default;
|
|
|
|
|
|
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
|
[Category(OtherProperty), DisplayName("小数位数"), PropertyOrder(1)]
|
|
|
|
|
|
[TypeConverterAttribute(typeof(PropertyIntConverter))]
|
|
|
|
|
|
public int DecimalName
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return Text.DecimalName; }
|
|
|
|
|
|
set { Text.DecimalName = value; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override PropertyDescriptorCollection ReOrderProperties(PropertyDescriptorCollection properties)
|
|
|
|
|
|
{
|
|
|
|
|
|
PropertyDescriptor itemHide = null;
|
|
|
|
|
|
if (InNameType == (int)LineType.PLINE_MARK_NAME_NUM)
|
|
|
|
|
|
itemHide = properties.Find("Step", true);
|
|
|
|
|
|
else
|
|
|
|
|
|
itemHide = properties.Find("NameNum", true);
|
|
|
|
|
|
|
|
|
|
|
|
var list = new PropertyDescriptor[properties.Count - 1];
|
|
|
|
|
|
int i = 0;
|
|
|
|
|
|
foreach (PropertyDescriptor pd in properties)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!pd.DisplayName.Equals(itemHide.DisplayName))
|
|
|
|
|
|
{
|
|
|
|
|
|
list[i] = pd;
|
|
|
|
|
|
i++;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return new PropertyDescriptorCollection(list, true);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private bool hasLineType(LineType lineType)
|
|
|
|
|
|
{
|
|
|
|
|
|
return (Style.Value & (int)lineType) != 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void setLineType(LineType lineType)
|
|
|
|
|
|
{
|
|
|
|
|
|
Style.Value |= (int)lineType;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void clearLineType(LineType lineType)
|
|
|
|
|
|
{
|
|
|
|
|
|
Style.Value &= ~(int)lineType;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class InNameStyle
|
|
|
|
|
|
{
|
|
|
|
|
|
[XmlAttribute]
|
|
|
|
|
|
public int Value { get; set; } = (int)LineType.PLINE_SMOOTH_HEAD |
|
|
|
|
|
|
(int)LineType.PLINE_MARK_NAME_NUM |
|
|
|
|
|
|
Constants.PLINE_IN_NAME_AUTO_DECREASE;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class InNameText
|
|
|
|
|
|
{
|
|
|
|
|
|
[XmlAttribute]
|
|
|
|
|
|
public double Height { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[XmlAttribute("Color")]
|
|
|
|
|
|
public int ColorRef { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[XmlAttribute]
|
|
|
|
|
|
public double NumOrStep { get; set; } = 1;
|
|
|
|
|
|
|
|
|
|
|
|
[XmlAttribute]
|
|
|
|
|
|
public double Offset { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[XmlAttribute]
|
|
|
|
|
|
public int DecimalName { get; set; } = -1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class InNameCurve
|
|
|
|
|
|
{
|
|
|
|
|
|
[XmlAttribute]
|
|
|
|
|
|
public double Width { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[XmlAttribute("Color")]
|
|
|
|
|
|
public int ColorRef { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[XmlAttribute]
|
|
|
|
|
|
public double SmoothStep { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[XmlAttribute]
|
|
|
|
|
|
public double Offset { get; set; } // 平行间距
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|