Beispiel #1
0
        private FilterShape _MakeFilterShape(IOutputFilterModuleInstance filter)
        {
            FilterShape filterShape = (FilterShape)project.ShapeTypes["FilterShape"].CreateInstance();

            filterShape.Title = filter.Descriptor.TypeName;
            filterShape.SecurityDomainName = SECURITY_DOMAIN_MOVABLE_SHAPE_WITH_CONNECTIONS;
            filterShape.FillStyle          = project.Design.FillStyles["Filter"];
            filterShape.SetFilterInstance(filter);

            diagramDisplay.InsertShape(filterShape);
            diagramDisplay.Diagram.Shapes.SetZOrder(filterShape, 10);
            // Z Order of 10; should be above other elements/outputs, but under lines
            diagramDisplay.Diagram.AddShapeToLayers(filterShape, _visibleLayer.Id);

            if (filterShape.DataFlowComponent != null)
            {
                if (!_dataFlowComponentToShapes.ContainsKey(filterShape.DataFlowComponent))
                {
                    _dataFlowComponentToShapes[filterShape.DataFlowComponent] = new List <FilterSetupShapeBase>();
                }
                _dataFlowComponentToShapes[filterShape.DataFlowComponent].Add(filterShape);
            }

            if (_filterToFilterShape.ContainsKey(filter))
            {
                throw new Exception("filter->shape map already has an entry when it shouldn't");
            }
            _filterToFilterShape[filter] = filterShape;

            return(filterShape);
        }