removed the countdown from the BufferStarted notification
This commit is contained in:
@@ -143,20 +143,25 @@ if ($Type -eq 'BufferStarted') {
|
|||||||
$txtBody.Inlines.Add("`n`nIT can retrieve this file if needed for a support case.")
|
$txtBody.Inlines.Add("`n`nIT can retrieve this file if needed for a support case.")
|
||||||
}
|
}
|
||||||
|
|
||||||
# Countdown timer — auto-dismisses after 30 seconds
|
if ($Type -eq 'ReplaySaved') {
|
||||||
# Use a hashtable for shared state so the closure captures it by reference correctly
|
# Countdown timer — auto-dismisses after 30 seconds
|
||||||
$state = @{ Tick = 30 }
|
# Use a hashtable for shared state so the closure captures it by reference correctly
|
||||||
$btnOK.Content = 'OK (30)'
|
$state = @{ Tick = 30 }
|
||||||
$timer = New-Object System.Windows.Threading.DispatcherTimer
|
$btnOK.Content = 'OK (30)'
|
||||||
$timer.Interval = [TimeSpan]::FromSeconds(1)
|
$timer = New-Object System.Windows.Threading.DispatcherTimer
|
||||||
$timer.Add_Tick({
|
$timer.Interval = [TimeSpan]::FromSeconds(1)
|
||||||
$state.Tick--
|
$timer.Add_Tick({
|
||||||
$btnOK.Content = "OK ($($state.Tick))"
|
$state.Tick--
|
||||||
if ($state.Tick -le 0) {
|
$btnOK.Content = "OK ($($state.Tick))"
|
||||||
$timer.Stop()
|
if ($state.Tick -le 0) {
|
||||||
$window.Close()
|
$timer.Stop()
|
||||||
}
|
$window.Close()
|
||||||
}.GetNewClosure())
|
}
|
||||||
$timer.Start()
|
}.GetNewClosure())
|
||||||
$btnOK.Add_Click({ $timer.Stop(); $window.Close() }.GetNewClosure())
|
$timer.Start()
|
||||||
|
$btnOK.Add_Click({ $timer.Stop(); $window.Close() }.GetNewClosure())
|
||||||
|
} else {
|
||||||
|
$btnOK.Content = 'OK'
|
||||||
|
$btnOK.Add_Click({ $window.Close() }.GetNewClosure())
|
||||||
|
}
|
||||||
$window.ShowDialog() | Out-Null
|
$window.ShowDialog() | Out-Null
|
||||||
|
|||||||
Reference in New Issue
Block a user