Guest User

Untitled

a guest
Jul 11th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. public class A
  2. {
  3. public int AA;
  4. public int AB;
  5.  
  6. public static implicit operator A(B v)
  7. {
  8. A obj = new A
  9. {
  10. AA = (A)v.BA,
  11. AB = 0
  12. };
  13.  
  14. return obj;
  15. }
  16.  
  17. public static explicit operator B(A v)
  18. {
  19. B obj = new B
  20. {
  21. BA = (B)v.AA
  22. };
  23.  
  24. return obj;
  25. }
  26. }
  27.  
  28. public class B
  29. {
  30. public int BA;
  31. }
Add Comment
Please, Sign In to add comment