Profile Picture

Draging diagram nodes without implementing ICLoneable

Posted By yoav Roytenberg 14 Years Ago
Author
Message
Nevron Support
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009
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



Nevron Support
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009

Hi,

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



Best Regards,
Nevron Support Team



yoav Roytenberg
Posted 14 Years Ago
View Quick Profile
Junior Member

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
Last Active: 14 Years Ago
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.



Similar Topics


Reading This Topic