IUccSessionParticipantStateChangedEvent.NewState 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 participant state after the event.
Namespace: Microsoft.Office.Interop.UccApi
Assembly: Microsoft.Office.Interop.UccApi (in microsoft.office.interop.uccapi.dll)
Syntax
'Declaration
ReadOnly Property NewState As UCC_SESSION_ENTITY_STATE
UCC_SESSION_ENTITY_STATE NewState { get; }
property UCC_SESSION_ENTITY_STATE NewState {
UCC_SESSION_ENTITY_STATE get ();
}
/** @property */
UCC_SESSION_ENTITY_STATE get_NewState ()
function get NewState () : UCC_SESSION_ENTITY_STATE
Property Value
A value of the UCC_SESSION_ENTITY_STATE* (UCC_SESSION_ENTITY_STATE, for a .NET application) type.
Remarks
This new state value can be different from the current participant state due to the asynchronous nature of event invocation. The latency between a remote user operation and a locally raised event is not relevant in the case where the raised event indicates the remote user state is UCC_SESSION_ENTITY_STATE.UCCSES_DISCONNECTED. In this case, the remote user is no longer connected to a session and will raise no further State Changed events.
Win32 COM/C++ Syntax
HRESULT get_NewState
(
UCC_SESSION_ENTITY_STATE* pVal
);
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 handles the OnStateChanged event and uses NewState to inform the local user about the connection state of a remote session participant.
/// <summary>
/// session participant state change event. Remote
/// session participants raise this event when state changes.
/// </summary>
/// <param name="pEventSource">participant source of event</param>
/// <param name="pEventData">state changed related data</param>
void _IUccSessionParticipantEvents.OnStateChanged(
IUccSessionParticipant pEventSource,
UccSessionParticipantStateChangedEvent pEventData)
{
StringBuilder sb = new StringBuilder();
if (pEventData.NewState == UCC_SESSION_ENTITY_STATE.UCCSES_CONNECTED)
{
sb.Append(
pEventSource.Uri.User +
" has CONNECTED to the session");
}
else if (pEventData.NewState == UCC_SESSION_ENTITY_STATE.UCCSES_CONNECTING)
{
sb.Append(
pEventSource.Uri.User +
" has received session invitation");
}
else if (pEventData.NewState == UCC_SESSION_ENTITY_STATE.UCCSES_DISCONNECTED)
{
sb.Append(
pEventSource.Uri.User +
" has disconnected from the session");
}
Console.WriteLine(sb.ToString());
}
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
IUccSessionParticipantStateChangedEvent Interface
IUccSessionParticipantStateChangedEvent Members
Microsoft.Office.Interop.UccApi Namespace