using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Tor.Events
{
///
/// A class containing the skeleton structure for processing an event response received from a control connection.
///
internal abstract class Dispatcher
{
private Client client;
private Event currentEvent;
private Events events;
#region Properties
///
/// Gets or sets the client which owns the dispatcher.
///
public Client Client
{
get { return client; }
set { client = value; }
}
///
/// Gets or sets the event being processed by this dispatcher.
///
public Event CurrentEvent
{
get { return currentEvent; }
set { currentEvent = value; }
}
///
/// Gets or sets the event handler object instance.
///
public Events Events
{
get { return events; }
set { events = value; }
}
#endregion
///
/// Dispatches the event, parsing the content of the line and raising the relevant event.
///
/// The line which was received from the control connection.
/// true if the event is parsed and dispatched successfully; otherwise, false.
public abstract bool Dispatch(string line);
}
}