Suppose you're opening an issue and there's a lot noisey logs that may be useful.
Rather than wrecking readability, wrap it in a <details>
tag!
<details>
Summary Goes Here
using namespace System.Linq.Expressions | |
#class to register on posix signal and provide a cancellation token | |
#many signal are working under windows (SIGINT, SIGQUIT ...) | |
class SignalToken : System.IDisposable { | |
hidden [System.Threading.CancellationTokenSource]$cts | |
hidden [System.Runtime.InteropServices.PosixSignalRegistration]$reg | |
[System.Runtime.InteropServices.PosixSignal]$Signal = [System.Runtime.InteropServices.PosixSignal]::SIGINT | |
[System.Threading.CancellationToken]$Token |
In order to implement IEnumerator<T>
you have to explicitly implement the Current
member for IEnumerator<T>
and IEnumerator
... but PowerShell won't let you have two different implementations of the same property, nor will it let you explicitly implement an interface member. So we do one at a time, like this:
First, make a non-generic IEnumerator, but implemented with the type you want in the end:
class __Generator : System.Collections.IEnumerator {
[int]$Actual = 0
[object]get_Current() {
return $this.Actual