nullable index

make index nullable so ToString can append the index for indexed objects
This commit is contained in:
pblivingston 2025-11-25 15:32:27 -05:00
parent 9a2529c617
commit b0a6bf7b63

View File

@ -1,5 +1,5 @@
class IRemote { class IRemote {
[int]$index [Nullable[int]]$index
[Object]$remote [Object]$remote
IRemote ([Object]$remote) { IRemote ([Object]$remote) {
@ -44,6 +44,9 @@ class IRemote {
} }
[string] ToString() { [string] ToString() {
if ($this.index.HasValue) {
return $this.GetType().Name + $this.index
}
return $this.GetType().Name return $this.GetType().Name
} }
} }