patryk_szwed

Service1Part2

May 20th, 2019
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Runtime.Serialization;
  5. using System.ServiceModel;
  6. using System.Text;
  7. using System.Threading;
  8.  
  9. namespace WcfServiceLibrary1
  10. {
  11. [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple)]
  12. // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in both code and config file together.
  13. public class myCCalculator : ICCalculator
  14. {
  15. public ComplexNum addCNum(ComplexNum n1, ComplexNum n2)
  16. {
  17. Console.WriteLine("...called addCNum(...)");
  18. return new ComplexNum(n1.realPart + n2.realPart,
  19. n1.imagPart + n2.imagPart);
  20. }
  21.  
  22. public ComplexNum subtractCNum(ComplexNum n1, ComplexNum n2)
  23. {
  24. Console.WriteLine("...called subtractCNum(...)");
  25. return new ComplexNum(n1.realPart - n2.realPart,
  26. n1.imagPart - n2.imagPart);
  27. }
  28.  
  29. public ComplexNum multiplyCNum(ComplexNum n1, ComplexNum n2)
  30. {
  31. Console.WriteLine("...called multiplyCNum(...)");
  32. return new ComplexNum(n1.realPart * n2.realPart,
  33. n1.imagPart * n2.imagPart);
  34. }
  35.  
  36. public ComplexNum divideCNum(ComplexNum n1, ComplexNum n2)
  37. {
  38. Console.WriteLine("...called divideCNum(...)");
  39. return new ComplexNum(n1.realPart / n2.realPart,
  40. n1.imagPart / n2.imagPart);
  41. }
  42. }
  43. }
Add Comment
Please, Sign In to add comment