Struct ApiObjectIdentifier
Полный уникальный идентификатор объекта API.
Implements
Inherited Members
Namespace: Ascon.Polynom.Api
Assembly: Ascon.Polynom.Api.dll
Syntax
public readonly struct ApiObjectIdentifier : IEquatable<ApiObjectIdentifier>
Constructors
ApiObjectIdentifier(ObjectType, int)
Создает идентификатор ApiObjectIdentifier.
Declaration
public ApiObjectIdentifier(ObjectType objectType, int objectId)
Parameters
| Type | Name | Description |
|---|---|---|
| ObjectType | objectType | Тип объекта. |
| int | objectId | Идентификатор объекта. |
ApiObjectIdentifier(byte[])
Создает идентификатор ApiObjectIdentifier.
Declaration
public ApiObjectIdentifier(byte[] bytes)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | bytes | Бинарное представление идентификатора. |
Fields
ObjectId
Идентификатор объекта.
Declaration
public readonly int ObjectId
Field Value
| Type | Description |
|---|---|
| int |
ObjectType
Тип объекта.
Declaration
public readonly ObjectType ObjectType
Field Value
| Type | Description |
|---|---|
| ObjectType |
Properties
Empty
Константный пустой идентификатор
Declaration
public static ApiObjectIdentifier Empty { get; }
Property Value
| Type | Description |
|---|---|
| ApiObjectIdentifier |
IsEmpty
Возвращает признак того, что идентификатор не указывает на объект (пустой идентификатор)
Declaration
public bool IsEmpty { get; }
Property Value
| Type | Description |
|---|---|
| bool |
|
Methods
Create(int, ObjectType)
Создает составной идентификатор объекта.
Declaration
public static ApiObjectIdentifier Create(int objectId, ObjectType typeId)
Parameters
| Type | Name | Description |
|---|---|---|
| int | objectId | Идентификатор объекта |
| ObjectType | typeId | Идентификатор типа. |
Returns
| Type | Description |
|---|---|
| ApiObjectIdentifier | Составной идентификатор объекта. |
Create(int, int)
Создает составной идентификатор объекта.
Declaration
public static ApiObjectIdentifier Create(int objectId, int typeId)
Parameters
| Type | Name | Description |
|---|---|---|
| int | objectId | Идентификатор объекта |
| int | typeId | Идентификатор типа. |
Returns
| Type | Description |
|---|---|
| ApiObjectIdentifier | Составной идентификатор объекта. |
Exceptions
| Type | Condition |
|---|---|
| IndexOutOfRangeException | Исключение в случае если значение типа не принадлежит зарегистрированному типу. |
Equals(ApiObjectIdentifier)
Сравнение двух идентификаторов.
Declaration
public bool Equals(ApiObjectIdentifier other)
Parameters
| Type | Name | Description |
|---|---|---|
| ApiObjectIdentifier | other | Заданный идентификатор для свавнения. |
Returns
| Type | Description |
|---|---|
| bool |
|
GetHashCode()
Возвращает хэш-код идентификатора.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | Хэш-код идентификатора. |
Overrides
NewIdentifier()
Возвращает случайный идентификатор абстрактного типа.
Declaration
public static ApiObjectIdentifier NewIdentifier()
Returns
| Type | Description |
|---|---|
| ApiObjectIdentifier | Случайный идентификатор абстрактного типа. |
Parse(string)
Распознает идентификатор из строкового представления.
Declaration
public static ApiObjectIdentifier Parse(string id)
Parameters
| Type | Name | Description |
|---|---|---|
| string | id | Строковое представление идентификатора. |
Returns
| Type | Description |
|---|---|
| ApiObjectIdentifier | Распознанный идентификатор. |
ToByteArray()
Возвращает бинарное представление идентификатора.
Declaration
public byte[] ToByteArray()
Returns
| Type | Description |
|---|---|
| byte[] | Бинарное представление идентификатора. |
ToString()
Возвращает строковое представление идентификатора.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | Строковое представление идентификатора. |
Overrides
TryParse(string, out ApiObjectIdentifier)
Распознает идентификатор из строкового представления.
Declaration
public static bool TryParse(string id, out ApiObjectIdentifier identifier)
Parameters
| Type | Name | Description |
|---|---|---|
| string | id | Строковое представление идентификатора. |
| ApiObjectIdentifier | identifier | Распознанный идентификатор. |
Returns
| Type | Description |
|---|---|
| bool |
|