Пример #1
0
 void CallbackOnInboxStateChange(InboxState newState)
 {
     if (OnInboxStateChange != null)
     {
         OnInboxStateChange(newState);
     }
 }
Пример #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);
        }
Пример #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);
     }
 }
Пример #4
0
        private void FromClosed(InboxState state)
        {
            switch (state)
            {
            case InboxState.Starting:
                break;

            default:
                throw new InboxIllegalStateTransactionException(_state, state);
            }
        }
Пример #5
0
        private void FromStopping(InboxState state)
        {
            switch (state)
            {
            case InboxState.Closed:
            case InboxState.Faulted:
                break;

            default:
                throw new InboxIllegalStateTransactionException(_state, state);
            }
        }
Пример #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);
            }
        }
Пример #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);
        }
Пример #8
0
 private void FromFaulted(InboxState state)
 {
     throw new InboxIllegalStateTransactionException(_state, state);
 }
Пример #9
0
 /// <summary>
 /// Constructor with keyword
 /// </summary>
 /// <param name="invalidState">The invalid state</param>
 public InboxInvalidStateException(InboxState invalidState) : base(GetKeywords(invalidState))
 {
 }
Пример #10
0
 void CallbackOnInboxStateChange(InboxState newState)
 {
     pContext.Binding.Elements.Find <EmailBindingElement>().InboxStateChange(newState);
 }
Пример #11
0
 /// <summary>
 /// Constructor with keyword
 /// </summary>
 /// <param name="state">The unhandled state</param>
 public InboxUnhandledStateException(InboxState state) : base(GetKeywords(state))
 {
 }
Пример #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))
 {
 }