libraries/Microsoft.Bot.Builder.Dialogs.Adaptive.Teams/Actions/GetMeetingParticipant.cs
/// <summary>
/// Called when the dialog is started and pushed onto the dialog stack.
/// </summary>
/// <param name="dc">The <see cref="DialogContext"/> for the current turn of conversation.</param>
/// <param name="options">Optional, initial information to pass to the dialog.</param>
/// <param name="cancellationToken">A cancellation token that can be used by other objects
/// or threads to receive notice of cancellation.</param>
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
Called when the dialog is started and pushed onto the dialog stack.
Called when the dialog is started and pushed onto the dialog stack .
public override async Task<DialogTurnResult> BeginDialogAsync(DialogContext dc, object options = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (options is CancellationToken)
            {
                throw new ArgumentException($"{nameof(options)} cannot be a cancellation token");
            }
            if (this.Disabled != null && this.Disabled.GetValue(dc.State) == true)
            {
                return await dc.EndDialogAsync(cancellationToken: cancellationToken).ConfigureAwait(false);
            }
            if (dc.Context.Activity.ChannelId != Channels.Msteams)
            {
                throw new InvalidOperationException("TeamsInfo.GetMeetingParticipantAsync() works only on the Teams channel.");
            }
            string meetingId = GetValueOrNull(dc, this.MeetingId);
            string participantId = GetValueOrNull(dc, this.ParticipantId);
            string tenantId = GetValueOrNull(dc, this.TenantId);
            if (participantId == null)
            {
                throw new InvalidOperationException($"GetMeetingParticipant could determine the participant id by expression value provided. {nameof(participantId)} is required.");
            }
            var result = await TeamsInfo.GetMeetingParticipantAsync(dc.Context, meetingId, participantId, tenantId, cancellationToken: cancellationToken).ConfigureAwait(false);
            dc.State.SetValue(this.Property.GetValue(dc.State), result);
            return await dc.EndDialogAsync(result, cancellationToken: cancellationToken).ConfigureAwait(false);
        }
public override async Task < DialogTurnResult > BeginDialogAsync ( DialogContext dc , object options = null , CancellationToken cancellationToken = default ( CancellationToken ) ) { if ( options is CancellationToken ) { throw new ArgumentException ( $" { nameof ( options ) }  cannot be a cancellation token " ) ; } if ( this . Disabled != null && this . Disabled . GetValue ( dc . State ) == true ) { return await dc . EndDialogAsync ( cancellationToken : cancellationToken ) . ConfigureAwait ( false ) ; } if ( dc . Context . Activity . ChannelId != Channels . Msteams ) { throw new InvalidOperationException ( " " ) ; } string meetingId = GetValueOrNull ( dc , this . MeetingId ) ; string participantId = GetValueOrNull ( dc , this . ParticipantId ) ; string tenantId = GetValueOrNull ( dc , this . TenantId ) ; if ( participantId == null ) { throw new InvalidOperationException ( $" GetMeetingParticipant could determine the participant id by expression value provided.  { nameof ( participantId ) }  is required. " ) ; } var result = await TeamsInfo . GetMeetingParticipantAsync ( dc . Context , meetingId , participantId , tenantId , cancellationToken : cancellationToken ) . ConfigureAwait ( false ) ; dc . State . SetValue ( this . Property . GetValue ( dc . State ) , result ) ; return await dc . EndDialogAsync ( result , cancellationToken : cancellationToken ) . ConfigureAwait ( false ) ; }
Called when the dialog is started and pushed onto the dialog stack.
Called when the dialog is started and pushed onto the dialog stack .
// TeamsInfo.GetMeetingParticipantAsync will default to retrieving the current meeting's participant // if none is provided.  This could lead to unexpected results.  Therefore, GetMeetingParticipant action // throws an exception if the expression provided somehow maps to an invalid result.
A  representing the asynchronous operation.
A representing the asynchronous operation .
dc
DialogContext
The  for the current turn of conversation.
The for the current turn of conversation .
options
object
Optional, initial information to pass to the dialog.
Optional initial information to pass to the dialog .
cancellationToken
CancellationToken
A cancellation token that can be used by other objects
or threads to receive notice of cancellation.
A cancellation token that can be used by other objects or threads to receive notice of cancellation .