With C # 3.0, I know that you can increase the methods using 'this' naming.
I am trying to expand the monastery to include my new class. Cos (double radians) I know that I can only make "cos" method in my current class, but I am very interested in seeing how this can be done for practice.
After trying something new things, I'm returning to SO to get input. I'm stuck
I have this thing here ...
Public class EngMath {/// ---------------- --------------------------------------------- ----- Increase the Math Library to include the objects --------- /// EngVar objects. /// ----------------------------------------------- ---------------------------- Public static EngVar Abs (this math, EngVar A) {EngVar C = A. Clone (); C.CoreValue = Math.Abs (Sikorview); Return c; } Public static EngVar Cos (this math, EngVar A) {EngVar C = A. Clone (); Double conversion = 1; // Just modify the value Do not modify the exponents on all // Is there a degree? If so, change it in radians. If (AISDGraze) conversion = 180 / math; PI; C.CoreValue = Math Kos (A Corview * conversion); // If there is a degree, change back to degrees. C.CoreValue * = Conversion; Return c; } ...
extension methods are a way to express your static methods. In the other words, they need to type "extension" on some methods, you need an instance of something to use the extension method feature.
This is a sound for me that you are trying to make Math in the opposite manner about it. COS handle your type In that situation, I am afraid that you have to implement your own functionality if you are not trying to do so, please clarify.
Comments
Post a Comment