Table of Contents

Class OID

Namespace
ArcanaDevelopment.adTempus.Shared
Assembly
ArcanaDevelopment.adTempus.Shared.dll

Object Identifier used to uniquely identify ADTObject objects within adTempus.

[Serializable]
[DataContract]
public class OID
Inheritance
object
OID

Constructors

OID(ClassID, Guid)

Creates an OID from a Class ID and Object ID

public OID(ClassID cid, Guid oid)

Parameters

NameTypeDescription
cid ClassID

The class ID.

oid Guid

The object ID

OID(Guid, Guid)

Creates a new OID from a class Guid and an object ID. Used for backward compatibility.

public OID(Guid classID, Guid oid)

Parameters

NameTypeDescription
classID Guid

The Guid representing the class, as used in some earlier versions of adTempus.

oid Guid

The object ID.

OID(string)

Creates an OID from a string representation.

public OID(string oid)

Parameters

NameTypeDescription
oid string

String representation of the OID produced by one of the ToString methods.

Exceptions

ArgumentException

Thrown if the source string is not a valid OID representation.

Properties

AsString

Returns ToShortString

public string AsString { get; }

Property Value

string

Remarks

This property is exposed to support reporting and other binding scenarios where a string property is needed.

ClassID

The Class ID

[DataMember]
public ClassID ClassID { get; set; }

Property Value

ClassID

ObjectID

The Object ID.

[DataMember]
public Guid ObjectID { get; set; }

Property Value

Guid

Methods

Compare(OID, OID)

Compares two OID values

public static int Compare(OID a, OID b)

Parameters

NameTypeDescription
a OID
b OID

Returns

int

Create(ClassID, Guid?)

Creates a new OID given a class ID and object ID

public static OID Create(ClassID cid, Guid? objectID)

Parameters

NameTypeDescription
cid ClassID

The class ID

objectID Guid?

Returns

OID

A new OID, or null if the objectID is null.

Equals(OID, OID)

Determines whether two OIDs are equal.

public static bool Equals(OID a, OID b)

Parameters

NameTypeDescription
a OID
b OID

Returns

bool

Equals(object)

Determines whether the OID equals another object.

public override bool Equals(object obj)

Parameters

NameTypeDescription
obj object

The object to compare to. May be an OID or a string representing an OID.

Returns

bool

Equals(string, string)

Determines whether two OIDs are equal.

public static bool Equals(string a, string b)

Parameters

NameTypeDescription
a string
b string

Returns

bool

GetCID(Guid)

Gets the ClassID for a ClassGuid.

public static ClassID GetCID(Guid classID)

Parameters

NameTypeDescription
classID Guid

Returns

ClassID

GetHashCode()

Gets the HashCode.

public override int GetHashCode()

Returns

int

IsValidOID(string)

Determines whether a string is a valid OID representation.

public static bool IsValidOID(string oid)

Parameters

NameTypeDescription
oid string

String representation of an OID to parse

Returns

bool

OIDListToGuidList(List<OID>)

Takes a list of OID values and returns a list of Guids containing only the object IDs.

public static List<Guid> OIDListToGuidList(List<OID> oids)

Parameters

NameTypeDescription
oids List<OID>

List of OIDs to extract the object IDs from

Returns

List<Guid>

ParseOID(string)

Attempts to parse an OID from a source string.

public static OID ParseOID(string source)

Parameters

NameTypeDescription
source string

String representation of an OID to parse

Returns

OID

An OID parsed from the string, or null if the source is not a valid OID.

ParseOID(string, out ClassID, out Guid)

Parses a string OID, returning the corresponding ClassID and guid.

public static void ParseOID(string oid, out ClassID classID, out Guid objectID)

Parameters

NameTypeDescription
oid string

String representation of an OID

classID ClassID

Returns the class ID

objectID Guid

Returns the object ID

Exceptions

ArgumentException

Thrown if the OID is not valid, or the class ID is not valid.

ParseOID(string, out Guid)

Parses a string OID, returning the corresponding ClassID and guid.

public static ClassID ParseOID(string oid, out Guid objectID)

Parameters

NameTypeDescription
oid string

String representation of an OID to parse

objectID Guid

Returns the object ID

Returns

ClassID

The class ID

Exceptions

ArgumentException

Thrown if the OID is not valid, or the class ID is not valid.

ToLongString()

Returns a string representation that uses the ClassGuid for the class ID.

public string ToLongString()

Returns

string

Remarks

This method is used to produce a string representation that can be used with adTempus version 3 and earlier.

ToNamedClassString()

Returns a string representation that uses the class name as the class ID.

public string ToNamedClassString()

Returns

string

ToShortString()

Returns a string representation that uses the integer value for the class ID.

public string ToShortString()

Returns

string

ToString()

Returns ToShortString.

public override string ToString()

Returns

string

TryParse(string, out ClassID, out Guid)

Parses a string OID, returning the corresponding ClassID and object ID.

public static bool TryParse(string oid, out ClassID classID, out Guid objectID)

Parameters

NameTypeDescription
oid string

String representation of an OID to parse

classID ClassID

Returns the class ID

objectID Guid

Returns the object ID

Returns

bool

TryParse(string, out OID)

Attempts to parse a string representation of an OID.

public static bool TryParse(string source, out OID oid)

Parameters

NameTypeDescription
source string

The string to parse

oid OID

Returns

bool

The parsed OID if source is a valid OID, or true if it is not.

Operators

operator ==(OID, OID)

Determines whether two OIDs are equal.

public static bool operator ==(OID a, OID b)

Parameters

NameTypeDescription
a OID
b OID

Returns

bool

operator !=(OID, OID)

Determines whether two OIDs are unequal.

public static bool operator !=(OID a, OID b)

Parameters

NameTypeDescription
a OID
b OID

Returns

bool