//
// Copyright (c) PlaceholderCompany. All rights reserved.
//
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
using GeoSigmaDrawLib;
using SigmaDrawerStyle;
namespace SigmaDrawerElement
{
///
/// 图元组.
///
[TypeConverter(typeof(PropertySorter))]
public class DrawerGroup : ElementBase
{
///
/// Initializes a new instance of the class.
///
public DrawerGroup()
{
ElementType = DrawElementType.ELEMENT_BLOCK;
}
[Browsable(false)]
[XmlAttribute("Flags")]
public int Flags { get; set; }
[Category("基础属性"), DisplayName("数据范围"), ReadOnly(true), PropertyOrder(2)]
[XmlElement("MapRange")]
public string MapRange { get; set; }
[Browsable(false)]
[XmlElement("Range")]
public string RangeProxy
{
get
{
return $"{Range.Left}, {Range.Top}, {Range.Right}, {Range.Bottom}";
}
set
{
try
{
double[] values = value.Split(",").Select(Double.Parse).ToArray();
if (values.Length >= 4)
{
Range = RectangleD.FromLTRB(values[0], values[1], values[2], values[3]);
}
}
catch (Exception)
{
}
}
}
///
/// 图件范围
///
[XmlIgnore]
[Browsable(false)]
public RectangleD Range { get; set; }
}
}