Class ObjectIdentifier
- Namespace
- Lextm.SharpSnmpLib
- Assembly
- SharpSnmpLib.dll
ObjectIdentifier type.
[TypeConverter(typeof(ObjectIdentifierConverter))]
[DataContract]
public sealed class ObjectIdentifier : ISnmpData, IEquatable<ObjectIdentifier>, IComparable<ObjectIdentifier>, IComparable
- Inheritance
-
ObjectIdentifier
- Implements
- Inherited Members
- Extension Methods
Constructors
ObjectIdentifier(string)
Creates an ObjectIdentifier instance from textual ID.
public ObjectIdentifier(string text)
Parameters
text
stringString in this format, "...".
ObjectIdentifier(Tuple<int, byte[]>, Stream)
Initializes a new instance of the ObjectIdentifier class.
public ObjectIdentifier(Tuple<int, byte[]> length, Stream stream)
Parameters
ObjectIdentifier(uint[])
Creates an ObjectIdentifier instance from numerical ID.
[CLSCompliant(false)]
public ObjectIdentifier(uint[] id)
Parameters
Properties
TypeCode
Type code.
public SnmpType TypeCode { get; }
Property Value
Methods
AppendBytesTo(Stream)
Appends the bytes to Stream.
public void AppendBytesTo(Stream stream)
Parameters
stream
StreamThe stream.
AppendTo(uint[]?, uint)
Appends an extra number to the array.
[CLSCompliant(false)]
public static uint[] AppendTo(uint[]? original, uint extra)
Parameters
Returns
- uint[]
Compare(ObjectIdentifier)
Compares the current object with another object of the same type.
public int Compare(ObjectIdentifier other)
Parameters
other
ObjectIdentifierAn object to compare with this object.
Returns
- int
A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has the following meanings: Value Meaning Less than zero This object is less than the
other
parameter. Zero This object is equal toother
. Greater than zero This object is greater thanother
.
CompareTo(ObjectIdentifier?)
Compares the current object with another object of the same type.
public int CompareTo(ObjectIdentifier? other)
Parameters
other
ObjectIdentifierAn object to compare with this object.
Returns
- int
A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has the following meanings: Value Meaning Less than zero This object is less than the
other
parameter. Zero This object is equal toother
. Greater than zero This object is greater thanother
.
CompareTo(object?)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public int CompareTo(object? obj)
Parameters
obj
objectAn object to compare with this instance.
Returns
- int
A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance is less than
obj
. Zero This instance is equal toobj
. Greater than zero This instance is greater thanobj
.
Exceptions
- ArgumentException
obj
is not the same type as this instance.
Convert(string)
Converts dotted string to unsigned integer array.
[CLSCompliant(false)]
public static uint[] Convert(string dotted)
Parameters
dotted
stringDotted string.
Returns
- uint[]
Unsigned integer array.
Convert(uint[])
Converts unsigned integer array to dotted string.
[CLSCompliant(false)]
public static string Convert(uint[] numerical)
Parameters
numerical
uint[]
Returns
Create(uint[], uint)
Creates a new ObjectIdentifier instance.
[CLSCompliant(false)]
public static ObjectIdentifier Create(uint[] numerical, uint extra)
Parameters
Returns
Equals(ObjectIdentifier?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(ObjectIdentifier? other)
Parameters
other
ObjectIdentifierAn object to compare with this object.
Returns
- bool
true if the current object is equal to theother
parameter; otherwise,false .
Equals(object?)
Determines whether the specified object is equal to the current ObjectIdentifier.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current ObjectIdentifier.
Returns
- bool
true if the specified object is equal to the current ObjectIdentifier; otherwise,false .
GetHashCode()
Serves as a hash function for a particular type.
public override int GetHashCode()
Returns
- int
A hash code for the current ObjectIdentifier.
ToNumerical()
Converts to numerical ID.
[CLSCompliant(false)]
public uint[] ToNumerical()
Returns
- uint[]
ToString()
Returns a string that represents this ObjectIdentifier.
public override string ToString()
Returns
Operators
operator ==(ObjectIdentifier?, ObjectIdentifier?)
The equality operator.
public static bool operator ==(ObjectIdentifier? left, ObjectIdentifier? right)
Parameters
left
ObjectIdentifierLeft ObjectIdentifier object
right
ObjectIdentifierRight ObjectIdentifier object
Returns
- bool
Returns
true
if the values of its operands are equal,false
otherwise.
operator >(ObjectIdentifier, ObjectIdentifier)
Implements the operator >.
public static bool operator >(ObjectIdentifier left, ObjectIdentifier right)
Parameters
left
ObjectIdentifierThe left.
right
ObjectIdentifierThe right.
Returns
- bool
The result of the operator.
operator !=(ObjectIdentifier?, ObjectIdentifier?)
The inequality operator.
public static bool operator !=(ObjectIdentifier? left, ObjectIdentifier? right)
Parameters
left
ObjectIdentifierLeft ObjectIdentifier object
right
ObjectIdentifierRight ObjectIdentifier object
Returns
- bool
Returns
true
if the values of its operands are not equal,false
otherwise.
operator <(ObjectIdentifier, ObjectIdentifier)
Implements the operator <.
public static bool operator <(ObjectIdentifier left, ObjectIdentifier right)
Parameters
left
ObjectIdentifierThe left.
right
ObjectIdentifierThe right.
Returns
- bool
The result of the operator.