using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Collections.ObjectModel; namespace Tor { /// /// A class containing information regarding an OR connection within the tor service. /// [Serializable] public sealed class ORConnection { private int circuitCount; private int id; private ORReason reason; private ORStatus status; private string target; /// /// Initializes a new instance of the class. /// internal ORConnection() { this.circuitCount = 0; this.id = 0; this.reason = ORReason.None; this.status = ORStatus.None; this.target = ""; } #region Properties /// /// Gets the number of established and pending circuits. /// public int CircuitCount { get { return circuitCount; } internal set { circuitCount = value; } } /// /// Gets the unique identifier of the connection. This value is only provided in version 0.2.5.2-alpha. /// public int ID { get { return id; } internal set { id = value; } } /// /// Gets the reason for an ORStatus.Closed or ORStatus.Failed state. /// public ORReason Reason { get { return reason; } internal set { reason = value; } } /// /// Gets the status of the connection. /// public ORStatus Status { get { return status; } internal set { status = value; } } /// /// Gets the target of the connection. /// public string Target { get { return target; } internal set { target = value; } } #endregion } /// /// A class containing a read-only collection of objects. /// public sealed class ORConnectionCollection : ReadOnlyCollection { /// /// Initializes a new instance of the class. /// /// The list of OR connections. internal ORConnectionCollection(IList list) : base(list) { } } }