Advertisement
patryk_szwed

IService1Part2

May 20th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 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.  
  8. namespace WcfServiceLibrary1
  9. {
  10. // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
  11. [ServiceContract]
  12. public interface ICCalculator
  13. {
  14. [OperationContract]
  15. ComplexNum addCNum(ComplexNum n1, ComplexNum n2);
  16.  
  17. [OperationContract]
  18. ComplexNum subtractCNum(ComplexNum n1, ComplexNum n2);
  19.  
  20. [OperationContract]
  21. ComplexNum multiplyCNum(ComplexNum n1, ComplexNum n2);
  22.  
  23. [OperationContract]
  24. ComplexNum divideCNum(ComplexNum n1, ComplexNum n2);
  25. }
  26.  
  27. [DataContract]
  28. public class ComplexNum
  29. {
  30. private string desc = "Complex number";
  31.  
  32. [DataMember] public double realPart;
  33. [DataMember] public double imagPart;
  34.  
  35. [DataMember]
  36. public string Desc
  37. {
  38. get
  39. {
  40. return desc;
  41.  
  42. }
  43. set { desc = value; }
  44. }
  45.  
  46. public ComplexNum(double rp, double ip)
  47. {
  48. this.realPart = rp;
  49. this.imagPart = ip;
  50. }
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement