C# add to class in another DLL -


...is possible?

for example, can add simple function...

public static double deg2rad(double degrees) {     return math.pi / 180 * degrees; } 

...to convert class? (using default..."usings") can call

double radians = convert.deg2rad(123); 

can done? if so, how?

no can't, can add extension method double , call like

double x = 180.0; double y = math.cos( x.deg2rad() ); double z = math.sin( 0.5.pi() ); 

in static class add following extension method:

public static class extensionmethods {     public static double deg2rad(this double angle)     {         return math.pi*angle/180.0;     }      public static double pi(this double x)     {         return math.pi*x;     } } 

Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -