Exemplo n.º 1
0
 void CallbackOnInboxStateChange(InboxState newState)
 {
     if (OnInboxStateChange != null)
     {
         OnInboxStateChange(newState);
     }
 }
Exemplo n.º 2
0
        private static Dictionary <string, string> GetKeywords(InboxState state)
        {
            Dictionary <string, string> d = new Dictionary <string, string>();

            d.Add("State", state.ToString());
            return(d);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Raises the event
 /// </summary>
 /// <param name="caller">The caller of the event</param>
 /// <param name="e">The exception that caused the event</param>
 internal void InboxStateChange(InboxState newState)
 {
     if (OnInboxStateChange != null)
     {
         OnInboxStateChange(newState);
     }
 }
Exemplo n.º 4
0
        private void FromClosed(InboxState state)
        {
            switch (state)
            {
            case InboxState.Starting:
                break;

            default:
                throw new InboxIllegalStateTransactionException(_state, state);
            }
        }
Exemplo n.º 5
0
        private void FromStopping(InboxState state)
        {
            switch (state)
            {
            case InboxState.Closed:
            case InboxState.Faulted:
                break;

            default:
                throw new InboxIllegalStateTransactionException(_state, state);
            }
        }
Exemplo n.º 6
0
        private void FromListening(InboxState state)
        {
            switch (state)
            {
            case InboxState.AttemptingLogOn:
            case InboxState.Closing:
            case InboxState.Faulted:
                break;

            default:
                throw new InboxIllegalStateTransactionException(_state, state);
            }
        }
Exemplo n.º 7
0
        private void SetState(InboxState state)
        {
            switch (_state)
            {
            case InboxState.Initialized:
                FromInitialized(state);
                break;

            case InboxState.Starting:
                FromStarting(state);
                break;

            case InboxState.AttemptingLogOn:
                FromAttemptingLogon(state);
                break;

            case InboxState.Listening:
                FromListening(state);
                break;

            case InboxState.Closing:
                FromStopping(state);
                break;

            case InboxState.Closed:
                FromClosed(state);
                break;

            case InboxState.Faulted:
                FromFaulted(state);
                break;

            default:
                throw new InboxUnhandledStateException(_state);
            }
            _state = state;
            if (OnInboxStateChange != null)
            {
                OnInboxStateChange(_state);
            }
            logging.WCFLogger.Write(TraceEventType.Information, "Inbox changed state to " + state);
        }
Exemplo n.º 8
0
 private void FromFaulted(InboxState state)
 {
     throw new InboxIllegalStateTransactionException(_state, state);
 }
Exemplo n.º 9
0
 /// <summary>
 /// Constructor with keyword
 /// </summary>
 /// <param name="invalidState">The invalid state</param>
 public InboxInvalidStateException(InboxState invalidState) : base(GetKeywords(invalidState))
 {
 }
Exemplo n.º 10
0
 void CallbackOnInboxStateChange(InboxState newState)
 {
     pContext.Binding.Elements.Find <EmailBindingElement>().InboxStateChange(newState);
 }
Exemplo n.º 11
0
 /// <summary>
 /// Constructor with keyword
 /// </summary>
 /// <param name="state">The unhandled state</param>
 public InboxUnhandledStateException(InboxState state) : base(GetKeywords(state))
 {
 }
Exemplo n.º 12
0
 /// <summary>
 /// Constructor with keyword
 /// </summary>
 /// <param name="fromState">The state the inbox was in</param>
 /// <param name="toState">The state the inbox was going to</param>
 public InboxIllegalStateTransactionException(InboxState fromState, InboxState toState) : base(GetKeywords(fromState, toState))
 {
 }