/// <summary> /// Creates a new instance of <see cref="InfoFrameData" />. /// </summary> /// <param name="command">The operation to be done. Can only be used to change property information.</param> /// <param name="dataType">The type of information.</param> /// <param name="propertyInformation">The new property information to be set.</param> public InfoFrameData( InfoFrameCommand command, InfoFrameDataType dataType, InfoFrameProperty propertyInformation) { this = typeof(InfoFrameData).Instantiate <InfoFrameData>(); _Size = (ushort)_Version.StructureSize; if (command != InfoFrameCommand.SetProperty) { throw new ArgumentOutOfRangeException(nameof(command)); } _Command = (byte)command; _Type = (byte)dataType; _Property = propertyInformation; }
/// <summary> /// Creates a new instance of <see cref="InfoFrameData" />. /// </summary> /// <param name="command"> /// The operation to be done. Can be used for information retrieval or to reset configurations to /// default. /// </param> /// <param name="dataType">The type of information.</param> public InfoFrameData(InfoFrameCommand command, InfoFrameDataType dataType) { this = typeof(InfoFrameData).Instantiate <InfoFrameData>(); _Size = (ushort)_Version.StructureSize; if (command != InfoFrameCommand.Get && command != InfoFrameCommand.GetDefault && command != InfoFrameCommand.GetOverride && command != InfoFrameCommand.GetProperty && command != InfoFrameCommand.Reset) { throw new ArgumentOutOfRangeException(nameof(command)); } _Command = (byte)command; _Type = (byte)dataType; }