c# - Which object does `this` refer to inside an event handler? -
does refer object handler defined in or object handle belongs to:
example:
class foo { object a; public foo() { a.handle += function; } void function() { this;<--what "this" refer foo or object a? } }
this refers foo. in c# this pointer refers instance of class containing method
Comments
Post a Comment