private void OnLocalContactChanged(object sender, VATRP.Core.Events.ContactEventArgs e)
 {
     if (ServiceManager.Instance.Dispatcher.Thread != System.Threading.Thread.CurrentThread)
     {
         ServiceManager.Instance.Dispatcher.BeginInvoke((Action)(() => this.OnLocalContactChanged(sender, e)));
         return;
     }
     Contact = this._contactService.FindContact(e.Contact);
 }
 private void ChatManagerOnConversationUpdated(object sender, VATRP.Core.Events.ConversationUpdatedEventArgs e)
 {
     ScrollToEnd();
 }
 internal void Resize(VATRP.LinphoneWrapper.Enums.MSVideoSize width,
     VATRP.LinphoneWrapper.Enums.MSVideoSize height)
 {
     this.Width = Convert.ToInt32(width);
     this.Height = Convert.ToInt32(height);
 }
        private void OnUnreadStateChanged(object sender, VATRP.Core.Events.ConversationEventArgs e)
        {
            if (ServiceManager.Instance.Dispatcher.Thread != Thread.CurrentThread)
            {
                ServiceManager.Instance.Dispatcher.BeginInvoke(DispatcherPriority.Normal,
                    new EventHandler<VATRP.Core.Events.ConversationEventArgs>(OnUnreadStateChanged), sender, new object[] { e });
                return;
            }

            ChangeUnreadCounter();
        }
        private void OnCallQualityChanged(VATRP.Linphone.VideoWrapper.QualityIndicator callQuality)
        {
            if (_mainViewModel.ActiveCallModel == null ||
                callQuality == VATRP.Linphone.VideoWrapper.QualityIndicator.Unknown)
            {
                ctrlCall.ctrlOverlay.ShowQualityIndicatorWindow(false);
                ctrlCall.ctrlOverlay.ShowEncryptionIndicatorWindow(false);
                return;
            }

            ctrlCall.ctrlOverlay.UpdateQualityIndicator(callQuality);
            ctrlCall.ctrlOverlay.ShowQualityIndicatorWindow(this.WindowState != WindowState.Minimized);

            if (_mainViewModel.ActiveCallModel.CallInfoModel != null)
            {
                var encryption = _mainViewModel.ActiveCallModel.CallInfoModel.MediaEncryption.Equals("None") ? MediaEncryptionIndicator.Off
                    : MediaEncryptionIndicator.On;
                ctrlCall.ctrlOverlay.UpdateEncryptionIndicator(encryption);
                ctrlCall.ctrlOverlay.ShowEncryptionIndicatorWindow(this.WindowState != WindowState.Minimized);
            }
        }
        private void CallHistoryEventChanged(object sender, VATRP.Core.Events.VATRPCallEventArgs e)
        {
            if (ServiceManager.Instance.Dispatcher.Thread != System.Threading.Thread.CurrentThread)
            {
                ServiceManager.Instance.Dispatcher.BeginInvoke((Action)(() => this.CallHistoryEventChanged(sender, e)));
                return;
            }

            var callEvent = sender as VATRPCallEvent;

            switch (e.historyEventType)
            {
                case HistoryEventTypes.Add:
                    AddNewCallEvent(callEvent, true);
                    break;
                case HistoryEventTypes.Load:
                    LoadCallEvents();
                    break;
                case HistoryEventTypes.Reset:
                    Calls.Clear();
                    _unseenMissedCallsCount = 0;
                    CallsListView.Refresh();
                    break;
                case HistoryEventTypes.Delete:
                    RemoveCallEvent(callEvent);
                    break;
            }
        }