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();
}
//...





Similar Topics


Reading This Topic