/
aprogrammer
/
dotnet-docs
Обзор
Документация
Войти
/
aprogrammer
/
dotnet-docs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
VS2017
samples/csharp/PatternMatching/Shapes.cs
53 строки
1005 B
Bill Wagner
Update pattern matching to fix a couple small issues (#1612)
06 мар 2017, 23:45
06 мар 2017, 23:45
d970e86
Код
Авторство
О чём код?
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace PatternMatching { #region 01_ShapeDefinitions public class Square { public double Side { get; } public Square(double side) { Side = side; } } public class Circle { public double Radius { get; } public Circle(double radius) { Radius = radius; } } public struct Rectangle { public double Length { get; } public double Height { get; } public Rectangle(double length, double height) { Length = length; Height = height; } } public struct Triangle { public double Base { get; } public double Height { get; } public Triangle(double @base, double height) { Base = @base; Height = height; } } #endregion }