Files
Hermes/TorControlLibrary/Responses/EventResponse.cs
2022-06-11 16:42:18 -04:00

30 lines
906 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace TorControlLibrary.Responses
{
public class EventResponse
{
public static EventResponse Parse(String line)
{
EventResponse resp = new EventResponse();
string[] parts = line.Split(' ');
Int32 id;
resp.EventType = parts[1];
if (Int32.TryParse(parts[2], out id))
resp.ID = id;
resp.Action = parts[3];
for (int i = 2; i < parts.Length; i++)
resp.EventInformation += parts[i] + ' ';
resp.EventInformation = resp.EventInformation.Trim();
return resp;
}
public String EventType { get; set; }
public String Action { get; set; }
public Int32 ID { get; set; }
public String EventInformation { get; set; }
}
}