Share via


IUccIncomingSessionEvent.Inviter Property

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.

Gets the remote participant who initiated the incoming session.

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

Syntax

'Declaration
ReadOnly Property Inviter As IUccSessionParticipant
IUccSessionParticipant Inviter { get; }
property IUccSessionParticipant^ Inviter {
    IUccSessionParticipant^ get ();
}
/** @property */
IUccSessionParticipant get_Inviter ()
function get Inviter () : IUccSessionParticipant

Property Value

A value of the IUccSessionParticipant** (IUccSessionParticipant, for a .NET application) type. The returned object identifies the sender of the session invitation.

Remarks

Win32 COM/C++ Syntax

HRESULT get_Inviter
(
   IUccSessionParticipant** ppInvitingParticipant
);

Note

In a Win32 application, the return value of a method or property is always an HRESULT value indicating the status of the call to the interface member. Any result of the operation is returned as a parameter marked with the [out, retval] attribute. In contrast, in a .NET application the HRESULT value indicating an error condition is returned as a COM exception and the [out, retval] parameter becomes the return value. For the UCC API-defined HRESULT values, see Trace and Handle Errors in Unified Communications Client API.

Example

The following example uses the Inviter property to display the identity of the inviting user in a forms dialog which informs the local user of the incoming invitation and inviter. The UccUri instance returned by the Inviter's Uri property provides the required identitiy properties.

/// <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"></param>
/// <param name="pEventData"></param>
void _IUccSessionManagerEvents.OnIncomingSession(
    IUccEndpoint pEventSource,
    UccIncomingSessionEvent pEventData)
{

    DialogResult result;
    // Ask the user for permission to accept or decline the
    // pending invitation.
    
    //Get UccUri instance from Inviter property of IUccSessionPaticipant
    IUccSessionParticipant invitingParticipant = pEventData.Inviter;
    string invitingUser = invitingParticipant.Uri.UserAtHost;
    result = System.Windows.Forms.MessageBox.Show(
        this._PlatformManager.thisForm,
        "Accept incoming IM session from " + 
        invitingUser + 
        "?",
        "Incoming Session",
        System.Windows.Forms.MessageBoxButtons.YesNo);

    if (result != DialogResult.Yes)
    {
        pEventData.Reject(
            UCC_REJECT_OR_TERMINATE_REASON.UCCROTR_DECLINE);
        return;
    }
    IUccSession imSession = null;
    imSession = pEventData.Session;
    session newIMSession = new session(
        UCC_SESSION_TYPE.UCCST_INSTANT_MESSAGING, 
        pEventData.Session);

    // open IM dialog
    pEventData.Accept();
                }

}

Thread Safety

All public static (Shared in Visual Basic) members of this type are thread-safe. Instance members are not guaranteed to be thread-safe.

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 Interface
IUccIncomingSessionEvent Members
Microsoft.Office.Interop.UccApi Namespace