/// <summary> /// Initialization /// </summary> protected override void OnOpen(TimeSpan timeout) { // Get a mail handler object from the binding pMailHandler = RaspEmailBindingElement.GetRaspMailHandlerFromBindingContext(pContext); pMailHandler.OnExceptionThrown += new MailboxExceptionThrown(CallbackMailExceptionThrown); pMailHandler.OnInboxStateChange += new OnInboxStateChangeDelegate(CallbackOnInboxStateChange); }
/// <summary> /// OnCreateChannel event /// </summary> /// <param name="address"></param> /// <param name="via"></param> /// <returns></returns> protected override IRequestChannel OnCreateChannel(System.ServiceModel.EndpointAddress address, Uri via) { // Get a mail handler object from the binding RaspMailHandler mailHandler = RaspEmailBindingElement.GetRaspMailHandlerFromBindingContext(pBindingContext); mailHandler.OnExceptionThrown += new MailboxExceptionThrown(mailHandler_OnExceptionThrown); // Create the channel return(new RaspEmailRequestChannel(mailHandler, address, this)); }