Profile Picture

pass trough all shapes in all layers

Posted By Richard Dubé 7 Years Ago
Author
Message
Richard Dubé
Question Posted 7 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 6, Visits: 85
Hi, 

i made a group of nodes wich i group and name it 1

i did find the way to put some protection but my problem is to put the same protection to others layers in this group.

the following code is perfect for the group but if i select let say a group of lines in this group, the name of this group of lines became oubviously the selected group so the name change and the protection did not apply. 

private void nDrawingView1_NodeSelected(NNodeEventArgs args)
{
    NNodeList nodes = nDrawingView1.Selection.Nodes;
    for (int i = 0; i < nodes.Count; i++)
    {
      NShape shape = nodes[i] as NShape;
      string shapesel = shape.Name.ToString();
      //MessageBox.Show(shapesel);
      if (shapesel == "1")
      {
       NAbilities protection = shape.Protection;
       protection.InplaceEdit = true;
       protection.ResizeX = true;
       protection.ResizeY = true;
       protection.ContextMenuEdit = true;
       protection.Group = true;
       protection.Ungroup = true;
       protection.RemoveElements = true;     
       shape.Protection = protection;
      }
    }
}


is there a way to scan trough all layers and apply same protections on all of the shapes and groups ?

thank you

Nevron Support
This post has been flagged as an answer
Posted 7 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 3,039, Visits: 3,746
Hi,

You can get all descendant shapes using the following piece of code:

NNodeList subShapes = shape.Descendants(NFilters.TypeNShape, -1);



Best Regards,
Nevron Support Team



Richard Dubé
Posted 6 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 6, Visits: 85
thank you !

Works perfectly Smile



Similar Topics


Reading This Topic