public void RegisterSessionHandler(Type handlerType, SessionHandlerOptions options)
        {
            IMessageSessionAsyncHandlerFactory messageSessionAsyncHandlerFactory = MessageSessionHandlerFactory.Create(handlerType);

            MessageSessionPumpHost.RegisterSessionHandlerFactoryAsyncResult registerSessionHandlerFactoryAsyncResult = new MessageSessionPumpHost.RegisterSessionHandlerFactoryAsyncResult(this, messageSessionAsyncHandlerFactory, options, null, null);
            registerSessionHandlerFactoryAsyncResult.RunSynchronously();
        }
 public RegisterSessionHandlerFactoryAsyncResult(MessageSessionPumpHost owner, IMessageSessionAsyncHandlerFactory factory, SessionHandlerOptions options, AsyncCallback callback, object state) : base(TimeSpan.MaxValue, callback, state)
 {
     this.owner   = owner;
     this.factory = factory;
     this.options = options;
     MessageSessionPumpHost.RegisterSessionHandlerFactoryAsyncResult registerSessionHandlerFactoryAsyncResult = this;
     registerSessionHandlerFactoryAsyncResult.OnCompleting = (Action <AsyncResult, Exception>)Delegate.Combine(registerSessionHandlerFactoryAsyncResult.OnCompleting, MessageSessionPumpHost.RegisterSessionHandlerFactoryAsyncResult.OnFinally);
 }
        private IAsyncResult BeginRegisterSessionHandler(Type handlerType, SessionHandlerOptions options, AsyncCallback callback, object state)
        {
            IMessageSessionAsyncHandlerFactory messageSessionAsyncHandlerFactory = MessageSessionHandlerFactory.Create(handlerType);

            return((new MessageSessionPumpHost.RegisterSessionHandlerFactoryAsyncResult(this, messageSessionAsyncHandlerFactory, options, callback, state)).Start());
        }
 private IAsyncResult BeginRegisterSessionHandler(IMessageSessionAsyncHandlerFactory factory, SessionHandlerOptions options, AsyncCallback callback, object state)
 {
     return((new MessageSessionPumpHost.RegisterSessionHandlerFactoryAsyncResult(this, factory, options, callback, state)).Start());
 }
 public Task RegisterSessionHandlerFactoryAsync(IMessageSessionAsyncHandlerFactory factory, SessionHandlerOptions options)
 {
     return(TaskHelpers.CreateTask((AsyncCallback c, object s) => this.BeginRegisterSessionHandler(factory, options, c, s), (IAsyncResult r) => this.EndRegisterSessionHandler(r)));
 }
 public void RegisterSessionHandlerFactory(IMessageSessionAsyncHandlerFactory factory, SessionHandlerOptions options)
 {
     MessageSessionPumpHost.RegisterSessionHandlerFactoryAsyncResult registerSessionHandlerFactoryAsyncResult = new MessageSessionPumpHost.RegisterSessionHandlerFactoryAsyncResult(this, factory, options, null, null);
     registerSessionHandlerFactoryAsyncResult.RunSynchronously();
 }
 public Task RegisterSessionHandlerAsync(Type handlerType, SessionHandlerOptions options)
 {
     return(TaskHelpers.CreateTask((AsyncCallback c, object s) => this.BeginRegisterSessionHandler(handlerType, options, c, s), (IAsyncResult r) => this.EndRegisterSessionHandler(r)));
 }