public AddShape ( |
||
shape | The shape object. | |
return | void |
public void Ungroup_Shape_Remove_And_Add_To_Source() { var shape = new Class1(); var point1 = new XPoint(); var point2 = new XPoint(); var point3 = new XPoint(); var target = new XGroup(); target.AddShape(shape); target.AddConnectorAsNone(point1); target.AddConnectorAsInput(point2); target.AddConnectorAsOutput(point3); var source = new List<BaseShape> { target }; XGroup.Ungroup(target, source); Assert.Contains(shape, source); Assert.Contains(point1, source); Assert.Contains(point2, source); Assert.Contains(point3, source); Assert.Equal(4, source.Count); Assert.False(point1.State.Flags.HasFlag(ShapeStateFlags.Connector | ShapeStateFlags.None)); Assert.False(point2.State.Flags.HasFlag(ShapeStateFlags.Connector | ShapeStateFlags.Input)); Assert.False(point3.State.Flags.HasFlag(ShapeStateFlags.Connector | ShapeStateFlags.Output)); Assert.True(shape.State.Flags.HasFlag(ShapeStateFlags.Standalone)); Assert.True(point1.State.Flags.HasFlag(ShapeStateFlags.Standalone)); Assert.True(point2.State.Flags.HasFlag(ShapeStateFlags.Standalone)); Assert.True(point3.State.Flags.HasFlag(ShapeStateFlags.Standalone)); }
public void AddShape_Add_Shape_To_Shapes() { var target = new XGroup(); var shape = new Class1(); target.AddShape(shape); Assert.Equal(shape.Owner, target); Assert.False(shape.State.Flags.HasFlag(ShapeStateFlags.Standalone)); Assert.Contains(shape, target.Shapes); Assert.Equal(1, target.Shapes.Length); }