JosephCooney

Putting the 'Junk' in DotNetJunkies

<August 2008>
SuMoTuWeThFrSa
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456


Navigation

My GotDotNet Samples

Subscriptions

News

I've moved my weblog to jcooney.net. Come and visit me there.


Monday, September 27, 2004 - Posts

Web Syncronicity
The web has a nice way of bringing things around full circle (or my brain notices co-incidences and attaches “meaning” to them). I played around late last week writing some custom attributes. I was interested in doing some method interception, and also maybe subscribing to some events on the decorated class. It seems that writing a custom attribute that actually DOES something by its self (rather than just being a piece of meta-data that can be queried reflectively by some other bit of code) is somewhat hard. If you inherit from ProxyAttribute and are applied to a ContextBoundObject object you can “do stuff” but apart from that it seems like you're out of luck. Even passing the current instance as a constructor argument to your attribute (so you could hook in to events and the like) doesn't work either (if anybody knows different please let me know). Somewhat disheartened I fired up IronPython to have a very belated play around with that. IronPython is cool, and I certainly plan to figure out how to add a “python interactive console” to winforms apps. Next thing I did (somewhat out of the blue) was check Jon Lam's site IUnknown.com. I had been talking to somebody about the IUnknown COM interface a couple of days before and it had reminded me of Jon's site - what do you think I found there? Some code on method interception written in Python.

posted Monday, September 27, 2004 7:50 AM by JosephCooney




Powered by Dot Net Junkies, by Telligent Systems