protected override IPipe <TMessage> CreatePipe <TMessage>(ChannelProviderBase parent, string name)
 {
     Contracts.AssertValue(parent);
     Contracts.Assert(parent is Host);
     Contracts.AssertNonEmpty(name);
     return(new Pipe <TMessage>(parent, name, GetDispatchDelegate <TMessage>()));
 }
 protected override IChannel CreateCommChannel(ChannelProviderBase parent, string name)
 {
     Contracts.AssertValue(parent);
     Contracts.Assert(parent is Host);
     Contracts.AssertNonEmpty(name);
     return(new Channel(Root, parent, name, GetDispatchDelegate <ChannelMessage>()));
 }
 public Channel(ConsoleEnvironment root, ChannelProviderBase parent, string shortName,
                Action <IMessageSource, ChannelMessage> dispatch)
     : base(root, parent, shortName, dispatch)
 {
     Watch = Stopwatch.StartNew();
     Root._consoleWriter.ChannelStarted(this);
 }
示例#4
0
 public Channel(LocalEnvironment root, ChannelProviderBase parent, string shortName,
                Action <IMessageSource, ChannelMessage> dispatch)
     : base(root, parent, shortName, dispatch)
 {
     Watch = Stopwatch.StartNew();
     Dispatch(this, new ChannelMessage(ChannelMessageKind.Trace, MessageSensitivity.None, "Channel started"));
 }
 protected PipeBase(ChannelProviderBase parent, string shortName,
                    Action <IMessageSource, TMessage> dispatch)
     : base(shortName, parent.FullName, parent.Verbose)
 {
     Contracts.AssertValue(parent);
     Contracts.AssertValue(dispatch);
     Parent   = parent;
     Depth    = parent.Depth + 1;
     Dispatch = dispatch;
 }
            private void WriteName(TextWriter wr, ChannelProviderBase provider)
            {
                var channel = provider as Channel;

                if (channel != null)
                {
                    WriteName(wr, channel.Parent);
                }
                wr.Write("{0}: ", provider.ShortName);
            }
 protected abstract IPipe <TMessage> CreatePipe <TMessage>(ChannelProviderBase parent, string name);
 protected abstract IChannel CreateCommChannel(ChannelProviderBase parent, string name);
 public Pipe(ChannelProviderBase parent, string shortName,
             Action <IMessageSource, TMessage> dispatch) :
     base(parent, shortName, dispatch)
 {
 }
 protected ChannelBase(TEnv root, ChannelProviderBase parent, string shortName,
                       Action <IMessageSource, ChannelMessage> dispatch)
     : base(parent, shortName, dispatch)
 {
     Root = root;
 }