Way back when we were using Visual Studio 2005, there was a Clipboard Ring tab in the Toolbox. I loved that tab! When I am doing a bunch of copy/pastes, I sometimes find that I hit Ctrl+C when I meant to hit Ctrl+V, and poof! my Clipboard was kindly wiped out for me. With VS […]
Unit Testing: Exposing Private Members
Visual Studio 2008 (Professional Edition and above) provides a really nice set of tools for development and execution of unit tests. It is, of course, easy for your tests to access the public properties and methods of your classes. But what about those private members? [To begin with an overview of unit testing, start here.] […]
Unit Testing: Exposing Internal/Friend Members
Visual Studio 2008 (Professional Edition and above) provides a really nice set of tools for development and execution of unit tests. It is, of course, easy for your tests to access the public properties and methods of your classes. But what about those internal/friend members? [To begin with an overview of unit testing, start here.] […]
Unit Testing: Testing Properties
Visual Studio 2008 (Professional Edition and above) provides a really nice set of tools for development and execution of unit tests. This post provides suggestions for testing your property getters and setters. [To begin with an overview of unit testing, start here.] Let’s say your Customer class has a LastName property that looks like this: […]
Unit Testing: Code Coverage
Visual Studio 2008 (Team System ONLY) provides a really nice set of tools for viewing the code coverage of your unit tests. NOTE: While Visual Studio 2008 Professional Edition has tools for building, executing, and debugging unit tests, it does NOT include the code coverage tools. [To begin with an overview of unit testing, start […]
Unit Testing: Execution
Visual Studio 2008 (Professional Edition and above) provides a really nice set of tools for development and execution of unit tests. [To begin with an overview of unit testing, start here.] This prior post demonstrates how to build a unit test using the "Create Unit Tests…" feature of the Code Editor. This post demonstrates how […]
Unit Testing: An Introduction
If you have Visual Studio 2008 or later and have the Professional Edition or better (NOT the Express Editions), you have some very nice unit testing tools within your Visual Studio environment. These tools help you write, execute, and track your unit tests and code coverage. This post provides an introduction to using these tools. […]
Populating a DataGridView from Xml Data
If you are using XML in a WinForms application you may find the need to display the XML data in a DataGridView. Let’s take this XML: <states> <state name="California"> <abbreviation>CA</abbreviation> <year>1850</year> <governor>Schwarzenegger</governor> </state> <state name="Wisconsin"> <abbreviation>WI</abbreviation> <year>1848</year> <governor>Doyle</governor> </state> </states> Displaying XML in a DataGridView […]
Lambda Expressions: Execution
Lambda expressions can be assigned to a delegate variable. The lambda expression is then executed when the delegate is called. [To begin with an overview of lambda expressions, start here.] In the following example, a lambda expression is assigned to a variable (f). In C#: Func<int,string> f = x => (x + x).ToString(); Debug.WriteLine(f(5)); Debug.WriteLine(f(10)); […]
WinForms User Controls 101
The same several questions often come up in the forums regarding the basics of building a user control with VB.NET or C#. The goal of this post is to answer those questions. There are three basic types of WinForms user controls that you can create: Extended control Composite control Custom control Each of these are […]