mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-12 11:15:08 +00:00
docs: add XML documentation to PepperDash.Core project
Co-authored-by: andrew-welker <1765622+andrew-welker@users.noreply.github.com>
This commit is contained in:
@@ -59,6 +59,9 @@ namespace PepperDash.Core.Intersystem.Tokens
|
||||
/// </summary>
|
||||
/// <param name="offset"></param>
|
||||
/// <returns></returns>
|
||||
/// <summary>
|
||||
/// GetTokenWithOffset method
|
||||
/// </summary>
|
||||
public override XSigToken GetTokenWithOffset(int offset)
|
||||
{
|
||||
if (offset == 0) return this;
|
||||
@@ -69,6 +72,9 @@ namespace PepperDash.Core.Intersystem.Tokens
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <summary>
|
||||
/// ToString method
|
||||
/// </summary>
|
||||
public override string ToString()
|
||||
{
|
||||
return Index + " = 0x" + Value.ToString("X4");
|
||||
@@ -80,6 +86,9 @@ namespace PepperDash.Core.Intersystem.Tokens
|
||||
/// <param name="format"></param>
|
||||
/// <param name="formatProvider"></param>
|
||||
/// <returns></returns>
|
||||
/// <summary>
|
||||
/// ToString method
|
||||
/// </summary>
|
||||
public string ToString(string format, IFormatProvider formatProvider)
|
||||
{
|
||||
return Value.ToString(format, formatProvider);
|
||||
|
||||
@@ -57,6 +57,9 @@ namespace PepperDash.Core.Intersystem.Tokens
|
||||
/// </summary>
|
||||
/// <param name="offset"></param>
|
||||
/// <returns></returns>
|
||||
/// <summary>
|
||||
/// GetTokenWithOffset method
|
||||
/// </summary>
|
||||
public override XSigToken GetTokenWithOffset(int offset)
|
||||
{
|
||||
if (offset == 0) return this;
|
||||
@@ -67,6 +70,9 @@ namespace PepperDash.Core.Intersystem.Tokens
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <summary>
|
||||
/// ToString method
|
||||
/// </summary>
|
||||
public override string ToString()
|
||||
{
|
||||
return Index + " = " + (Value ? "High" : "Low");
|
||||
@@ -77,6 +83,9 @@ namespace PepperDash.Core.Intersystem.Tokens
|
||||
/// </summary>
|
||||
/// <param name="formatProvider"></param>
|
||||
/// <returns></returns>
|
||||
/// <summary>
|
||||
/// ToString method
|
||||
/// </summary>
|
||||
public string ToString(IFormatProvider formatProvider)
|
||||
{
|
||||
return Value.ToString(formatProvider);
|
||||
|
||||
@@ -63,6 +63,9 @@ namespace PepperDash.Core.Intersystem.Tokens
|
||||
/// </summary>
|
||||
/// <param name="offset"></param>
|
||||
/// <returns></returns>
|
||||
/// <summary>
|
||||
/// GetTokenWithOffset method
|
||||
/// </summary>
|
||||
public override XSigToken GetTokenWithOffset(int offset)
|
||||
{
|
||||
if (offset == 0) return this;
|
||||
@@ -73,6 +76,9 @@ namespace PepperDash.Core.Intersystem.Tokens
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <summary>
|
||||
/// ToString method
|
||||
/// </summary>
|
||||
public override string ToString()
|
||||
{
|
||||
return Index + " = \"" + Value + "\"";
|
||||
|
||||
@@ -52,6 +52,9 @@ namespace PepperDash.Core.Intersystem
|
||||
/// </summary>
|
||||
/// <param name="xSigSerialization">XSig state resolver.</param>
|
||||
/// <returns>Bytes in XSig format for each token within the state representation.</returns>
|
||||
/// <summary>
|
||||
/// GetBytes method
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(IXSigSerialization xSigSerialization)
|
||||
{
|
||||
return GetBytes(xSigSerialization, 0);
|
||||
@@ -63,6 +66,9 @@ namespace PepperDash.Core.Intersystem
|
||||
/// <param name="xSigSerialization">XSig state resolver.</param>
|
||||
/// <param name="offset">Offset to which the data will be aligned.</param>
|
||||
/// <returns>Bytes in XSig format for each token within the state representation.</returns>
|
||||
/// <summary>
|
||||
/// GetBytes method
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(IXSigSerialization xSigSerialization, int offset)
|
||||
{
|
||||
var tokens = xSigSerialization.Serialize();
|
||||
@@ -82,6 +88,9 @@ namespace PepperDash.Core.Intersystem
|
||||
/// <param name="index">1-based digital index</param>
|
||||
/// <param name="value">Digital data to be encoded</param>
|
||||
/// <returns>Bytes in XSig format for digtial information.</returns>
|
||||
/// <summary>
|
||||
/// GetBytes method
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(int index, bool value)
|
||||
{
|
||||
return GetBytes(index, 0, value);
|
||||
@@ -94,6 +103,9 @@ namespace PepperDash.Core.Intersystem
|
||||
/// <param name="offset">Index offset.</param>
|
||||
/// <param name="value">Digital data to be encoded</param>
|
||||
/// <returns>Bytes in XSig format for digtial information.</returns>
|
||||
/// <summary>
|
||||
/// GetBytes method
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(int index, int offset, bool value)
|
||||
{
|
||||
return new XSigDigitalToken(index + offset, value).GetBytes();
|
||||
@@ -105,6 +117,9 @@ namespace PepperDash.Core.Intersystem
|
||||
/// <param name="startIndex">Starting index of the sequence.</param>
|
||||
/// <param name="values">Digital signal value array.</param>
|
||||
/// <returns>Byte sequence in XSig format for digital signal information.</returns>
|
||||
/// <summary>
|
||||
/// GetBytes method
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(int startIndex, bool[] values)
|
||||
{
|
||||
return GetBytes(startIndex, 0, values);
|
||||
@@ -117,6 +132,9 @@ namespace PepperDash.Core.Intersystem
|
||||
/// <param name="offset">Index offset.</param>
|
||||
/// <param name="values">Digital signal value array.</param>
|
||||
/// <returns>Byte sequence in XSig format for digital signal information.</returns>
|
||||
/// <summary>
|
||||
/// GetBytes method
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(int startIndex, int offset, bool[] values)
|
||||
{
|
||||
// Digital XSig data is 2 bytes per value
|
||||
@@ -134,6 +152,9 @@ namespace PepperDash.Core.Intersystem
|
||||
/// <param name="index">1-based analog index</param>
|
||||
/// <param name="value">Analog data to be encoded</param>
|
||||
/// <returns>Bytes in XSig format for analog signal information.</returns>
|
||||
/// <summary>
|
||||
/// GetBytes method
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(int index, ushort value)
|
||||
{
|
||||
return GetBytes(index, 0, value);
|
||||
@@ -146,6 +167,9 @@ namespace PepperDash.Core.Intersystem
|
||||
/// <param name="offset">Index offset.</param>
|
||||
/// <param name="value">Analog data to be encoded</param>
|
||||
/// <returns>Bytes in XSig format for analog signal information.</returns>
|
||||
/// <summary>
|
||||
/// GetBytes method
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(int index, int offset, ushort value)
|
||||
{
|
||||
return new XSigAnalogToken(index + offset, value).GetBytes();
|
||||
@@ -157,6 +181,9 @@ namespace PepperDash.Core.Intersystem
|
||||
/// <param name="startIndex">Starting index of the sequence.</param>
|
||||
/// <param name="values">Analog signal value array.</param>
|
||||
/// <returns>Byte sequence in XSig format for analog signal information.</returns>
|
||||
/// <summary>
|
||||
/// GetBytes method
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(int startIndex, ushort[] values)
|
||||
{
|
||||
return GetBytes(startIndex, 0, values);
|
||||
@@ -169,6 +196,9 @@ namespace PepperDash.Core.Intersystem
|
||||
/// <param name="offset">Index offset.</param>
|
||||
/// <param name="values">Analog signal value array.</param>
|
||||
/// <returns>Byte sequence in XSig format for analog signal information.</returns>
|
||||
/// <summary>
|
||||
/// GetBytes method
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(int startIndex, int offset, ushort[] values)
|
||||
{
|
||||
// Analog XSig data is 4 bytes per value
|
||||
@@ -186,6 +216,9 @@ namespace PepperDash.Core.Intersystem
|
||||
/// <param name="index">1-based serial index</param>
|
||||
/// <param name="value">Serial data to be encoded</param>
|
||||
/// <returns>Bytes in XSig format for serial signal information.</returns>
|
||||
/// <summary>
|
||||
/// GetBytes method
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(int index, string value)
|
||||
{
|
||||
return GetBytes(index, 0, value);
|
||||
@@ -198,6 +231,9 @@ namespace PepperDash.Core.Intersystem
|
||||
/// <param name="offset">Index offset.</param>
|
||||
/// <param name="value">Serial data to be encoded</param>
|
||||
/// <returns>Bytes in XSig format for serial signal information.</returns>
|
||||
/// <summary>
|
||||
/// GetBytes method
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(int index, int offset, string value)
|
||||
{
|
||||
return new XSigSerialToken(index + offset, value).GetBytes();
|
||||
@@ -209,6 +245,9 @@ namespace PepperDash.Core.Intersystem
|
||||
/// <param name="startIndex">Starting index of the sequence.</param>
|
||||
/// <param name="values">Serial signal value array.</param>
|
||||
/// <returns>Byte sequence in XSig format for serial signal information.</returns>
|
||||
/// <summary>
|
||||
/// GetBytes method
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(int startIndex, string[] values)
|
||||
{
|
||||
return GetBytes(startIndex, 0, values);
|
||||
@@ -221,6 +260,9 @@ namespace PepperDash.Core.Intersystem
|
||||
/// <param name="offset">Index offset.</param>
|
||||
/// <param name="values">Serial signal value array.</param>
|
||||
/// <returns>Byte sequence in XSig format for serial signal information.</returns>
|
||||
/// <summary>
|
||||
/// GetBytes method
|
||||
/// </summary>
|
||||
public static byte[] GetBytes(int startIndex, int offset, string[] values)
|
||||
{
|
||||
// Serial XSig data is not fixed-length like the other formats
|
||||
|
||||
@@ -48,6 +48,9 @@ namespace PepperDash.Core.Intersystem
|
||||
/// <param name="stream">Input stream</param>
|
||||
/// <param name="value">Result</param>
|
||||
/// <returns>True if successful, otherwise false.</returns>
|
||||
/// <summary>
|
||||
/// TryReadUInt16BE method
|
||||
/// </summary>
|
||||
public static bool TryReadUInt16BE(Stream stream, out ushort value)
|
||||
{
|
||||
value = 0;
|
||||
@@ -65,6 +68,9 @@ namespace PepperDash.Core.Intersystem
|
||||
/// </summary>
|
||||
/// <returns>XSigToken</returns>
|
||||
/// <exception cref="ArgumentOutOfRangeException">Offset is less than 0.</exception>
|
||||
/// <summary>
|
||||
/// ReadXSigToken method
|
||||
/// </summary>
|
||||
public XSigToken ReadXSigToken()
|
||||
{
|
||||
ushort prefix;
|
||||
@@ -114,6 +120,9 @@ namespace PepperDash.Core.Intersystem
|
||||
/// Reads all available XSig tokens from the stream.
|
||||
/// </summary>
|
||||
/// <returns>XSigToken collection.</returns>
|
||||
/// <summary>
|
||||
/// ReadAllXSigTokens method
|
||||
/// </summary>
|
||||
public IEnumerable<XSigToken> ReadAllXSigTokens()
|
||||
{
|
||||
var tokens = new List<XSigToken>();
|
||||
|
||||
@@ -47,6 +47,9 @@ namespace PepperDash.Core.Intersystem
|
||||
/// Write XSig data gathered from an IXSigStateResolver to the stream.
|
||||
/// </summary>
|
||||
/// <param name="xSigSerialization">IXSigStateResolver object.</param>
|
||||
/// <summary>
|
||||
/// WriteXSigData method
|
||||
/// </summary>
|
||||
public void WriteXSigData(IXSigSerialization xSigSerialization)
|
||||
{
|
||||
WriteXSigData(xSigSerialization, 0);
|
||||
@@ -57,6 +60,9 @@ namespace PepperDash.Core.Intersystem
|
||||
/// </summary>
|
||||
/// <param name="xSigSerialization">IXSigStateResolver object.</param>
|
||||
/// <param name="offset">Index offset for each XSigToken.</param>
|
||||
/// <summary>
|
||||
/// WriteXSigData method
|
||||
/// </summary>
|
||||
public void WriteXSigData(IXSigSerialization xSigSerialization, int offset)
|
||||
{
|
||||
if (xSigSerialization == null)
|
||||
@@ -70,6 +76,9 @@ namespace PepperDash.Core.Intersystem
|
||||
/// Write XSigToken to the stream.
|
||||
/// </summary>
|
||||
/// <param name="token">XSigToken object.</param>
|
||||
/// <summary>
|
||||
/// WriteXSigData method
|
||||
/// </summary>
|
||||
public void WriteXSigData(XSigToken token)
|
||||
{
|
||||
WriteXSigData(token, 0);
|
||||
@@ -80,6 +89,9 @@ namespace PepperDash.Core.Intersystem
|
||||
/// </summary>
|
||||
/// <param name="token">XSigToken object.</param>
|
||||
/// <param name="offset">Index offset for each XSigToken.</param>
|
||||
/// <summary>
|
||||
/// WriteXSigData method
|
||||
/// </summary>
|
||||
public void WriteXSigData(XSigToken token, int offset)
|
||||
{
|
||||
WriteXSigData(new[] { token }, offset);
|
||||
@@ -108,6 +120,9 @@ namespace PepperDash.Core.Intersystem
|
||||
/// </summary>
|
||||
/// <param name="tokens">XSigToken objects.</param>
|
||||
/// <param name="offset">Index offset for each XSigToken.</param>
|
||||
/// <summary>
|
||||
/// WriteXSigData method
|
||||
/// </summary>
|
||||
public void WriteXSigData(IEnumerable<XSigToken> tokens, int offset)
|
||||
{
|
||||
if (offset < 0)
|
||||
@@ -127,6 +142,9 @@ namespace PepperDash.Core.Intersystem
|
||||
/// <summary>
|
||||
/// Disposes of the internal stream if specified to not leave open.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Dispose method
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
if (!_leaveOpen)
|
||||
|
||||
Reference in New Issue
Block a user