BlackWasp
C# Anonymous MethodsC# Anonymous Methods
C# allows the declaration of delegates. These hold method references that may be changed at run-time and are essential for creating events. It is often the case that the delegate is never changed. In these cases, anonymous methods can simplify code.
C# Anonymous TypesC# Anonymous Types
A new feature of C# 3.0 is the ability to create anonymous types. These interesting classes are defined for temporary use within class members. They allow the convenient encapsulation of read-only properties without the need to code a complete class.
C# Implicitly Typed VariablesC# Implicitly Typed Variables
C# 3.0 introduced the concept of implicitly typed local variables. These are compiled in exactly the same manner as their explicitly typed counterparts, except that the compiler automatically determines the variable type according to its usage.
C# Checked and Unchecked ArithmeticC# Checked and Unchecked Arithmetic
Arithmetic operations are limited to some extent by the type of variable being acted upon. In some cases, values can exceed their data type limits and provide incorrect, and potentially dangerous answers. This is prevented by using checked arithmetic.
C# Automatically Implemented PropertiesC# Automatically Implemented Properties
Often a class may contain properties that provide no behaviour other that permitting the storage of values. This can lead to many space-consuming lines of code for get and set accessors. Using .NET 3.0, these can be replaced with automatic properties.
C# StructuresC# Structures
The twenty-second, and final, part of the C# Object-Oriented Programming tutorial reviews the use of structures. Structures provide similar functionality to classes but when instantiated, resultant variables are value types, rather than reference types.
C# Value Types and Reference TypesC# Value Types and Reference Types
C# permits the use of value types, such as enumerations and structures, and reference types, such as objects instantiated from classes. Value types hold their data directly and can be easily copied. Reference types add a layer of indirection.
C# InterfacesC# Interfaces
The twenty-first part of the C# Object-Oriented Programming tutorial completes the investigation of polymorphism in the C# programming language. This instalment describes the use of interfaces to determine required members in classes that implement them.
C# Abstract ClassesC# Abstract Classes
The twentieth part of the C# Object-Oriented Programming tutorial investigates the use of abstract classes. These are special classes that are designed to be used only as base classes for inheritance. They do not permit the instantiation of objects.
Trimming Non-Whitespace Characters from StringsTrimming Non-Whitespace Characters from Strings
Often string data is received through a user interface or integration system. This data may include additional characters to the main information, either as a prefix or suffix. Using the String class' Trim method, these unwanted characters can be removed.

Older Articles

RSS RSS Feed
49 users on-line