IUccIncomingSessionEvent Interface

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Represents the data common to all incoming session events.

Namespace: Microsoft.Office.Interop.UccApi
Assembly: Microsoft.Office.Interop.UccApi (in microsoft.office.interop.uccapi.dll)

Syntax

'Declaration
Public Interface IUccIncomingSessionEvent
    Inherits IUccIncomingRequestEvent, IUnknown
public interface IUccIncomingSessionEvent : IUccIncomingRequestEvent, IUnknown
public interface class IUccIncomingSessionEvent : IUccIncomingRequestEvent, IUnknown
public interface IUccIncomingSessionEvent extends IUccIncomingRequestEvent, IUnknown
public interface IUccIncomingSessionEvent extends IUccIncomingRequestEvent, IUnknown

Remarks

Win32 COM/C++ Syntax

interface IUccIncomingSessionEvent : IUccIncomingRequestEvent

Example

The following example is drawn from an application developed in C#. Note that the pEventData parameter is of type UccIncomingSessionEvent in this example. This is due to the fact that the interop assembly (microsoft.office.interop.uccapi.dll) exposes the interface in this way for .NET managed languages. UccIncomingSessionEvent exposes the same methods and properties as IUccIncomingSessionEvent and is treated in the same way.

/// <summary>
/// handles session invitations by displaying a dialog for
/// local user advising user of invitation and providing a mechanism
/// for the user to respond to the invitation
/// </summary>
/// <param name="pEventSource">IUccEndpoint server endpoint raising event</param>
/// <param name="pEventData">New session</param>
void _IUccSessionManagerEvents.OnIncomingSession(
    IUccEndpoint pEventSource,
    UccIncomingSessionEvent pEventData)
{

    if (pEventData.Session.Type == UCC_SESSION_TYPE.UCCST_INSTANT_MESSAGING)
    {
        DialogResult result;
        // The user agreed to accept the invitation.
        // First ask the user for permission to accept or decline the
        // pending invitation.
                
        result = MessageBox.Show(
            this._PlatformManager._thisForm,
            "Accept incoming IM session from " + 
            pEventData.Inviter.Uri.UserAtHost + 
            "?",
            "Incoming Session",
            MessageBoxButtons.YesNo);

        if (result != DialogResult.Yes)
        {
            // The user has said "no" to the invitation. Thus, rejected
            // the incoming session.
            pEventData.Reject(UCC_REJECT_OR_TERMINATE_REASON.UCCROTR_DECLINE);
            return;
        }

        //new session is obtained from event data instance
        //client application must cache this session instance
        //for interaction outside of this method
        IUccSession imSession = pEventData.Session;

        // Accept incoming session invitation
        pEventData.Accept();

    }

}

Platforms

Development Platforms

Windows XP Professional with Service Pack 2 (SP2), Windows Server 2000 with Service Pack 4, Windows Server 2003, Windows Vista Ultimate Edition, Windows Vista Business Edition, Windows Vista Enterprise Edition

Target Platforms

See Also

Reference

IUccIncomingSessionEvent Members
Microsoft.Office.Interop.UccApi Namespace