.Net 3.0 Episodes

# 158 Exploring Operator Overloading in C#


Level: Intermediate

Author: Derik Whittaker

Tags: .Net 3.0 Dot Net

Views: (2766) Watched: (3036)

In this episode we are going to take a look at how create overloaded operators for your objects.

perator overloading permits user-defined operator implementations to be specified for operations where one or both of the operands are of a user-defined class or struct type. When creating your own operators there are many different operators which can be overloaded.

+, -, *, /, %, &, |, <<, >> All C# binary operators can be overloaded
+, -, !, ~, ++, –, true, false All C# unary operators can be overloaded
==, !=, <, >, <= , >= All relational operators can be overloaded, but only as pairs.

# 14 Exploring Extension Methods in C# 3.0


Level: Beginner

Author: Derik Whittaker

Tags: .Net 3.0

Views: (3725) Watched: (3060)

In this episode we will be exploring a new feature in C# 3.0/.Net 3.5 called Extension Methods.

Extension Methods are a way to allow a developer to extend an object (add new methods) without having to subclass or recompile that object.