Archive

Posts Tagged ‘MSDN’

Convert Enum to String / String to Enum

October 15th, 2009 1 comment

I found this today. I need to convert an enumeration into a string list to populate a combobox. I had been looking at converters to do the heavy lifting, but realized that I should do the work in the ViewModel. That simplifies the XAML a bit. While I was typing out code to read the enum values from the settings file Resharper showed me a choice… I could use my custom converter or use the one in the Component Model. Well, I’d rather use the framework solution over a custom solution any day. If nothing else it’s less to test.

Here’s an example from MSDN:

  using System.ComponentModel;

  Enum myServer= Servers.Exchange;
  string myServerString = "BizTalk";
  Console.WriteLine(TypeDescriptor.GetConverter(myServer).ConvertTo(myServer, typeof(string)));
  Console.WriteLine(TypeDescriptor.GetConverter(myServer).ConvertFrom(myServerString));

Enjoy,

References:

MSDN EnumConverter Class
http://msdn.microsoft.com/en-us/library/system.componentmodel.enumconverter.aspx

Tags: , , , ,

Crap. <sigh>

August 6th, 2009 Comments off

Win 7 Ultimate downloaded.

“So what’s the difference between Ultimate and Enterprise?”
“The license key.”
“So I should be using Enterprise for my domain attached development workstation?”
“Yes.”
“Crap. <sigh> It only took 6 hours to download Ultimate…”

Instead of eating lunch, I picked up hardware to build up a new development workstation. I think I know what I’m doing tonight when I get home. I guess I’ll load Ultimate and see what’s what before I worry about the Enterprise issue.

Tags: ,

Dropped

August 6th, 2009 Comments off

Windows 7 is available on MSDN. Let the downloading begin!

MSDN RSS Feeds

July 6th, 2009 Comments off

I used to subscribe to Sara Ford’s Visual Studio Tip of the Day RSS feed. She stopped that series after 350-some odd tips. I am less interested in her current work within CodePlex. This morning, I realized I hadn’t actually read any of her posts in weeks even though that is my start-up page in Visual Studio. So what should I be looking at? What are the big MSDN feeds that I actually care about? I found a short list of feeds (below). I ended up subscribing to the Visual C# feed. Safe. Boring. We’ll see how it goes. I’m half-way tempted to write my own aggregator, but the sloth factor is a bit too high today. Plus, I have 3 other “real” projects waiting in the queue.

One thing high on my “need to learn” list is printing. Coming from a Web background, I have never needed to print things. The browser handled all of that. Throw in a printer targeted CSS (if needed) and that’s it. In WinForms is takes a bit more effort. So I’m reading through the chapters on Graphics in my Essential C# book. I find it interesting that neither my C# Cookbook or my Programming C# books contain any information on printing. Hmm…

Here are those feeds.

http://msdn.microsoft.com/rss.xml

http://msdn.microsoft.com/netframework/rss.xml

http://msdn.microsoft.com/security/rss.xml

http://msdn.microsoft.com/vbasic/rss.xml

http://msdn.microsoft.com/vcsharp/rss.xml

http://msdn.microsoft.com/visualc/rss.xml

http://msdn.microsoft.com/vstudio/rss.xml

http://msdn.microsoft.com/webservices/rss.xml