Пример #1
0
        /// <summary>
        /// Handle OnStateChanged events. Set the buttons in mainform to appropriate state
        /// when the session is connected or disconnected
        /// </summary>
        /// <param name="eventSource"></param>
        /// <param name="eventData"></param>
        void _IUccSessionParticipantEvents.OnStateChanged(
            IUccSessionParticipant eventSource,
            UccSessionParticipantStateChangedEvent eventData)
        {
            if (eventData.NewState == UCC_SESSION_ENTITY_STATE.UCCSES_CONNECTED)
            {
                switch (eventSource.Session.Type)
                {
                case UCC_SESSION_TYPE.UCCST_INSTANT_MESSAGING:
                    this.mainForm.SetIMOff();
                    this.mainForm.WriteStatusMessage("IM session is connected to " + eventSource.Uri);
                    break;

                case UCC_SESSION_TYPE.UCCST_AUDIO_VIDEO:
                    this.mainForm.SetVoIPOff();
                    this.mainForm.WriteStatusMessage("AV session is connected to " + eventSource.Uri);
                    break;

                default:
                    break;
                }
            }

            if (eventData.NewState == UCC_SESSION_ENTITY_STATE.UCCSES_DISCONNECTED)
            {
                switch (eventSource.Session.Type)
                {
                case UCC_SESSION_TYPE.UCCST_INSTANT_MESSAGING:
                    this.imSession = null;
                    this.mainForm.SetIMOn();
                    this.mainForm.WriteStatusMessage("IM session is disconnected.");
                    break;

                case UCC_SESSION_TYPE.UCCST_AUDIO_VIDEO:
                    this.avSession = null;
                    this.mainForm.SetVoipOn();
                    this.mainForm.WriteStatusMessage("AV Session is disconnected");
                    break;

                default:
                    return;
                }
            }
        }
Пример #2
0
 void _IUccSessionParticipantEvents.OnStateChanged(IUccSessionParticipant eventSource, UccSessionParticipantStateChangedEvent eventData)
 {
     this.GetPartipantLog(eventSource).SetState(eventData.NewState);
 }
        /// <summary>
        /// Handle OnStateChanged events. Set the buttons in mainform to appropriate state
        /// when the session is connected or disconnected
        /// </summary>
        /// <param name="eventSource"></param>
        /// <param name="eventData"></param>
        void _IUccSessionParticipantEvents.OnStateChanged(
                        IUccSessionParticipant eventSource,
                        UccSessionParticipantStateChangedEvent eventData)
        {
            if (eventData.NewState == UCC_SESSION_ENTITY_STATE.UCCSES_CONNECTED)
            {
                switch (eventSource.Session.Type)
                {
                    case UCC_SESSION_TYPE.UCCST_INSTANT_MESSAGING:
                        this.mainForm.SetIMOff();
                        this.mainForm.WriteStatusMessage("IM session is connected to " + eventSource.Uri);
                        break;

                    case UCC_SESSION_TYPE.UCCST_AUDIO_VIDEO:
                        this.mainForm.SetVoIPOff();
                        this.mainForm.WriteStatusMessage("AV session is connected to " + eventSource.Uri);
                        break;

                    default:
                        break;

                }
            }

            if (eventData.NewState == UCC_SESSION_ENTITY_STATE.UCCSES_DISCONNECTED)
            {
                switch (eventSource.Session.Type)
                {
                    case UCC_SESSION_TYPE.UCCST_INSTANT_MESSAGING:
                        this.imSession = null;
                        this.mainForm.SetIMOn();
                        this.mainForm.WriteStatusMessage("IM session is disconnected.");
                        break;

                    case UCC_SESSION_TYPE.UCCST_AUDIO_VIDEO:
                        this.avSession = null;
                        this.mainForm.SetVoipOn();
                        this.mainForm.WriteStatusMessage("AV Session is disconnected");
                        break;

                    default:
                        return;
                }
            }
        }