문제

I'm trying to extend my new WPF Touch Screen Keyboard (DLL) Library, to allow the user to get events from the Touch Screen Object. I'd like to be able to tell the Programmer what Object made the call (or executed the subroutine) that raised the event. Not dissimilar to the Sender as Object event parameters one gets when working with a System Object. Which begs the question, How do I get that information, if I don't ask for it? Is there a way to get this information from some call made in the subroutine about to raise the event? That would be nice, and a time saver for me. Thanks!

도움이 되었습니까?

해결책

Can you assign a value to the sender object when you are going to raise the event?

RaiseEvent Touched(Me, e)

다른 팁

You can walk the stack be using the StackTrace class. You will not be able to inspect the call stack parameters, but you can inspect the metadata of the parameters (type information).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top