OctoObjectId
Namespace: Meshmakers.Octo.ConstructionKit.Contracts
Represents an Octo object id
public struct OctoObjectId
Inheritance Object → ValueType → OctoObjectId
Implements IComparable<OctoObjectId>, IEquatable<OctoObjectId>, IConvertible
Properties
Empty
Gets an instance of ObjectId where the value is empty.
public static OctoObjectId Empty { get; }
Property Value
Timestamp
Gets the timestamp.
public int Timestamp { get; }
Property Value
CreationTime
Gets the creation time (derived from the timestamp).
public DateTime CreationTime { get; }
Property Value
Constructors
OctoObjectId(Byte[])
Initializes a new instance of the ObjectId class.
public OctoObjectId(Byte[] bytes)
Parameters
bytes Byte[]
The bytes.
OctoObjectId(String)
Initializes a new instance of the ObjectId class.
public OctoObjectId(string value)
Parameters
value String
The value.
Methods
GenerateNewId()
Generates a new ObjectId with a unique value.
public static OctoObjectId GenerateNewId()
Returns
OctoObjectId
An ObjectId.
GenerateNewId(DateTime)
Generates a new ObjectId with a unique value (with the timestamp component based on a given DateTime).
public static OctoObjectId GenerateNewId(DateTime timestamp)
Parameters
timestamp DateTime
The timestamp component (expressed as a DateTime).
Returns
OctoObjectId
An ObjectId.
GenerateNewId(Int32)
Generates a new ObjectId with a unique value (with the given timestamp).
public static OctoObjectId GenerateNewId(int timestamp)
Parameters
timestamp Int32
The timestamp component.
Returns
OctoObjectId
An ObjectId.
Parse(String)
Parses a string and creates a new ObjectId.
public static OctoObjectId Parse(string s)
Parameters
s String
The string value.
Returns
OctoObjectId
A ObjectId.
TryParse(String, out OctoObjectId)
Tries to parse a string and create a new ObjectId.
public static bool TryParse(string s, out OctoObjectId objectId)
Parameters
s String
The string value.
objectId OctoObjectId
The new ObjectId.
Returns
Boolean
True if the string was parsed successfully.
CompareTo(OctoObjectId)
Compares this ObjectId to another ObjectId.
public int CompareTo(OctoObjectId other)
Parameters
other OctoObjectId
The other ObjectId.
Returns
Int32
A 32-bit signed integer that indicates whether this ObjectId is less than, equal to, or greater than the
other.
Equals(OctoObjectId)
Compares this ObjectId to another ObjectId.
public bool Equals(OctoObjectId rhs)
Parameters
rhs OctoObjectId
The other ObjectId.
Returns
Boolean
True if the two ObjectIds are equal.
Equals(Object)
Compares this ObjectId to another object.
public bool Equals(object obj)
Parameters
obj Object
The other object.
Returns
Boolean
True if the other object is an ObjectId and equal to this one.
GetHashCode()
Gets the hash code.
public int GetHashCode()
Returns
Int32
The hash code.
ToByteArray()
Converts the ObjectId to a byte array.
public Byte[] ToByteArray()
Returns
Byte[]
A byte array.
ToByteArray(Byte[], Int32)
Converts the ObjectId to a byte array.
public void ToByteArray(Byte[] destination, int offset)
Parameters
destination Byte[]
The destination.
offset Int32
The offset.
ToString()
Returns a string representation of the value.
public string ToString()
Returns
String
A string representation of the value.