TcKs
TcKs

Reputation: 26632

How-to log user actions in winforms application

I would like log user actions in winforms applications. The "user actions" mean "click to menu item/button", "move/maximize/minimize/close form", "keydown/up", etc...

The log should contains time, action type (click/keydown/etc...), target (name/text of control).

I have access to source code of target application, but I would like to not override methods like "OnClick" or "OnKeyDown" in every winforms control I'm using, if it is not necessary.

Is there some elegant solution, how to do it?

Thanks!

Upvotes: 1

Views: 507

Answers (1)

Michael Prewecki
Michael Prewecki

Reputation: 2102

You could use attributes but I wonder if the benefits will outweigh the cost?

See this link for an example of creating an attribute that can be set on each method

http://www.yoda.arachsys.com/csharp/benchmark.html

Upvotes: 1

Related Questions