Draging diagram nodes without implementing ICLoneable


Author
Message
yoav Roytenberg
yoav Roytenberg
Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)
Group: Forum Members
Posts: 13, Visits: 1
I have a diagram which binds to my custom data, by setting the "Tag" attribute of each of the shapes in the diagram.
When I try to move one of the shapes in the diagram, by dragging, I get a message "In order to deeply copiable non primitive types must implement ICLoneable"
Is there a way to prevent this message from showing? I don't want to change my data source to inherit ICloneable etc.
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

Hi,

ICloneable must be implemented for the type you assign to the Tag property of the shapes.



Best Regards,
Nevron Support Team


Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi,

After rereading your post I think that we need to clarify a little. If you are assigning a data source as a Tag value, this does not mean that you need to clone the data source, but rather create a surrogate object that is ICloneable and performs shallow cloning of its members. For example:

[Serializable]
public class MyTag : ICloneable
{
public MyTag()
{
}
public object Clone()
{
MyTag clone = MyTag();
clone.DataSource = DataSource;
return clone;
}
public object DataSource;
}

Best Regards,
Nevron Support Team


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search