Intercepting call

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fenix

    Intercepting call

    I want intercept the call to a object method or object property .
    Its plausible ?

    Are there any event fired when i invoke a object method or property ?
  • Peter Rilling

    #2
    Re: Intercepting call

    You normally you can't intercept direct method calls. Events are only fired
    if the API supports them. If you provided more information about what you
    wanted, then I might be able to provide a more practical design. But
    normally there is not much more you can do with an API then they allow by
    either inheritance or events.


    "Fenix" <Fenix@discussi ons.microsoft.c om> wrote in message
    news:A70B0726-9959-401F-8870-C36130F1A60E@mi crosoft.com...[color=blue]
    > I want intercept the call to a object method or object property .
    > Its plausible ?
    >
    > Are there any event fired when i invoke a object method or property ?[/color]


    Comment

    • Anders Norås

      #3
      Re: Intercepting call

      >I want intercept the call to a object method or object property .[color=blue]
      > Its plausible ?[/color]
      This is what Aspect Oriented Programming is all about. You should look at
      frameworks like Aspect# or Spring.NET. These frameworks enable you to create
      a proxy for your class which can intercept class to methods and similar.

      Aspect#: http://aspectsharp.sourceforge.net
      Spring.net: http://www.springframework.net
      [color=blue]
      > Are there any event fired when i invoke a object method or property ?[/color]
      No.

      Anders Norås
      blog: http://dotnetjunkies.com/weblog/anoras


      Comment

      Working...