Ejemplo n.º 1
0
        public List <int> AddConnectionPoint(
            string x,
            string y,
            Models.ConnectionPointType type)
        {
            var targets = new TargetShapes();

            return(this.AddConnectionPoint(targets, x, y, type));
        }
Ejemplo n.º 2
0
        public List <int> AddConnectionPoint(
            TargetShapes targets,
            string fx,
            string fy,
            Models.ConnectionPointType type)
        {
            targets = targets.Resolve(this._client);

            if (targets.Shapes.Count < 1)
            {
                return(new List <int>(0));
            }

            int dirx = 0;
            int diry = 0;

            var indices = new List <int>(targets.Shapes.Count);

            using (var undoscope = this._client.Undo.NewUndoScope(nameof(AddConnectionPoint)))
            {
                var cxnpointcells = new VA.Shapes.ConnectionPointCells();
                cxnpointcells.X    = fx;
                cxnpointcells.Y    = fy;
                cxnpointcells.DirX = dirx;
                cxnpointcells.DirY = diry;
                cxnpointcells.Type = (int)type;

                foreach (var shape in targets.Shapes)
                {
                    int index = VA.Shapes.ConnectionPointHelper.Add(shape, cxnpointcells);
                    indices.Add(index);
                }
            }

            return(indices);
        }