Commit 30bbbc4b authored by Tebjan Halm's avatar Tebjan Halm
Browse files

fixed deepcopy, added nuget package

parent f7c71a5c
......@@ -459,6 +459,7 @@ namespace Svg
{
var evt = attr.Event.GetValue(this);
//if someone has registered publish the attribute
if (evt != null && !string.IsNullOrWhiteSpace(this.ID))
{
writer.WriteAttributeString(attr.Attribute.Name, this.ID + "/" + attr.Attribute.Name);
......@@ -638,8 +639,10 @@ namespace Svg
public virtual SvgElement DeepCopy<T>() where T : SvgElement, new()
{
var newObj = new T();
newObj.ID = this.ID;
newObj.Content = this.Content;
newObj.ElementName = this.ElementName;
// if (this.Parent != null)
// this.Parent.Children.Add(newObj);
......@@ -655,6 +658,28 @@ namespace Svg
newObj.Children.Add(child.DeepCopy());
}
foreach (var attr in this._svgEventAttributes)
{
var evt = attr.Event.GetValue(this);
//if someone has registered also register here
if (evt != null)
{
if(attr.Event.Name == "MouseDown")
newObj.MouseDown += delegate { };
else if (attr.Event.Name == "MouseUp")
newObj.MouseUp += delegate { };
else if (attr.Event.Name == "MouseOver")
newObj.MouseOver += delegate { };
else if (attr.Event.Name == "MouseOut")
newObj.MouseOut += delegate { };
else if (attr.Event.Name == "MouseMove")
newObj.MouseMove += delegate { };
else if (attr.Event.Name == "MouseScroll")
newObj.MouseScroll += delegate { };
}
}
if(this._customAttributes.Count > 0)
{
foreach (var element in _customAttributes)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment