private BlockPort AddMultiConduitPort(LineBlock lineBlock, BlockSideEnum side, int nTerminals, string outerConduitColor, double spaceBetweenTerminals = -1, double terminalSize = -1, double portMargin = -1)
        {
            BlockPort port = new BlockPort(side, "MultiConduit" + outerConduitColor, null, spaceBetweenTerminals, terminalSize, portMargin);

            for (int i = 0; i < nTerminals; i++)
            {
                port.AddTerminal(new BlockPortTerminal(true, "InnerConduit" + MockupHelper.GetColorStringFromConduitNumber(i + 1)));
            }

            lineBlock.AddPort(port);

            return(port);
        }
        public double AddMultiConduitPassThroughBlock(DiagramBuilder builder, double minWith, double offsetY, int nTerminals)
        {
            //////////////////////////////////////////////////////////
            /// label block
            ///
            LineBlock conduitBlock = new LineBlock(30, offsetY, LineBlockTypeEnum.Simple);

            conduitBlock.MinWidth = minWith;

            // Add vest ports
            AddMultiConduitPort(conduitBlock, BlockSideEnum.Vest, nTerminals, "Orange", -1, -1, 10);

            // Add east ports
            AddMultiConduitPort(conduitBlock, BlockSideEnum.East, nTerminals, "Orange", -1, -1, 10);

            // Connect ports
            conduitBlock.AddPortConnection(BlockSideEnum.Vest, 1, BlockSideEnum.East, 1, null, "MultiConduitOrange");

            // Connect west and east terminals
            for (int i = 0; i < nTerminals; i++)
            {
                conduitBlock.AddTerminalConnection(BlockSideEnum.Vest, 1, i + 1, BlockSideEnum.East, 1, i + 1, null, "InnerConduit" + MockupHelper.GetColorStringFromConduitNumber(i + 1), LineShapeTypeEnum.Polygon);
            }

            conduitBlock.Measure(new Layout.Size());
            builder.ContentObjects.Add(conduitBlock);

            //////////////////////////////////////////////////////////
            /// label block

            LineBlock labelBlock = new LineBlock(0, offsetY, LineBlockTypeEnum.Simple);

            labelBlock.MinWidth = 30;

            // Add vest port
            AddBigConduitPort(labelBlock, BlockSideEnum.Vest, nTerminals, null, -1, -1, 10);

            // Add east port
            AddBigConduitPort(labelBlock, BlockSideEnum.East, nTerminals, null, -1, -1, 10);

            labelBlock.AddTerminalConnection(BlockSideEnum.Vest, 1, 1, BlockSideEnum.East, 1, 1, "PF-4200", "LabelMediumText");

            labelBlock.Measure(new Layout.Size());
            builder.ContentObjects.Add(labelBlock);

            return(conduitBlock.DesiredSize.Height);
        }