-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathStreamDispatcher.cs
More file actions
36 lines (31 loc) · 1.03 KB
/
StreamDispatcher.cs
File metadata and controls
36 lines (31 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Tor.Events
{
/// <summary>
/// A class containing the logic for processing a stream-status event.
/// </summary>
[EventAssoc(Event.Streams)]
internal sealed class StreamDispatcher : Dispatcher
{
#region Tor.Events.Dispatcher
/// <summary>
/// Dispatches the event, parsing the content of the line and raising the relevant event.
/// </summary>
/// <param name="line">The line which was received from the control connection.</param>
/// <returns>
/// <c>true</c> if the event is parsed and dispatched successfully; otherwise, <c>false</c>.
/// </returns>
public override bool Dispatch(string line)
{
Stream stream = Stream.FromLine(Client, line);
if (stream == null)
return false;
Events.OnStreamChanged(new StreamEventArgs(stream));
return true;
}
#endregion
}
}