Geeks With Blogs
Freestyle Coding Programming in the Real World Reflection
Reflective Threads
I just stumbled on a cool trick that I had to share. I wanted to dynamically find and call initialization code. This led me to the use of attributes. Of course, once we find our method, we need to call it by using Method.Invoke( object, object). The problem was that most of the initialization code didn't touch each other. As such, I wanted to wrap the calls into threads. However, thread targets usually have to take either no parameters or one object. However, Invoke requires 2 parameters. The solution ......

Posted On Thursday, July 12, 2012 1:11 PM

Dynamic Library Loading
Microsoft keeps telling us that we should create interfaces for everything and program to them. This is all fine and dandy, but this can become a nightmare when dealing with dynamically loaded libraries. Let us begin with an interface: namespace Interfaces {public interface ICommon {string RequiredField { get; }void DoSomethingWithTheRequiredF... Now, we will create 2 different implementations of the interface. The first will implement ICommon for use with our Sql database: namespace Sql {public ......

Posted On Wednesday, October 6, 2010 8:13 PM

Copyright © Chris Gardner | Powered by: GeeksWithBlogs.net | Join free