Archive for the ‘.NET Coding’ Category

ObjectDataSource for non-static data = POOP

Ok, I’ve heard people rambling off and on about how they don’t like the ObjectDataSource for this and that, but now I’m really seeing what they mean… If you don’t use a static object for the objectdatasoure’s backing source (DataTypeName) then you’re going to get an EMPTY object, freshly baked every single postback! What good [...]

Read the rest of this entry »

Breaking the Rules of C#

Dynamic Casting at Runtime
Now you might think that c# is a strongly typed language, but I’ve just discovered a way that you can squeeze yourself through the door of reasonable doubt, if you happen to be in court trying to prove to the contrary.
Now, no fair emitting IL to emulate VB’s cast, and no fair [...]

Read the rest of this entry »

How to use the Introspector (details)

RefGen is very useful. The UI generation is neat, but the best part is the Introspector. Take anywhere you’d use reflection to enumerate properties and access them dynamically and replace that Type.GetProperty().GetValue() with Introspector.GetProperty(srcObject, “propertyName”). Even better, use it to set properties. Even enumerating properties and their types is a breeze, [...]

Read the rest of this entry »

One (probably) last thing about dynamic method (for now)

Ok, I admit it. It was all there in blue and white on microsoft’s site the whole time, and I just didn’t read it.
DynamicMethod, how to do it with generics, and yes… also… how to invoke generic type parameters at runtime and even how to return value types….wait for it…. without boxing.
http://msdn2.microsoft.com/en-us/library/exczf7b9.aspx
I hate that [...]

Read the rest of this entry »

Very Alpha release of RefGen posted to Sourceforge

Go get it at http://sourceforge.net/projects/refgen
Thanks to Manuel Abadia for letting me use his boilerplate code. I haven’t done him justice quite yet by updating the code to his ‘fixed’ version, but his name and link are in the NOTICE.txt file accompanying the download, and the update will be made.
I also need to create [...]

Read the rest of this entry »

Coming soon: RefGen, a real open source product from all my musings

I’ve been pounding out code now at 6 hour clips twice a day for the past oh… I don’t know how long, when did I start this blog? Finally, after all of my testing and positing, I have something to show for it and to share with the world.
So many people have helped me along [...]

Read the rest of this entry »

DynamicMethod — Now as soon as I close my gaping jaw…

Ok, this .net stuff actually still gets better. I’m sitting here strugling with ways to access methods and properties dynamically without using reflection every time, and I was starting to get creative. Of course I knew the right way would be to emit some IL and just suck it up already, but setting [...]

Read the rest of this entry »

Metadata, Xml, Fluidity, JSON and the meaning of life

In my various exploits with Relavance, I’m trying just about everything I can think of to get some semblance of CRUD operations for objects, as well as a degree of interoperability with arbitrary platforms all rolled into one. With a relational database, I could just create an XSD file describing my class and run [...]

Read the rest of this entry »

Just when things are starting to solidify for me…

…I go off in some corner with some new thing and realize that I have to relearn everything I thought I knew about everything. Ok, well maybe it’s not quite so severe, let me put it this way: programming is my addiction, and it’s only getting worse. I’m progressing in leaps and bounds [...]

Read the rest of this entry »