BlackWaspTM

This web site uses cookies. By using the site you accept the cookie policy.This message is for compliance with the UK ICO law.

<< Previous | 1 | 2 | 3 | 4 | 5 | 6 | 7 | Next >> |
The Generic EventHandler DelegateThe Generic EventHandler Delegate
In .NET 1.1, creating a custom event with event arguments often included the declaration of a new delegate. In .NET 2.0 and with the introduction of generics, the process is simplified with the standard EventHandler<T> delegate.
Capturing the Standard Output of a ProcessCapturing the Standard Output of a Process
Rather than recreating some functionality, it can be easier to launch existing processes. When a program can output textual information and error details, the software launching the process can subscribe to events and capture that information.
A Reusable INotifyPropertyChanged Extension MethodA Reusable INotifyPropertyChanged Extension Method
The INotifyPropertyChanged interface is applied to classes that need to create notifications when their property values are updated. One problem with the usual manner of implementing the interface is the use of literal strings to specify property names.
Obtaining Caller InformationObtaining Caller Information
When using the .NET framework version 4.5, it is possible to obtain information about the caller of a method without using a stack trace. This is achieved by decorating method parameters with one of three new caller information attributes.
Weak References in .NET 4.5Weak References in .NET 4.5
The WeakReference class provides a way to create weakly referenced objects that may be released by the garbage collector when memory pressure is high. An improved, generic version of this class was introduced in the .NET framework version 4.5.
Weak ReferencesWeak References
.NET objects are held in memory, within in the managed heap, until all references are released and the garbage collector removes them. Weak references provide an alternative type of object reference, which may be garbage collected whilst still active.
Waiting for a Process to ExitWaiting for a Process to Exit
.NET applications sometimes need to work with external processes. In some cases it is necessary to wait for those processes to generate results and exit before the .NET software continues executing. Waiting in this way is possible using the Process class.
Forcing Garbage CollectionForcing Garbage Collection
The garbage collector controls memory management automatically, deallocating memory used by unreachable objects periodically but unpredictably. In some situations it can be useful to force an immediate complete or partial garbage collection.
.NET Garbage Collection.NET Garbage Collection
Developers of managed software using the .NET framework do not need to deallocate the memory used by objects when they go out of scope, reducing the risk of creating bugs that cause memory leaks. Release of memory is controlled by the garbage collector.
Obtaining a Stack TraceObtaining a Stack Trace
Call stacks are used to control the flow of programs as methods and properties are executed and terminated. When adding diagnostic code, such as logging, to software it can be useful to examine the call stack for a thread or exception using a stack trace.
<< Previous | 1 | 2 | 3 | 4 | 5 | 6 | 7 | Next >> |