Tips

Tips for every day stuff.

Moved

This blog is now over at http://jonathan.dickinsons.
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Wrapping on Specific Characters

Wrap on specfic characters during a S.D.Graphics.DrawString()

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Ternary If Statement in C#

Sometimes you just need a ternary statement, i.e. you don't want to return a value from the condition ? true : false construct. Here is an extension method to help you out (the usage example isn't the best). class Program { static void Main(string[] args) { List<string> test = new List<string>(); ArrayList source = new ArrayList(); source.Add(1); source.Add("hello"); source.Each<object>(x => (x is String).IfElse ( () => test.Add((string)x), () => test.Add(x.ToString())...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Ruby-like each statement in C#

Funny this isn't in the provided Enumerable extension methods. In any case, here it is: internal static void Each<T>(this IEnumerable<T> @this, Action<T> action) { foreach(T t in @this) action(t); } internal static void Each<T>(this IEnumerable @this, Action<T> action) { foreach (object t in @this) if (t is T) { action((T)t); } } An example: objects.Each(x => DoSomethingFunky(x, "some parameter"));...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Using Is.Gd/Bitly/TinyUrl/Facebook Post in Chrome

Put your favorite bookmarklet at your fingertips.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Forcibly Closing a Start Tag with XmlTextWriter

How to get a XmlTextWriter to make one of these bad boys: ">"

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

TFS Build Server 2005 with 2008 Solutions

Better shim for building 2008 projects on TFS Build Server 2005.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Long-Running Webservice Without Polling

Async Webservices: The proper way.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Serialization using XElements

One thing that I found missing was the ability to serialize objects directly into XElements with the new XML LinQ in .Net. I made a small solution to really bring power into the framework.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Configuration Elements

How to make configuration elements support more attributes than you define in code.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Full Tips Archive

«February»
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910