Exemple #1
0
        public void Connect(ArchiveEncoderOutputSlot source, ArchiveEncoderInputSlot target)
        {
            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }

            if (target == null)
            {
                throw new ArgumentNullException(nameof(target));
            }

            if (source.Definition != this)
            {
                throw new ArgumentException("Data source belongs to a different encoder definition.", nameof(source));
            }

            if (target.Definition != this)
            {
                throw new ArgumentException("Data target belongs to a different encoder definition.", nameof(target));
            }

            if (source.IsConnected)
            {
                throw new ArgumentException("Data source is already connected.", nameof(source));
            }

            if (target.IsConnected)
            {
                throw new ArgumentException("Data target is already connected.", nameof(target));
            }

            CheckComplete();

            source.ConnectTo(target);
            target.ConnectTo(source);
        }
        public void Connect(ArchiveEncoderOutputSlot source, ArchiveEncoderInputSlot target)
        {
            if (source == null)
                throw new ArgumentNullException(nameof(source));

            if (target == null)
                throw new ArgumentNullException(nameof(target));

            if (source.Definition != this)
                throw new ArgumentException("Data source belongs to a different encoder definition.", nameof(source));

            if (target.Definition != this)
                throw new ArgumentException("Data target belongs to a different encoder definition.", nameof(target));

            if (source.IsConnected)
                throw new ArgumentException("Data source is already connected.", nameof(source));

            if (target.IsConnected)
                throw new ArgumentException("Data target is already connected.", nameof(target));

            CheckComplete();

            source.ConnectTo(target);
            target.ConnectTo(source);
        }