Skip to content

Instantly share code, notes, and snippets.

Steve Dunn SteveDunn

View GitHub Profile
View gist:a87d72e0180bf5dd4222ed26d01b7e86
void onCanvasDraw(ICanvasAnimatedControl sender, CanvasAnimatedDrawEventArgs args)
{
args.DrawingSession.Transform = _scale;
args.DrawingSession.Clear(Colors.Aquamarine);
using (var offscreenSession = _offscreenCanvas.CreateDrawingSession())
{
offscreenSession.Clear(Colors.Aquamarine);
View gist:83068c733104d9742f7e
choco install chocolatey
choco install googlechrome
choco install 7zip
choco install vlc
choco install sublimetext3
choco install paint.net
choco install tortoisesvn
choco install VirtualCloneDrive
choco install FoxitReader
choco install beyondcompare
@SteveDunn
SteveDunn / Guard.cs
Created Feb 7, 2012
A utility class to validate parameters (add to your projects as a linked file)
View Guard.cs
using System;
using System.Collections ;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis ;
using System.Linq ;
using JetBrains.Annotations ;
// PLEASE DON'T MAKE ANYTHING PUBLIC IN THIS FILE. THIS FILE (AND JETBRAINS.ANNOTATIONS) IS INTENDED
// TO BE INCLUDED AS A LINKED FILE INTO WHATEVER PROJECTS NEEDS THEM.
@SteveDunn
SteveDunn / EnumMapper.cs
Created Aug 17, 2011
Enum Mapper in C#
View EnumMapper.cs
public class EnumMapper : IDisposable
{
readonly Dictionary<Type, Dictionary<string, object>> _stringsToEnums =
new Dictionary<Type, Dictionary<string, object>>( ) ;
readonly Dictionary<Type, Dictionary<int, string>> _enumNumbersToStrings =
new Dictionary<Type, Dictionary<int, string>>( ) ;
readonly ReaderWriterLockSlim _lock = new ReaderWriterLockSlim( ) ;
You can’t perform that action at this time.