I am reasonably new to C# as a language (coming from a C++ background) and I am currently in the process of writing an application that makes use of an event driven API.
Primarily this consists of registering event/response handlers and starting event monitors then dealing with these asychronous events/responses.
The thing i'm having a bit of trouble understanding is the use of the sender object.
What I would like to use it for is to pass a handle to a class object I have with various structures and data in when making a request (or setting up a monitor). And then on the response being recieved/the event being raised I can take the sender object, cast it back to the expected class type and access members, make further changes etc. so treating it as if it's just still a pointer to the original data (which I'm hoping it would be?).
So my question really is, as I am passing a class object in my request, will this be effectively a reference, or will it be copied somewhere along the line by value as it is actually just a generic object and I will end up with an empty copy of my class object on the event?
Or the third option that i'm maybe completely on the wrong track here and should forget the whole thing? :)
Problem is my brains still working in pointers mode I think...