Class CandidateStats
Candidate stats.
Implements
Inherited Members
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public class CandidateStats : BaseStats, IEquivalent<CandidateStats>
Constructors
CandidateStats()
Initializes a new instance of the Candidate
Declaration
public CandidateStats()
Properties
IPAddress
Gets the IP address.
Declaration
public string IPAddress { get; }
Property Value
Type | Description |
---|---|
System. |
IsHost
Gets whether the candidate is host/local.
Declaration
public bool IsHost { get; }
Property Value
Type | Description |
---|---|
System. |
IsReflexive
Gets whether the candidate is reflexive.
Declaration
public bool IsReflexive { get; }
Property Value
Type | Description |
---|---|
System. |
IsRelayed
Gets whether the candidate is relayed.
Declaration
public bool IsRelayed { get; }
Property Value
Type | Description |
---|---|
System. |
Port
Gets the port.
Declaration
public int Port { get; }
Property Value
Type | Description |
---|---|
System. |
Priority
Gets the priority.
Declaration
public long Priority { get; }
Property Value
Type | Description |
---|---|
System. |
Protocol
Gets the protocol.
Declaration
public ProtocolType Protocol { get; }
Property Value
Type | Description |
---|---|
Protocol |
RelatedIPAddress
Gets the related IP address.
Declaration
public string RelatedIPAddress { get; }
Property Value
Type | Description |
---|---|
System. |
RelatedPort
Gets the related port.
Declaration
public int RelatedPort { get; }
Property Value
Type | Description |
---|---|
System. |
RelayProtocol
Gets the relay protocol.
Declaration
public ProtocolType RelayProtocol { get; }
Property Value
Type | Description |
---|---|
Protocol |
TurnProtocol
Gets the relay protocol.
Declaration
[Obsolete("Use RelayProtocol instead.")]
public ProtocolType TurnProtocol { get; }
Property Value
Type | Description |
---|---|
Protocol |
Type
Gets the type.
Declaration
public CandidateType Type { get; }
Property Value
Type | Description |
---|---|
Candidate |
Methods
DeserializeProperties(String, String)
Deserializes the properties.
Declaration
protected override void DeserializeProperties(string key, string valueJson)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | The key. |
System. |
valueJson | The value in JSON format. |
Overrides
FromJson(String)
Derializes candidate stats from JSON.
Declaration
public static CandidateStats FromJson(string candidateJson)
Parameters
Type | Name | Description |
---|---|---|
System. |
candidateJson | The candidate's stats JSON. |
Returns
Type | Description |
---|---|
Candidate |
FromJsonArray(String)
Derializes an array of candidate stats from JSON.
Declaration
public static CandidateStats[] FromJsonArray(string candidatesJson)
Parameters
Type | Name | Description |
---|---|---|
System. |
candidatesJson | The candidates' stats JSON. |
Returns
Type | Description |
---|---|
Candidate |
IsEquivalent(CandidateStats)
Checks if a candidate is equivalent to this one.
Declaration
public bool IsEquivalent(CandidateStats instance)
Parameters
Type | Name | Description |
---|---|---|
Candidate |
instance | The candidate. |
Returns
Type | Description |
---|---|
System. |
SerializeProperties(Dictionary<String, String>)
Serializes the properties.
Declaration
protected override void SerializeProperties(Dictionary<string, string> jsonObject)
Parameters
Type | Name | Description |
---|---|---|
System. |
jsonObject | The JSON object. |
Overrides
ToJson()
Serializes this to JSON.
Declaration
public string ToJson()
Returns
Type | Description |
---|---|
System. |
ToJson(CandidateStats)
Serializes candidate stats to JSON.
Declaration
public static string ToJson(CandidateStats candidate)
Parameters
Type | Name | Description |
---|---|---|
Candidate |
candidate | The candidate's stats. |
Returns
Type | Description |
---|---|
System. |
ToJsonArray(CandidateStats[])
Serializes an array of candidate stats to JSON.
Declaration
public static string ToJsonArray(CandidateStats[] candidates)
Parameters
Type | Name | Description |
---|---|---|
Candidate |
candidates | The candidates' stats. |
Returns
Type | Description |
---|---|
System. |