37 lines
903 B
C#
37 lines
903 B
C#
|
// /**
|
|||
|
// * File: Integer.cs
|
|||
|
// * Author: haraldwolff
|
|||
|
// *
|
|||
|
// * This file and it's content is copyrighted by the Author and / or copyright holder.
|
|||
|
// * Any use wihtout proper permission is illegal and may lead to legal actions.
|
|||
|
// *
|
|||
|
// *
|
|||
|
// **/
|
|||
|
using System;
|
|||
|
namespace ln.snmp.types
|
|||
|
{
|
|||
|
public class Integer : Variable
|
|||
|
{
|
|||
|
public long LongValue { get; set; }
|
|||
|
|
|||
|
public Integer()
|
|||
|
:base(new Identifier(IdentifierClass.UNIVERSAL, false, 0x02))
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
public Integer(long value)
|
|||
|
:this()
|
|||
|
{
|
|||
|
LongValue = value;
|
|||
|
}
|
|||
|
|
|||
|
public override byte[] Bytes
|
|||
|
{
|
|||
|
get => BasicEncodingRules.EncodeInteger(LongValue);
|
|||
|
set => LongValue = BasicEncodingRules.DecodeInteger(value);
|
|||
|
}
|
|||
|
public override object Value { get => LongValue; set => LongValue = (long)value; }
|
|||
|
|
|||
|
}
|
|||
|
}
|