Handles.Label - No example in C#

I was trying to recreate it in C# and it did not work.

Target is an Object so it does not have a transform. I tried casting it, but that gave me a null.

Is this example valid at all?

Thank you for reporting this. We have made a bug and it will be addressed.

What I ended up doing is this (in a MonoBehaviour derived script, not Editor derived):

#if UNITY_EDITOR
void OnDrawGizmos()
{
     Handles.Label(transform.position, myString);
}
#endif