@@ -506,22 +506,35 @@ protected void LogQosEvent()
506
506
}
507
507
508
508
/// <summary>
509
- /// Guards execution of the given action using ShouldProcess and ShouldContinue. The optional
510
- /// useSHouldContinue predicate determines whether SHouldContinue should be called for this
511
- /// particular action (e.g. a resource is being overwritten). By default, both
512
- /// ShouldProcess and ShouldContinue will be executed. Cmdlets that use this method overload
513
- /// must have a force parameter.
509
+ /// Guards execution of the given action using ShouldProcess and ShouldContinue. This is a legacy
510
+ /// version forcompatibility with older RDFE cmdlets.
514
511
/// </summary>
515
512
/// <param name="force">Do not ask for confirmation</param>
516
513
/// <param name="continueMessage">Message to describe the action</param>
517
514
/// <param name="processMessage">Message to prompt after the active is performed.</param>
518
515
/// <param name="target">The target name.</param>
519
516
/// <param name="action">The action code</param>
520
- protected void ConfirmAction ( bool force , string continueMessage , string processMessage , string target ,
517
+ protected virtual void ConfirmAction ( bool force , string continueMessage , string processMessage , string target ,
521
518
Action action )
522
519
{
523
- ConfirmAction ( force , continueMessage , processMessage , target , action , ( ) => true ) ;
520
+ if ( _qosEvent != null )
521
+ {
522
+ _qosEvent . PauseQoSTimer ( ) ;
523
+ }
524
+
525
+ if ( force || ShouldContinue ( continueMessage , "" ) )
526
+ {
527
+ if ( ShouldProcess ( target , processMessage ) )
528
+ {
529
+ if ( _qosEvent != null )
530
+ {
531
+ _qosEvent . ResumeQosTimer ( ) ;
532
+ }
533
+ action ( ) ;
534
+ }
535
+ }
524
536
}
537
+
525
538
/// <summary>
526
539
/// Guards execution of the given action using ShouldProcess and ShouldContinue. The optional
527
540
/// useSHouldContinue predicate determines whether SHouldContinue should be called for this
@@ -535,7 +548,7 @@ protected void ConfirmAction(bool force, string continueMessage, string processM
535
548
/// <param name="target">The target name.</param>
536
549
/// <param name="action">The action code</param>
537
550
/// <param name="useShouldContinue">A predicate indicating whether ShouldContinue should be invoked for thsi action</param>
538
- protected void ConfirmAction ( bool force , string continueMessage , string processMessage , string target , Action action , Func < bool > useShouldContinue )
551
+ protected virtual void ConfirmAction ( bool force , string continueMessage , string processMessage , string target , Action action , Func < bool > useShouldContinue )
539
552
{
540
553
if ( null == useShouldContinue )
541
554
{
@@ -567,7 +580,7 @@ protected void ConfirmAction(bool force, string continueMessage, string processM
567
580
/// <param name="processMessage">The change being made to the resource</param>
568
581
/// <param name="target">The resource that is being changed</param>
569
582
/// <param name="action">The action to perform if confirmed</param>
570
- protected void ConfirmAction ( string processMessage , string target , Action action )
583
+ protected virtual void ConfirmAction ( string processMessage , string target , Action action )
571
584
{
572
585
if ( _qosEvent != null )
573
586
{
0 commit comments