Core2D.Shapes.XGroup.Ungroup C# (CSharp) Метод

Ungroup() публичный статический Метод

Ungroup shape.
public static Ungroup ( BaseShape shape, IList source, bool isShapeFromGroup = false ) : void
shape Core2D.Shape.BaseShape 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);
                }
            }
        }

Same methods

XGroup::Ungroup ( IEnumerable shapes, IList source, bool isShapeFromGroup = false ) : void