Пример #1
0
        public bool Link(IOutStream pOutStream, bool reverseLink = true)
        {
            if (!pOutStream.IsCompatibleWithType(Type) || !IsCompatibleWithType(pOutStream.Type))
            {
                Logger.FATAL("stream type {0} not compatible with stream type {1}", Type.TagToString(), pOutStream.Type.TagToString());
                return(false);
            }
            if (OutStreams.Contains(pOutStream))
            {
                Logger.WARN("BaseInStream::Link: This stream is already linked");
                return(true);
            }
            OutStreams.Add(pOutStream);
            if (reverseLink)
            {
                if (!pOutStream.Link(this, false))
                {
                    Logger.FATAL("BaseInStream::Link: Unable to reverse link");
                    //NYIA;
                    return(false);
                }
            }
            SignalOutStreamAttached(pOutStream);

            return(true);
        }