public static Ungroup ( |
||
shape | The shape instance. | |
source | IList |
The source shapes collection. |
isShapeFromGroup | bool | The flag indicating whether shape originates from group. |
Результат | void |
public static void Ungroup(BaseShape shape, IList<BaseShape> source, bool isShapeFromGroup = false)
{
if (shape != null && source != null)
{
if (shape is XGroup)
{
var group = shape as XGroup;
Ungroup(group.Shapes, source, isShapeFromGroup: true);
Ungroup(group.Connectors, source, isShapeFromGroup: true);
// Remove group from source collection.
source.Remove(group);
}
else if (isShapeFromGroup)
{
if (shape is XPoint)
{
// Remove connector related state flags.
shape.State.Flags &=
~(ShapeStateFlags.Connector
| ShapeStateFlags.None
| ShapeStateFlags.Input
| ShapeStateFlags.Output);
}
// Add shape standalone flag.
shape.State.Flags |= ShapeStateFlags.Standalone;
// Add shape to source collection.
source.Add(shape);
}
}
}
XGroup::Ungroup ( IEnumerable |