Guest User

Untitled

a guest
Jun 20th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. static string M1(Shape shape)
  2. {
  3. switch (shape)
  4. {
  5. case Shape s when s.Size.height > 100:
  6. return $"large shape with size {s.Size} at position {s.Position}";
  7. case Ellipse e:
  8. return $"Ellipse with size {e.Size} at position {e.Position}";
  9. case Rectangle r:
  10. return $"Rectangle with size {r.Size} at position {r.Position}";
  11. default:
  12. return "another shape";
  13. }
  14. }
Add Comment
Please, Sign In to add comment