The question is answered, right answer was accepted
call the current method, using some sort of keyword? for self reference
Hi
Is there anyway i can call the current method from inside without typing the method name again (incase the method name is changed by someone else later)
So currently, i call the same name internally (SelfRef), this will cause a bug in future maintenance if not using a code auditing program
i.e.
void SelfRef(string _Input){
if (_Input == "route1"){
//route1 calls route 2
SelfRef("route2"); //call self
}else if (_Input == "route2"){
//route2 ends
}
}
Hmm dont know. $$anonymous$$akes me think of delegates, macros and function pointers.
Answer by wibble82 · Nov 20, 2015 at 02:41 PM
Hi there
I'm afraid there isn't that functionality as far as I know, though it's possible I've just not found it!
I would point out though that unless somebody changes the method name AND creates a new method with the original name, it'll just create an easily fixable compiler error - no need for using code auditing software or anything.
-Chris
thanks, sorry in the end the answer was f* bombed by stack exchange
http://stackoverflow.com/questions/33828287/c-sharp-self-reference-a-method?sfb=2
closing...