Skip to content

Instantly share code, notes, and snippets.

View evilz's full-sized avatar
🏠
F# F# F#

Vincent B. evilz

🏠
F# F# F#
View GitHub Profile
@evilz
evilz / ArrayDeconstructionExtensions.cs
Created February 25, 2021 08:53 — forked from waf/ArrayDeconstructionExtensions.cs
Add deconstruction (i.e. destructuring) syntax support for arrays for C# 7
using System;
using System.Linq;
namespace Extensions
{
/// <summary>
/// Allow the up to the first eight elements of an array to take part in C# 7's destructuring syntax.
/// </summary>
/// <example>
/// (int first, _, int middle, _, int[] rest) = new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
// The form
let form = new Form(Visible = true, Text = "Data grid #1",
TopMost = true, Size = Drawing.Size(600,600))
// The grid
let data = new DataGridView(Dock = DockStyle.Fill, Text = "Data grid",
Font = new Drawing.Font("Lucida Console", 10.0f),
ForeColor = Drawing.Color.DarkBlue)
form.Controls.Add(data)