This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// 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(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public static class HelloWorld{ | |
public static void Main(){ | |
Console.WriteLine("Welcome to Gist!"); | |
} | |
} |
NewerOlder