I can feel it. I was running the other day, The Distance playing in my ear-buds, and I caught a whiff of it. The scent of rain and plants and cold pavement and other things I can’t remember, a barbeque, maybe. The sun was shining, the clouds were awesome. I had clear road in front of me and nothing to do but run. I had to laugh – a bit maniacally, I admit. Then the moment passed and all returned to the way it was. But, oh yes, fall is here ......
Bloody useful, this code. Especially when threads or timers are involved. class Tracer { private Tracer() { } public static void WriteTracedDebugLine(string message) { StackTrace stack = new StackTrace(); string caller = stack.GetFrame(2).GetMethod... string callee = stack.GetFrame(1).GetMethod... if(message != null && message.Length > 0) Debug.WriteLine(message, caller + " -> " + callee); else Debug.WriteLine(caller + " -> " + callee); } } ......
Anonymous methods are a great new feature in .Net 2. Another great new feature is the ParameterizedThreadStart delegate. Since the ParameterizedThreadStart delegate is just a delegate, these two concepts can be combined to effectively create an asynchronous anonymous method – an anonymous thread, if you will. You can spin off a chunk of code to run asynchronously without having to put it into a separate function. Check out the following code: private void AddAsync(int a, int b) { //Define the ......