Please see my other C# articles.
Customize .NET with New Behavior
In this article I’ll illustrate how to add a custom function to the .NET Framework which you may use in your C#.
First, define a class a signature of public static.
In that class define a method with at least one parameters with “this” string (or other type).
“this” signals to the .NET Framework and intention to add behavior to that type.
Now, you may extend the .NET Framework in C# by calling the method on that type.