private void TimerCallback(object state) { if (this.timer == null || this.processingTimer) { return; } lock (this) { this.processingTimer = true; try { UMCallState callState = this.stateProvider.GetCallState(this.callId); if (this.previousState == null || this.previousState.Value != callState) { PlayOnPhoneNotificationPayload playOnPhoneNotificationPayload = new PlayOnPhoneNotificationPayload(callState.ToString()); playOnPhoneNotificationPayload.SubscriptionId = this.subscriptionId; playOnPhoneNotificationPayload.Source = new TypeLocation(base.GetType()); this.notifier.NotifyStateChange(playOnPhoneNotificationPayload); this.previousState = new UMCallState?(callState); } if (callState == UMCallState.Disconnected) { this.timer.Dispose(); this.timer = null; this.subscriptionId = null; this.callId = null; this.previousState = null; } } finally { this.processingTimer = false; } } }
internal virtual void NotifyStateChange(PlayOnPhoneNotificationPayload payload) { lock (this) { this.payloadList.Add(payload); base.FireDataAvailableEvent(); } }