Honest Illusion

Where Lightning's Still the Biggest Thrill of All...

Code'n'Stuff from James Curran, simple country programmer.
Welcome to Honest Illusion Sign in | Help
in Search

Browse by Tags

All Tags » C# » dotnet » Code
Showing page 1 of 2 (17 total posts)
  • PropertyBagTextWriter (Stream into Dictionary)

    It’s been too long since I posted since .NET code, and I’ve been itching to.  (Actually, I really want to write more about politics, but I figured if I don’t show some code soon, I’m gonna lost my techy audience)  Fortunately, I’ve got a backlog of things I’ve been meaning to write about.  Today’s is the PropertyBagTextWriter. The original ...
    Posted to Honest Illusion (Weblog) by James on August 18, 2011
  • Get an ApplicationBarIconButton by name (Redux)

    Yesterday, I read a blog post on getting an ApplicationBarIconButton by name.  The author made a couple minor errors in the code, which I was going to leave a comment about, except his comment page is broken. So, another excuse to write something for my own blog. The basics of the article are that in Windows Phone 7 coding, when referencing ...
    Posted to Honest Illusion (Weblog) by James on May 24, 2011
  • Creating an Entity Framework connection from another one.

    Database connection strings used to be simple.  Well, simple, once you learned the arcane syntax,  But, at least they had stayed the same for about a decade.  But with the EntityFramework, they took on an even more arcane “connection string – within –a –connection string” format.  And while the inner connection string related to your database, ...
    Posted to Honest Illusion (Weblog) by James on May 2, 2011
  • Automating Retry on Exception

    Every so often, you run across some action,  which just fails, where the best response it to just try it again.  This is particularly true when dealing with an external source, like a database or web service, which can have network or other temporary problems, which would have cleared up when you repeat the call seconds later.   Often, these ...
    Posted to Honest Illusion (Weblog) by James on March 21, 2011
  • The Evolutionary Guide to C# Lambda Syntax

    Originally (.NET V1.1), we had to explicitly create a Delegate object to wrap a method reference to use it as a callback method, and that method had to named. button1.Click += new EventHandler(button1_Click); // : // : void button1_Click(object sender, EventArgs e) { DoStuff(); }   With .NET ...
    Posted to Honest Illusion (Weblog) by James on March 17, 2011
  • Running An Async Event Handler on the UI thread (with lambdas and extension methods!)

    So, it’s been a freakishly long time since my last post here.  I’ve been trying to get better… I even wrote out a list of topics I wanted to write about.  So, let’s start talking about them. As we do more and more work in our applications asynchronously, we’re confronted with the problem of how to communicate the status of the background ...
    Posted to Honest Illusion (Weblog) by James on March 15, 2011
  • Lambda Expressions as Properties

    Peter recently caused a bit of a stir with his article “Sometimes an enum is not the best idea”.  In it, he had a very specific problem: When an enum is passed to a method as an Object, and that method converts it to a usable value by calling ToString(), you get that enum’s name and not it’s value.  And he gave a gave very specific solution to ...
    Posted to Honest Illusion (Weblog) by James on June 7, 2010
  • Portable Areas for Castle Monorail, Part 2

    In our last episode, we discussed the PortableAreaController base class, which makes it simple to create a portable area using Monorail.  In this installment, we put that class to use. For the purposes of this example, the controller isn’t going to do anything useful – I’m not even going to bother with code in the actions.  The different ...
    Posted to Honest Illusion (Weblog) by James on April 1, 2010
  • Portable Areas for Castle Monorail

    Recently I had read a blogger comparing Castle Monorail with ASP.NET MVC.  He chose ASP.NET mainly because it supported Portable Areas while Monorail did not.  As a supporter of Monorail, I was very offended by this, and decided to correct the problem.  The first step… finding out exactly what a “portable area” was. A Portable Area is a ...
    Posted to Honest Illusion (Weblog) by James on April 1, 2010
  • Some Better-Written Custom String Methods using C#

    In my daily web-surfing, I often stumble upon snippets of C# code posted by people.  Usually, I can tweak  it a bit. Sometimes, I can tweak it a lot.  I usually post a quick comment to the site offering it.  Today, I came upon some code that was so bad --- which the author said was from his forthcoming book! --- more drastic measures must be ...
    Posted to Honest Illusion (Weblog) by James on February 2, 2010
1 2 Next >
Powered by Community Server (Personal Edition), by Telligent Systems