@@ -54,12 +54,6 @@ public CreateEventDialog(
5454 CreateEvent ,
5555 } ;
5656
57- var updateAddress = new WaterfallStep [ ]
58- {
59- UpdateAddress ,
60- AfterUpdateAddress ,
61- } ;
62-
6357 var updateStartDate = new WaterfallStep [ ]
6458 {
6559 UpdateStartDateForCreate ,
@@ -86,7 +80,6 @@ public CreateEventDialog(
8680
8781 // Define the conversation flow using a waterfall model.
8882 AddDialog ( new WaterfallDialog ( Actions . CreateEvent , createEvent ) { TelemetryClient = telemetryClient } ) ;
89- AddDialog ( new WaterfallDialog ( Actions . UpdateAddress , updateAddress ) { TelemetryClient = telemetryClient } ) ;
9083 AddDialog ( new WaterfallDialog ( Actions . UpdateStartDateForCreate , updateStartDate ) { TelemetryClient = telemetryClient } ) ;
9184 AddDialog ( new WaterfallDialog ( Actions . UpdateStartTimeForCreate , updateStartTime ) { TelemetryClient = telemetryClient } ) ;
9285 AddDialog ( new WaterfallDialog ( Actions . UpdateDurationForCreate , updateDuration ) { TelemetryClient = telemetryClient } ) ;
@@ -199,7 +192,7 @@ public CreateEventDialog(
199192
200193 if ( state . Attendees . Count == 0 && ( ! state . CreateHasDetail || state . RecreateState == RecreateEventState . Participants || state . AttendeesNameList . Count > 0 ) )
201194 {
202- return await sc . BeginDialogAsync ( Actions . UpdateAddress , cancellationToken : cancellationToken ) ;
195+ return await sc . BeginDialogAsync ( nameof ( FindContactDialog ) , options : sc . Options , cancellationToken : cancellationToken ) ;
203196 }
204197 else
205198 {
@@ -494,72 +487,6 @@ public CreateEventDialog(
494487 }
495488 }
496489
497- // update address waterfall steps
498- public async Task < DialogTurnResult > UpdateAddress ( WaterfallStepContext sc , CancellationToken cancellationToken = default ( CancellationToken ) )
499- {
500- try
501- {
502- var state = await Accessor . GetAsync ( sc . Context , cancellationToken : cancellationToken ) ;
503- if ( state . AttendeesNameList . Any ( ) )
504- {
505- return await sc . NextAsync ( cancellationToken : cancellationToken ) ;
506- }
507-
508- return await sc . PromptAsync ( Actions . Prompt , new PromptOptions { Prompt = ResponseManager . GetResponse ( CreateEventResponses . NoAttendees ) } , cancellationToken ) ;
509- }
510- catch ( Exception ex )
511- {
512- await HandleDialogExceptions ( sc , ex ) ;
513- return new DialogTurnResult ( DialogTurnStatus . Cancelled , CommonUtil . DialogTurnResultCancelAllDialogs ) ;
514- }
515- }
516-
517- public async Task < DialogTurnResult > AfterUpdateAddress ( WaterfallStepContext sc , CancellationToken cancellationToken = default ( CancellationToken ) )
518- {
519- try
520- {
521- var state = await Accessor . GetAsync ( sc . Context , cancellationToken : cancellationToken ) ;
522- if ( state . AttendeesNameList . Any ( ) )
523- {
524- state . FirstEnterFindContact = true ;
525- return await sc . BeginDialogAsync ( nameof ( FindContactDialog ) , options : sc . Options , cancellationToken : cancellationToken ) ;
526- }
527-
528- if ( sc . Result != null )
529- {
530- sc . Context . Activity . Properties . TryGetValue ( "OriginText" , out var content ) ;
531- var userInput = content != null ? content . ToString ( ) : sc . Context . Activity . Text ;
532- if ( state . EventSource != EventSource . Other )
533- {
534- if ( userInput != null )
535- {
536- var nameList = userInput . Split ( CreateEventWhiteList . GetContactNameSeparator ( ) , StringSplitOptions . None )
537- . Select ( x => x . Trim ( ) )
538- . Where ( x => ! string . IsNullOrWhiteSpace ( x ) )
539- . ToList ( ) ;
540- state . AttendeesNameList = nameList ;
541- }
542-
543- state . FirstEnterFindContact = true ;
544- return await sc . BeginDialogAsync ( nameof ( FindContactDialog ) , options : sc . Options , cancellationToken : cancellationToken ) ;
545- }
546- else
547- {
548- return await sc . BeginDialogAsync ( Actions . UpdateAddress , new UpdateAddressDialogOptions ( UpdateAddressDialogOptions . UpdateReason . NotAnAddress ) , cancellationToken ) ;
549- }
550- }
551- else
552- {
553- return await sc . NextAsync ( cancellationToken : cancellationToken ) ;
554- }
555- }
556- catch ( Exception ex )
557- {
558- await HandleDialogExceptions ( sc , ex ) ;
559- return new DialogTurnResult ( DialogTurnStatus . Cancelled , CommonUtil . DialogTurnResultCancelAllDialogs ) ;
560- }
561- }
562-
563490 // update start date waterfall steps
564491 public async Task < DialogTurnResult > UpdateStartDateForCreate ( WaterfallStepContext sc , CancellationToken cancellationToken = default ( CancellationToken ) )
565492 {
0 commit comments