Exemple #1
0
        static void Main(string[] args)
        {
            MyRectangle rect = new MyRectangle()
            {
                Width = 5, Height = 60
            };

            (int x, int y) = rect;

            Console.WriteLine($"{x} -- {y}");

            Console.ReadLine();
        }
 public static void Deconstruct(this MyRectangle rect, out int width, out int height)
 {
     width  = rect.Width;
     height = rect.Height;
 }