Пример #1
0
        //--------------------------------------------------------Set-, Get- Methods:---------------------------------------------------------\\
        #region --Set-, Get- Methods--
        private async Task SetStateAsync(PushManagerState state)
        {
            await STATE_SEMA.WaitAsync();

            if (state != this.state)
            {
                PushManagerState oldState = this.state;
                this.state = state;
                STATE_SEMA.Release();
                StateChanged?.Invoke(this, new PushManagerStateChangedEventArgs(state, oldState));
            }
            else
            {
                STATE_SEMA.Release();
            }
        }
Пример #2
0
 /// <summary>
 /// Should be called once the PushManager changes its state to DEACTIVATED.
 /// </summary>
 public void OnPushManagerDeactivated()
 {
     pushManagerState = PushManagerState.DEACTIVATED;
     TryUpdateClientPush();
 }
Пример #3
0
 //--------------------------------------------------------Constructor:----------------------------------------------------------------\\
 #region --Constructors--
 public PushManagerStateChangedEventArgs(PushManagerState newState, PushManagerState oldState)
 {
     NEW_STATE = newState;
     OLD_STATE = oldState;
 }
Пример #4
0
        //--------------------------------------------------------Set-, Get- Methods:---------------------------------------------------------\\
        #region --Set-, Get- Methods--


        #endregion
        //--------------------------------------------------------Misc Methods:---------------------------------------------------------------\\
        #region --Misc Methods (Public)--
        /// <summary>
        /// Should be called once the PushManager changes its state to INITIALIZED.
        /// </summary>
        public void OnPushManagerInitialized()
        {
            pushManagerState = PushManagerState.INITIALIZED;
            TryUpdateClientPush();
        }