BlackWaspTM
<< Previous | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Next >> |
C# Static Field Initialisation OrderC# Static Field Initialisation Order
Static fields can be used to hold information that is made available by, or used within, a class without requiring that an instance of that type is created. When initialising static fields, care must be taken that values are applied in the correct order.
C# Sizeof KeywordC# Sizeof Keyword
In some situations it is necessary to know the size of a value type, such as a built-in numeric data type or a custom structure. The number in bytes can be looked up or calculated, or the sizeof keyword can be used to automatically obtain the size.
C# Volatile FieldsC# Volatile Fields
Optimisation techniques used when compiling or running software that uses the .NET framework can lead to unexpected results. One situation that causes problems is performing non-volatile reads of fields in multithreading or parallel programming scenarios.
C# Defining Preprocessor SymbolsC# Defining Preprocessor Symbols
In C#, preprocessor symbols can be defined or undefined in code or during compilation. With the use of the #if preprocessor directive, they determine which parts of the code are compiled and which are excluded from the final assemblies.
C# Conditional Preprocessor DirectivesC# Conditional Preprocessor Directives
The C# Preprocessor directives allow the code of a project to be changed at compile time depending upon whether symbols have, or have not, been defined. This article describes the use of the conditional preprocessor directives.
C# Interface EventsC# Interface Events
An interface can be created to define a contract containing members that classes that implement it must provide. Interfaces can define events, sometimes leading to classes that implement several interfaces being required to declare an event name twice.
C# Dynamic TypeC# Dynamic Type
It is common for C# applications to interoperate with other languages and frameworks, including dynamic languages such as Python or Ruby. As the typing systems are fundamentally different, C# 4.0 introduces the dynamic type to simplify integration.
Suppressing C# Compiler WarningsSuppressing C# Compiler Warnings
The C# compiler can generate warnings to indicate possible problems with source code that do not prevent compilation. In some circumstances warnings are expected and may be ignored. In such situations, individual types of warning can be suppressed.
C# Named ParametersC# Named Parameters
With the introduction of C# 4.0, named parameters have been included in the language. Named parameters can be used to enhance the readability of source code and simplify some calls by specifying which parameters the argument values refer to.
C# Optional ParametersC# Optional Parameters
C# 4.0 introduces optional parameters to the language for methods, constructors, indexers and delegates. Optional arguments can be defined within a member's signatures but omitted from calls to that member, in which case a default value is used instead.
<< Previous | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Next >> |