Skip to content

Instantly share code, notes, and snippets.

View krishnabhargav's full-sized avatar

Krishna Vangapandu krishnabhargav

View GitHub Profile
@krishnabhargav
krishnabhargav / Frequent.cs
Created December 13, 2011 02:10
Frequent class implementation
/// Krishna Vangapandu
public class Frequent : INotifyPropertyChanged
{
private string _property;
private readonly StringMessageThrottler _stringMessageThrottler;
public Frequent()
{
//Create a new message throttler. The implementation for this would be shown later.
_stringMessageThrottler = new StringMessageThrottler();
@krishnabhargav
krishnabhargav / EventThrottlingTest.cs
Created December 13, 2011 01:53
Simple Event Throttling Requirement Expressed as a Test
[TestFixture]
public class TestEventThrottling
{
[Test]
public void EventsAreThrottled()
{
var fq = new Frequent();
int counter = 0;
fq.PropertyChanged += (s, e) => { counter++; };
foreach (var prop in Enumerable.Range(0, 200))
@krishnabhargav
krishnabhargav / HelloWorld.cs
Created December 7, 2011 03:47
C# Hello World
using System;
public static class HelloWorld{
public static void Main(){
Console.WriteLine("Welcome to Gist!");
}
}