Ejemplo n.º 1
0
        public bool ConnectToExtConn(ExternalConnection extConn, IConnector connector)
        {
            if (extConn == null || connector == null)
            {
                return(false);
            }
            if (this.GetExternalConnection(extConn.UUID) != null)
            {
                return(false);
            }

            IConnector targetConn = null;

            if (extConn.SourcePath.Equals(connector.Path))
            {
                targetConn = this.GetExternalConnector(extConn.TargetPath);
            }
            else
            {
                targetConn = this.GetExternalConnector(extConn.SourcePath);
            }

            if (targetConn == null)
            {
                return(false);
            }

            if (targetConn.CanConnectToExtConnector(connector))
            {
                this.ExtConnList.AddChild(extConn);
                targetConn.ConnectToExtConnector(extConn);
                return(true);
            }

            return(false);
        }