Search

You searched for the word(s): userid:3392
Page 1 of 11 (110 items) 1 2 3 4 5 Next > ... Last »
  • 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 to execute a unit test. NOTE: This post assumes you have already generated or created at least one unit test. To execute one or more unit tests: 1) Open your
    Posted to Deborah's Developer MindScape (Weblog) by Deborah Kurata on Sun, Oct 25 2009
    Filed under: VB, C#, .NET, CSharp, Testing
  • 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. If you are new to unit testing, the idea is to test the smallest possible units of your code. In most cases, the smallest units of code are the property procedures and
    Posted to Deborah's Developer MindScape (Weblog) by Deborah Kurata on Sun, Oct 25 2009
    Filed under: VB, C#, .NET, CSharp, Testing
  • 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>    
    Posted to Deborah's Developer MindScape (Weblog) by Deborah Kurata on Tue, Oct 20 2009
    Filed under: VB, C#, .NET, CSharp, Xml, LINQ, Binding, WinForms
  • 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)); In VB: Dim f = Function(x as Integer) (x + x).ToString() Debug.WriteLine(f(5)) Debug.WriteLine(f(10)) The lambda expression
    Posted to Deborah's Developer MindScape (Weblog) by Deborah Kurata on Fri, Oct 16 2009
    Filed under: VB, C#, .NET, CSharp, Lambda, Delegate
  • 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 discussed below. Extended Control Use an extended control whenever you want to extend the behavior of one particular control. Say for example that you want to build your own TextBox that
    Posted to Deborah's Developer MindScape (Weblog) by Deborah Kurata on Tue, Oct 13 2009
    Filed under: VB, C#, .NET, CSharp, WinForms
  • Delegates

    A delegate is an object that holds a reference to a method with a particular parameter list and return type. It is basically like an object-oriented, type-safe function pointer. Delegates basically make it possible to treat methods as entities. You can then assign a delegate to a variable or pass it as a parameter. The classic delegate example uses events. In C#: HelloButton.Click += new EventHandler(HelloButton_Click); Or the short-cut version of this code: HelloButton.Click += HelloButton_Click;
    Posted to Deborah's Developer MindScape (Weblog) by Deborah Kurata on Sun, Oct 11 2009
    Filed under: VB, C#, .NET, CSharp, Lambda, Delegate
  • Lambda Expressions: Func Delegates

    A Func delegate encapsulates a method that returns a value. It takes up to four parameters (and this number is increased in .NET 4.0) plus the return value. [To begin with an overview of lambda expressions, start here .] The following signature is a Func delegate that takes two integer parameters and returns a string. In C#: Func<int, int, string> In VB: Func(Of Integer, Integer, String) There are many examples of Func delegates. The following code demonstrates the Sum function that sums the
    Posted to Deborah's Developer MindScape (Weblog) by Deborah Kurata on Sun, Oct 11 2009
    Filed under: VB, C#, .NET, CSharp, Lambda, Delegate
  • Lambda Expressions: Action Delegates

    Just as the name implies, an action delegate encapsulates a method that performs an action and has no return value. It takes up to four parameters (and this number is increased in .NET 4.0). [To begin with an overview of lambda expressions, start here .] The ForEach method of the List<T> is an example of an action delegate. It takes an action delegate as a parameter. One of the common uses of ForEach is to display all of the elements in a list using one line of code. In C#: custList.ForEach
    Posted to Deborah's Developer MindScape (Weblog) by Deborah Kurata on Sun, Oct 11 2009
    Filed under: VB, C#, .NET, CSharp, Lambda, Delegate
  • Lambda Expressions: Predicate Delegates

    According to Wikipedia , a predicate is “a function which returns a Boolean value”. [To begin with an overview of lambda expressions, start here .] A predicate delegate encapsulates a method that evaluates to True or False. It takes a single parameter. The Array class Find method is an example of a predicate delegate. It takes an array as a first parameter and a predicate delegate as its second parameter. In C#: var foundCustomer = Array.Find(custArray, c =>        
    Posted to Deborah's Developer MindScape (Weblog) by Deborah Kurata on Sun, Oct 11 2009
    Filed under: VB, C#, .NET, CSharp, Lambda, Delegate
  • Lambda Expressions: Syntax

    This post covers the syntax for lambda expressions. It uses the customer list defined in this prior post . [To begin with an overview of lambda expressions, start here .] The first example below uses the FirstOrDefault extension method on the Enumerable object to find the first customer that matches the defined expression. The FirstOrDefault method takes a delegate as a parameter and that delegate is defined with a lambda expression. In C#: ' General syntax: Customer foundCustomer =     
    Posted to Deborah's Developer MindScape (Weblog) by Deborah Kurata on Sun, Oct 11 2009
    Filed under: VB, C#, .NET, CSharp, Lambda
Page 1 of 11 (110 items) 1 2 3 4 5 Next > ... Last »