On Fri, 12 Oct 2007 11:01:00 -0700, GSS
<GS*@discussions.microsoft.comwrote:
>I am writing a custom logging component (which uses App Block; good stuff
there). The logger may be used in a winform, webform or in a webservice. I'd
like to determine what application type the component is being used in so I
can take different actions (e.g. terminate winapp, close session, or simply
log (or in some cases stop the service). How can I programmatically determine
this?
Personally I would not take this approach. The logging component
should do just that -- log. If you want additional logic based on the
application type do that separately in another component, or in the
application itself.
This way your logging component can
- Concentrate on its core function
- Be usable in scenarios that you might not think of now. If you bake
in dependencies on winforms and webservices then how easily can you
use it in a Smart Device application?
--
http://bytes.thinkersroom.com