07-24-2023, 09:47 AM
This is JScript, not JavaScript.
I have a `System.Collections.Hashtable` object. I want to get all the keys in it.
I can grab an enumerator to that object:
`var benumbing = event1.GetEnumerator();`
but when I call [MoveNext()][1] on the object, I get this error:
`Attempt by method 'invoker11.Invoke(System.Object, System.Object[])' to access type 'System.Collections.Hashtable+HashtableEnumerator' failed.`
I can also grab the `Keys` property, and can call the `GetType()` method on it to see that is a `System.Collections.Hashtable+KeyCollection`, but if I access the `Count` member of it, I get the error
`Attempt by method 'invoker8.Invoke(System.Object, System.Object[])' to access type 'System.Collections.Hashtable+KeyCollection' failed.`
It feels like OO-protection levels are not correct somehow. Is there some method to declaring my hashtable object?
[1]:
I have a `System.Collections.Hashtable` object. I want to get all the keys in it.
I can grab an enumerator to that object:
`var benumbing = event1.GetEnumerator();`
but when I call [MoveNext()][1] on the object, I get this error:
`Attempt by method 'invoker11.Invoke(System.Object, System.Object[])' to access type 'System.Collections.Hashtable+HashtableEnumerator' failed.`
I can also grab the `Keys` property, and can call the `GetType()` method on it to see that is a `System.Collections.Hashtable+KeyCollection`, but if I access the `Count` member of it, I get the error
`Attempt by method 'invoker8.Invoke(System.Object, System.Object[])' to access type 'System.Collections.Hashtable+KeyCollection' failed.`
It feels like OO-protection levels are not correct somehow. Is there some method to declaring my hashtable object?
[1]:
[To see links please register here]