protected virtual void CopyChildren( GoGroup newgroup, GoCopyDictionary env )
Parameters
- newgroup
- env
protected virtual void CopyChildren( GoGroup newgroup, GoCopyDictionary env )
newgroup.Add(env.Copy(obj))
for each child obj
. However, your group subclass may want to keep track of some or all of the children for its own purposes. To that end you can override this method to do the copying manually, thereby correctly maintaining your subclass's internal pointers to children. You probably should not be calling GoObject's GoObject.CopyObject, but GoCopyDictionary's Copy or indexed lookup instead.
base.CopyChildren(newgroup, env);
MyNode newnode = (MyNode)newgroup;
newnode.myIcon = (GoObject)env[myIcon];
newnode.myLabel = (GoText)env[myLabel];
newnode.myInPort = (GoPort)env[myInPort];
newnode.myOutPort = (GoPort)env[myOutPort];
Note that this indexing use of GoCopyDictionary can handle null references--it returns null.