AddConnectorAsInput() public méthode

Adds XPoint to Connectors collection with ShapeStateFlags.Input flag set.
public AddConnectorAsInput ( XPoint point ) : void
point XPoint The point object.
Résultat void
Exemple #1
0
        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));
        }
Exemple #2
0
        public void AddConnectorAsInput_Add_Point_To_Connectors_As_Input()
        {
            var target = new XGroup();
            var point = new XPoint();

            target.AddConnectorAsInput(point);

            Assert.Equal(point.Owner, target);
            Assert.True(point.State.Flags.HasFlag(ShapeStateFlags.Connector | ShapeStateFlags.Input));
            Assert.False(point.State.Flags.HasFlag(ShapeStateFlags.Standalone));
            Assert.Contains(point, target.Connectors);
            Assert.Equal(1, target.Connectors.Length);
        }