Beispiel #1
0
        private void _DeleteShapes(IEnumerable <Shape> shapes)
        {
            foreach (var shape in shapes)
            {
                DataFlowConnectionLine line = shape as DataFlowConnectionLine;
                if (line != null)
                {
                    VixenSystem.DataFlow.ResetComponentSource(line.DestinationDataComponent);
                    _RemoveShape(line);
                }

                // we COULD use FilterSetupShapeBase, as all the operations below are generic.... but, we only want
                // to be able to delete filter shapes. We want to enforce all elements and outputs to be kept.
                FilterShape filterShape = shape as FilterShape;
                if (filterShape != null)
                {
                    ControlPointId pointId;

                    // go through all outputs for the filter, and check for connections to other shapes.
                    // For any that we find, remove them (ie. set the other shape source to null).
                    for (int i = 0; i < filterShape.OutputCount; i++)
                    {
                        pointId = filterShape.GetControlPointIdForOutput(i);
                        _RemoveDataFlowLinksFromShapePoint(filterShape, pointId);
                    }

                    // now check the source of the filter; if it's connected to anything, remove the connecting shape.
                    // (don't really need to reset the source for the filter, since we're removing it, but may as well
                    // anyway, just in case there's something else that's paying attention...)
                    pointId = filterShape.GetControlPointIdForInput(0);
                    _RemoveDataFlowLinksFromShapePoint(filterShape, pointId);

                    VixenSystem.Filters.RemoveFilter(filterShape.FilterInstance);
                    _RemoveShape(filterShape);
                }
            }

            //looks like we may have delted shapes so assume we made changes
            _changesMade = true;
        }