Profile Picture

How to replace newly added master to a class MasterEx:NMaster

Posted By NorthGates 11 Years Ago

How to replace newly added master to a class MasterEx:NMaster

Author
Message
NorthGates
questionmark Posted 11 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: Forum Members
Last Active: 11 Years Ago
Posts: 6, Visits: 1
I would like to allow users to add shapes to a specific library but once added that the newly added master be replaced with my MasterEx class retaining all information from the master.

Everything works fine (including persisting) but I cannot figure out how I can transfer the master to MasterEx class.

Also, I am not sure how to update the history once I remove/add the master and don't know how to properly skip events.

Here is what I have so far:


void Library_NodeInserted(Dom.NChildNodeEventArgs args)
{
if (_skipEvents)
return;

NLibraryDocument doc = args.Node as NLibraryDocument;
switch (doc.Tag.ToString())
{
case "ACTORS":
NMaster master = args.Child as NMaster;

//This is what I have problems with
custom.Shapes.MasterEx masterEx = (custom.Shapes.MasterEx)master.Clone();

if (masterEx != null)
{
int idx = doc.IndexOfChild(args.Child);
_skipEvents = true;
doc.RemoveChildAt(idx);
doc.InsertChild(idx, masterEx);
_skipEvents = false;
//doc.UpdateAllViews();
}
//...


NorthGates
Posted 11 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: Forum Members
Last Active: 11 Years Ago
Posts: 6, Visits: 1

Ok, after reading the post http://forum.nevron.com/shwmessage.aspx?forumid=3&messageid=6982#bm6996, the transfer from a master to a drawing document is handled by the NLibraryDataObject which no master information is copied over, just the shape.

I will use the alternative discussed in the thread above which will do perfectly.





Similar Topics


Reading This Topic