Class IdReserver
This class is responsible for shape id's reservation.
Inherited Members
Namespace: Syncfusion.XlsIO.Implementation
Assembly: Syncfusion.XlsIO.NET.dll
Syntax
public class IdReserver
Constructors
IdReserver()
Declaration
public IdReserver()
Fields
SegmentSize
Size of the single id's segment.
Declaration
public const int SegmentSize = 1024
Field Value
| Type |
|---|
| int |
Properties
MaximumId
Gets maximum accessed shape id.
Declaration
public int MaximumId { get; }
Property Value
| Type |
|---|
| int |
Methods
AddAdditionalShapes(int, int)
Registers any number of additional shapes required by collection.
Declaration
public void AddAdditionalShapes(int collectionIndex, int shapesNumber)
Parameters
| Type | Name | Description |
|---|---|---|
| int | collectionIndex | Collection index. |
| int | shapesNumber | Number of additional shapes to add. |
Allocate(int, int, ShapeCollectionBase)
Allocates specified number of segments.
Declaration
public int Allocate(int idNumber, int collectionId, ShapeCollectionBase shapes)
Parameters
| Type | Name | Description |
|---|---|---|
| int | idNumber | Ids count to allocate. |
| int | collectionId | Collection id. |
| ShapeCollectionBase | shapes | shapes. |
Returns
| Type | Description |
|---|---|
| int | Index to the first allocate id. |
CheckFree(int, int)
Checks whether segment with specified id is free.
Declaration
public bool CheckFree(int id, int count)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | Id to check. |
| int | count | Number of segments to check. |
Returns
| Type | Description |
|---|---|
| bool | True if all segments are free. |
CheckReserved(int)
Checks whether segment with specified it is already reserved.
Declaration
public bool CheckReserved(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | Id to check. |
Returns
| Type |
|---|
| bool |
FreeSegmentsSequence(int, int)
Frees segments sequence if they belong to specified collection.
Declaration
public void FreeSegmentsSequence(int id, int collectionId)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | Id to detect first segment. |
| int | collectionId | Collection to free segments for. |
FreeSequence(int)
Frees all segments allocated by the collection.
Declaration
public void FreeSequence(int collectionId)
Parameters
| Type | Name | Description |
|---|---|---|
| int | collectionId | Collection id. |
GetAdditionalShapesNumber(int)
Gets number of additional shapes reserved by collection.
Declaration
public int GetAdditionalShapesNumber(int collectionIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| int | collectionIndex | Collection index. |
Returns
| Type | Description |
|---|---|
| int | Number of additional shapes. |
GetReservedCount(int)
Returns number of reserved ids by specified collection.
Declaration
public int GetReservedCount(int collectionId)
Parameters
| Type | Name | Description |
|---|---|---|
| int | collectionId | Collection index. |
Returns
| Type | Description |
|---|---|
| int | Number of reserved ids. |
GetSegmentStart(int)
Evaluates start of the segment containing specified id.
Declaration
public static int GetSegmentStart(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | Id to get segment start for. |
Returns
| Type |
|---|
| int |
ReservedBy(int)
Gets index of the collection which reserved specified id.
Declaration
public int ReservedBy(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | Id to check. |
Returns
| Type | Description |
|---|---|
| int | Index of the collection which reserved id, or 0 if it is not reserved. |
ReservedCount(int)
Gets number of reserved shapes inside specified sector.
Declaration
public int ReservedCount(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | Id that belongs to the segment that is being investigated. |
Returns
| Type | Description |
|---|---|
| int | Number of reserved ids inside sector. |
TryReserve(int, int, int)
Tries to reserve segment or segments containing specified ids for the specified collection.
Declaration
public bool TryReserve(int id, int lastId, int collectionId)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | Start id to reserve. |
| int | lastId | Last id to reserve. |
| int | collectionId | Collection owning those ids |
Returns
| Type | Description |
|---|---|
| bool | True if reservation succeeded. |