I've been adding some custom extender methods onto the GUIControl type (for all GUIControl types) and I've noticed something. It seems that autocomplete doesn't detect the inheritance of extender methods. I could use the extender methods just fine, but they refused to show up in autocomplete. I even tried the fake-import-in-a-comment trick to no avail.
What I've had to do is actually overload the extender functions for each of the inherited types like:
void SetProperty(this Button*, int value) {
GUIControl *gc = this;
gc.SetProperty(value);
}
int GetProperty(this Button*) {
GUIControl *gc = this;
return gc.GetProperty();
}
My tests proved that the overloaded versions of the functions were actually getting called as well (which is actually interesting...::)).
However I'm just saying it would be nice if autocomplete could be made to detect the inheritance of my extender methods? Nothing high priority by any means though.
Edit: I corrected the overloaded functions to reflect I am calling the GUIControl method not the overloaded methods recursively... ::)
Edit 2: Somehow I completely failed to recognize at first that the fact that the overloaded functions were getting called is polymorphism (http://www.americangirlscouts.org/agswiki/Extender_Methods_mean_Polymorphism!). Which is nice. Please don't fix that Chris. :P
I'd like this as well, as I have enough trouble with spelling errors as it is.
Hmm interesting, I'll look into this.