views:

105

answers:

1

Hi,

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!

A: 

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

Michael Prewecki
I'm not sure, how can be microbenchmarking used exactly for my purpose.Don't you mean something like AOP ( The PostSharp for example)?
TcKs