Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/AlexBHarley/eeNet
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex committed Apr 19, 2016
2 parents 9d909c8 + 016a8c3 commit b976290
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## eeNet
![Build Status](https://ci.appveyor.com/api/projects/status/github/alexbharley/eeNet?branch=master&svg=true)

#### Node.js style events in C\#

```C#
class Client
{
private EventEmitter _ee;

public Client()
{
this._ee = new EventEmitter();
}

public void PushDataToServer(string data)
{
this._ee.On("data_received", LogData);
this._ee.On("data_received", SendToBus);
}

public void ReceiveData(List<string> dataList)
{
this._ee.Emit("data_received", dataList);
this._ee.RemoveListener("data_received", LogData);
}

public void LogData(object data)
{
//Log and store data
}

public void SendToBus(object data)
{
//Send data somewhere interesting
}
}
```


0 comments on commit b976290

Please sign in to comment.