Skip to content

Instantly share code, notes, and snippets.

View robgray's full-sized avatar

Robert Gray robgray

View GitHub Profile
@robgray
robgray / Squares.linqpad
Created December 23, 2020 03:41
C# Linqpad script with classes, to model a problem I was trying to solve.
void Main()
{
new Square(-3,-1).Dump();
}
public class Square
{
public Square(int x, int y)
{
this.x = x;
@robgray
robgray / Enums.cs
Last active November 24, 2015 00:05
Enum helper classes to present enums in a UI friendly manner (e.g. convert MyEnum to "My Enum" instead of the value "MyEnum", that MyEnum.ToString() would return.
using System;
using System.Collections.Generic;
namespace EnumHelpers
{
[AttributeUsage(AttributeTargets.Enum | AttributeTargets.Field, AllowMultiple = false)]
public sealed class EnumDescriptionAttribute : Attribute
{
public string Description { get; private set; }