Table of Contents

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 string

String 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

length Tuple<int, byte[]>

The length.

stream Stream

The stream.

ObjectIdentifier(uint[])

Creates an ObjectIdentifier instance from numerical ID.

[CLSCompliant(false)]
public ObjectIdentifier(uint[] id)

Parameters

id uint[]

OID uint array

Properties

TypeCode

Type code.

public SnmpType TypeCode { get; }

Property Value

SnmpType

Methods

AppendBytesTo(Stream)

Appends the bytes to Stream.

public void AppendBytesTo(Stream stream)

Parameters

stream Stream

The stream.

AppendTo(uint[]?, uint)

Appends an extra number to the array.

[CLSCompliant(false)]
public static uint[] AppendTo(uint[]? original, uint extra)

Parameters

original uint[]

The original array.

extra uint

The extra.

Returns

uint[]

Compare(ObjectIdentifier)

Compares the current object with another object of the same type.

public int Compare(ObjectIdentifier other)

Parameters

other ObjectIdentifier

An 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 to other. Greater than zero This object is greater than other.

CompareTo(ObjectIdentifier?)

Compares the current object with another object of the same type.

public int CompareTo(ObjectIdentifier? other)

Parameters

other ObjectIdentifier

An 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 to other. Greater than zero This object is greater than other.

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 object

An 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 to obj. Greater than zero This instance is greater than obj.

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 string

Dotted 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

string

Create(uint[], uint)

Creates a new ObjectIdentifier instance.

[CLSCompliant(false)]
public static ObjectIdentifier Create(uint[] numerical, uint extra)

Parameters

numerical uint[]

The numerical.

extra uint

The extra.

Returns

ObjectIdentifier

Equals(ObjectIdentifier?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(ObjectIdentifier? other)

Parameters

other ObjectIdentifier

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to the current ObjectIdentifier.

public override bool Equals(object? obj)

Parameters

obj object

The 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

string

Operators

operator ==(ObjectIdentifier?, ObjectIdentifier?)

The equality operator.

public static bool operator ==(ObjectIdentifier? left, ObjectIdentifier? right)

Parameters

left ObjectIdentifier

Left ObjectIdentifier object

right ObjectIdentifier

Right 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 ObjectIdentifier

The left.

right ObjectIdentifier

The right.

Returns

bool

The result of the operator.

operator !=(ObjectIdentifier?, ObjectIdentifier?)

The inequality operator.

public static bool operator !=(ObjectIdentifier? left, ObjectIdentifier? right)

Parameters

left ObjectIdentifier

Left ObjectIdentifier object

right ObjectIdentifier

Right 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 ObjectIdentifier

The left.

right ObjectIdentifier

The right.

Returns

bool

The result of the operator.