Ejemplo n.º 1
0
        private void ParseType(IndividualEndianessBinaryReader br)
        {
            var infotype = br.ReadByte();

            if (Enum.IsDefined(typeof(AdditionalInfoType), infotype))
            {
                _infoType = (AdditionalInfoType)infotype;
            }
            else
            {
                throw BufferFieldException.TypeUnknown("AdditionalInfoType", infotype);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Create an <c>AdditionalInformationField</c> class from a type info and the actual info
 /// </summary>
 /// <param name="infoType"></param>
 /// <param name="info"></param>
 public AdditionalInformationField(AdditionalInfoType infoType, byte[] info)
 {
     if (info == null)
     {
         throw new ArgumentNullException("data parameter must not be null!");
     }
     if (info.Length < 1)
     {
         throw new ArgumentException("Size of data array to small");
     }
     _infoType = infoType;
     SetInfo(info);
     _size = 2 + _infoLength;
 }
Ejemplo n.º 3
0
 private void VerifyLength(AdditionalInfoType type, int length)
 {
     if (type == AdditionalInfoType.RFFASTACK || type == AdditionalInfoType.MANUFACTURER)
     {
         // TODO: Add checking of correct length
         // requires some calcs
     }
     else
     {
         if (length != TypeSizes[type])
         {
             throw BufferFieldException.WrongValue($"AdditionalInfo ({type}) length", TypeSizes[type], length);
         }
     }
 }
Ejemplo n.º 4
0
    /*
     * //! Creates a default ui element with two buttons ...
     * public AdditionalInfo(string additionalInfoText, methode1, methode2
     * {
     *  this.type = AdditionalInfoType.CUSTOM;
     *  this.additionalInfoText = additionalInfoText;
     *  this.customUIElement = null;
     * }*/

    //! Uses the custom ui element given in customUIElement.
    public AdditionalInfo(GameObject customUIElement)
    {
        this.type = AdditionalInfoType.CUSTOM;
        this.additionalInfoText = null;
        this.customUIElement    = customUIElement;
    }
Ejemplo n.º 5
0
    //private delegate yes;
    //private delegate no;

    //! Creates a default ui element above the notification with the text given in additionalInfoText
    public AdditionalInfo(string additionalInfoText)
    {
        this.type = AdditionalInfoType.TEXT;
        this.additionalInfoText = additionalInfoText;
        this.customUIElement    = null;
    }