/// <summary>
        /// Creates a one to many connector from the member1 of shape1 to
        /// member2 of shape2.
        /// </summary>
        /// <param name="shape1"></param>
        /// <param name="member1"></param>
        /// <param name="shape2"></param>
        /// <param name="member2"></param>
        private void Connect(NShape shape1, string member1, NShape shape2, string member2)
        {
            NRoutableConnector connector = new NRoutableConnector();

            connector.UserClass = ConnectorOneToManyClassName;
            m_DrawingDocument.Content.ActivePage.Items.Add(connector);

            // Get or create the ports
            NPort port1 = GetOrCreatePort(shape1, member1);
            NPort port2 = GetOrCreatePort(shape2, member2);

            if (port1 == null)
            {
                throw new ArgumentException("A member with name '" + member1 + "' not found in shape '" + shape1.Name + "'", "member");
            }

            if (port1 == null)
            {
                throw new ArgumentException("A member with name '" + member2 + "' not found in shape '" + shape2.Name + "'", "member");
            }

            // Connect the ports
            connector.GlueBeginToPort(port1);
            connector.GlueEndToPort(port2);
        }
        private void Connect(NPort beginPort, NPort endPort)
        {
            NRoutableConnector connector = new NRoutableConnector();

            connector.RerouteMode = ENRoutableConnectorRerouteMode.Always;
            m_DrawingDocument.Content.ActivePage.Items.AddChild(connector);

            connector.GlueBeginToPort(beginPort);
            connector.GlueEndToPort(endPort);
        }