Files
SourceCode/PROMS/Volian.Svg.Library/SvgImage.cs
T

73 lines
2.2 KiB
C#

using System.Xml.Serialization;
using System.ComponentModel;
using System.Drawing;
namespace Volian.Svg.Library
{
public partial class SvgImage : SvgPart
{
#region ctor
public SvgImage() { ;}
public SvgImage(PointF location, SizeF size, string path)
{
X.Value = location.X;
Y.Value = location.Y;
Width.Value = size.Width;
Height.Value = size.Height;
ImagePath = path;
}
#endregion
#region Location
[XmlIgnore]
public SvgMeasurement X { get; set; } = new SvgMeasurement();
[XmlAttribute("x")]
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public string X_XmlSurrogate
{
get { return SvgXmlConverter<SvgMeasurement>.GetString(X); }
set { X = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
}
[XmlIgnore]
public SvgMeasurement Y { get; set; } = new SvgMeasurement();
[XmlAttribute("y")]
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public string Y_XmlSurrogate
{
get { return SvgXmlConverter<SvgMeasurement>.GetString(Y); }
set { Y = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
}
#endregion
#region Size
[XmlIgnore]
public SvgMeasurement Width { get; set; } = new SvgMeasurement();
[XmlAttribute("width")]
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public string Width_WidthmlSurrogate
{
get { return SvgXmlConverter<SvgMeasurement>.GetString(Width); }
set { Width = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
}
[XmlIgnore]
public SvgMeasurement Height { get; set; } = new SvgMeasurement();
[XmlAttribute("height")]
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public string Height_XmlSurrogate
{
get { return SvgXmlConverter<SvgMeasurement>.GetString(Height); }
set { Height = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
}
#endregion
#region Path to Image File
[XmlAttribute(AttributeName = "href", Namespace = "http://www.w3.org/1999/xlink")]
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public string ImagePath { get; set; } = null;
#endregion
}
}