Browse by Tags

Visual Studio 2005 (Whidbey) Beta2 is Here!
Published Mon, Apr 18 2005 20:16 | coad
Whidbey Beta2 is Released! We all (you & MS) have been waiting long for this build! Wow, it is a substantial improvement over Beta1 and the client bits even have a Go Live License. I'm excited! How about you? If you have a MSDN Subscription , you...
Filed under: ,
SerialPort (RS-232 Serial COM Port) in C# .NET
Published Wed, Mar 23 2005 19:28 | coad
This article is about communicating through the PC's Serial COM RS-232 port using Microsoft .NET 2.0 or later by using the System.IO.Ports.SerialPort class.  If you're looking for USB info, see here . Way in the Past... Back in my early ...
Filed under:
Reverse Enum Lookup
Published Tue, Jun 22 2004 1:46 | coad
Sometimes you may have the string name of an enumeration identifier, and want its enum type. For example, you write a enum identifier as a string to a file and want to read it back and obtain the original enumeration type. This takes place when you serialize...
Filed under:
Obtaining Indented XML as a String
Published Tue, Jun 22 2004 0:55 | coad
Using XmlDocument.Save(string file) produces a file with nicely indented elements. XmlDocument.OuterXml returns a string without any formatting. If you want a nicely formatted string (to display to the user, write to console, etc), without directly writing...
Filed under: ,
Creating Quick Tests in C#
Published Fri, Jun 18 2004 2:51 | coad
Update on 5/2/07: This post has nothing to do with Unit Testing (it was written before I was aware of unit testing) but has to do with write little bits of code to try new stuff out. It is also only for VS03. For the current version (VS05), see this post...
Filed under: ,
Property Event Pattern
Published Thu, Jun 17 2004 23:59 | coad
Introduction Since the advent of .NET, one of my most frequent and useful patterns is using an event to notify change in state. Applying this pattern has reduced overall code, improved reliability, and made maintenance and expansion easier. Why? The Context...
Filed under:
Associating a File Extension and Context Menus with an Application in the Registry
Published Fri, Jun 11 2004 16:31 | coad
You can easily assign a file extension to open with your application in the registry. Verbal Description The extension is added as a key under "HKEY_CLASSES_ROOT" with the (default) value set to the file's type (a string arbitrarily assigned by yourself...
Filed under:
Programming Practices Policy v3.0 Released
Published Tue, May 18 2004 21:33 | coad
Now available is a new version of the synopsis of C# coding practices that are being used by the majority of MVPs, professional C# coders, and my associates. These practices are being used by the development community and this is an abbreviation that...
Filed under:
C# Team FAQ Blog
Published Sun, Apr 18 2004 20:37 | coad
The C# team at Microsoft has started a Frequently Asked Questions (FAQ) blog where they answer some interesting topics. Definitely a good read for C# developers. I've found it interesting to see the reasoning behind some of the descriptions made in the...
Filed under:
Two New CoadTools, AdvancedFileProperties & OrderedStringDictionary
Published Sat, Apr 17 2004 22:37 | coad
My protege, Radoslav (Radi) Ivanov (age 16), has published his first code utilitity! It is an “Advanced File Properties“ reader that retrieves the NTFS extended properties of a file. It provides a DataTable wrapped method for an included COM DLL. I created...
Filed under: ,
Assimilate XML RSS Feed from URL in C#
Published Wed, Apr 14 2004 21:46 | coad
This piece of code pulls an RSS feed and displays the title of the articles. It is here to demonstrate just how easy it is to pull XML off the web and utilize the data. I use Trace.WriteLine instead of Console.WriteLine so the report is fed to the Visual...
Filed under: ,
Edit File with Shell Registry Settings
Published Wed, Apr 14 2004 9:37 | coad
This snippet of code looks up the registered editor for the file type passed. If it doesn’t find one, it uses notepad (it was of course designed originally for text files). Notice: See the cascading if statement both assigning and checking for null. private...
Filed under:
Simple C# XSL Transformation
Published Tue, Apr 13 2004 23:06 | coad
“XSLTransform.cs” And here is a simple C# translator that takes an XML file sends it through an XSL file transform and saves the output. It is intended to be used as a console application. This can be easily used to apply the CSV transform XSL to Vocabulary...
Filed under: ,