Skip to content

Instantly share code, notes, and snippets.

View coldacid's full-sized avatar
🚩
CHECK YOUR DEPENDENCIES

Chris Charabaruk coldacid

🚩
CHECK YOUR DEPENDENCIES
View GitHub Profile
@coldacid
coldacid / EnumEx.cs
Created January 3, 2013 07:19
GetNames and GetValues for enums in Silverlight. Includes cache of results to avoid wasting time in reflection later on.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
namespace Charabaruk.Utility
{
static class EnumEx
@coldacid
coldacid / ScoreloopAsyncHelper.cs
Created December 22, 2012 03:12
Using the `async`/`await` keywords in C# makes it a lot easier to write asychronous code, which is very important for people working with Windows Phone or Windows 8. These keywords work with the Task Asynchronous Pattern (TAP) which is built around the `System.Threading.Tasks.Task` class, and which has an adaptor, `TaskCompletionSource<>`, for d…
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Scoreloop.CoreSocial.API;
using Scoreloop.CoreSocial.API.Model;
using System.Threading.Tasks;
using ScoreloopGame = Scoreloop.CoreSocial.API.Model.Game;
@coldacid
coldacid / AsyncCompletedEventArgs.cs
Created April 7, 2012 20:46
Generic AsyncCompletedEventArgs class for simple EAP async return values
namespace System.ComponentModel
{
public class AsyncCompletedEventArgs<T> : AsyncCompletedEventArgs
{
private T result;
public AsyncCompletedEventArgs(Exception error, bool cancelled, object userState)
: base(error, cancelled, userState)
{ }