protected override UntypedChannel Visitor(ChannelAdapter channel) { UntypedChannel original = channel.Output; UntypedChannel replacement = Visit(original); if (!_added) { if (replacement.GetType() == typeof(ShuntChannel)) { replacement = new BroadcastChannel(new[] { _newChannel }); _added = true; } } if (original != replacement) { channel.ChangeOutputChannel(original, replacement); } return(channel); }
protected override UntypedChannel Visitor(ChannelAdapter channel) { bool wasAdded = _added; channel.ChangeOutputChannel(original => { _added = wasAdded; UntypedChannel replacement = Visit(original); if (!_added) { if (replacement.GetType() == typeof(ShuntChannel)) { replacement = new BroadcastChannel(new[] { _newChannel }); _added = true; } } return(replacement); }); return(channel); }
protected virtual UntypedChannel Visitor(UntypedChannel channel) { _log.Warn(x => x.Write("Unknown untyped channel implementation found: {0}", channel.GetType().FullName)); return(channel); }
protected override UntypedChannel Visitor(UntypedChannel channel) { Trace.WriteLine("UntypedChannel: {0}".FormatWith(channel.GetType().Name)); return(base.Visitor(channel)); }