Enums
A dive into enumeration types, commonly known as enums.
A dive into enumeration types, commonly known as enums.
Abstract classes and interfaces can be used for similar purposes but it's important to understand the differences between the two.
One technique I like to employ when reviewing code is to avoid the word "you" and its derivatives.
If you want to support cancellation in C#, you'll want to get familiar with the CancellationTokenSource and CancellationToken types.
Structs in C# are value types and thus are meant for holding data structures that are usually immutable. If you're going to write a struct, consider the following practices.