Index Numerator. Learn More

Index Numerator is a special case of Xafari Service, so in order to call its methods use the ObjectSpace.IndexNumerator() statement.

IndexNumerator interacts with the database in two modes – direct requests and standard XAF. To use direct sql you need to set UseDirectSql property before calling the methods of IndexNumerator.

  • c#
  • VB

this.ObjectSpace.IndexNumerator().UseDirectSql = true;

Me.ObjectSpace.IndexNumerator().UseDirectSql = True

By default UseDirectSql is false.

Available methods:

  • c#
  • VB

/// <summary>
/// Apply index number to object(s).
/// </summary>
/// <param name="objects">Objects with IndexNumber property.</param>
public void Apply(params IIndexNumber[] objects)
{
}
/// <summary>
/// Adjust numbers in collection by one object from that collection.
/// </summary>
/// <param name="obj">Any object from collection.</param>
/// <param name="startValue">Start value.</param>
/// <param name="step">Step </param>
public void AdjustByObject(IIndexNumber obj, int? startValue = null, int? step = null)
{
}
/// <summary>
/// Adjust numbers in range of collection by one object from that collection.
/// </summary>
/// <param name="objectList">Any object from collection.</param>
/// <param name="oldIndex">Old index number.</param>
/// <param name="newIndex">New index number.</param>
public void AdjustInRangeByObject(IIndexNumberSupport obj, int oldIndex, int newIndex)
{
}
/// <summary>
/// Adjust numbers in collection after object inserting.
/// </summary>
/// <param name="addingObject">Inserting object.</param>
public void AdjustAfterObject(IIndexNumberSupport addingObject)
{
}
/// <summary>
/// Adjust numbers in collection after removing.
/// </summary>
/// <param name="removingObject">Removing object.</param>
public void AdjustAfterRemove(IIndexNumberSupport removingObject)
{
}
/// <summary>
/// Set minimal index for object and adjust numbers.
/// </summary>
/// <param name="movingObject">Object.</param>
public void MoveToTop(IIndexNumberSupport movingObject)
{
}
/// <summary>
/// Set maximal index for object and adjust numbers.
/// </summary>
/// <param name="movingObject">Object.</param>
public void MoveToLast(IIndexNumberSupport movingObject)
{
}
/// <summary>
/// Returns criteria for object.
/// </summary>
/// <param name="obj">Object.</param>
/// <returns></returns>
public CriteriaOperator GetCriteriaByObject(IIndexNumberSupport obj)
{
}

''' <summary>
''' Apply index number to object(s).
''' </summary>
''' <param name="objects">Objects with IndexNumber property.</param>
Public Sub Apply(ParamArray objects As IIndexNumber())
End Sub
''' <summary>
''' Adjust numbers in collection by one object from that collection.
''' </summary>
''' <param name="obj">Any object from collection.</param>
''' <param name="startValue">Start value.</param>
''' <param name="step">Step </param>
Public Sub AdjustByObject(ByVal obj As IIndexNumber, Optional ByVal startValue As Integer? = Nothing, Optional ByVal [step] As Integer? = Nothing)
End Sub
''' <summary>
''' Adjust numbers in range of collection by one object from that collection.
''' </summary>
''' <param name="objectList">Any object from collection.</param>
''' <param name="oldIndex">Old index number.</param>
''' <param name="newIndex">New index number.</param>
Public Sub AdjustInRangeByObject(ByVal obj As IIndexNumberSupport, ByVal oldIndex As Integer, ByVal newIndex As Integer)
End Sub
''' <summary>
''' Adjust numbers in collection after object inserting.
''' </summary>
''' <param name="addingObject">Inserting object.</param>
Public Sub AdjustAfterObject(ByVal addingObject As IIndexNumberSupport)
End Sub
''' <summary>
''' Adjust numbers in collection after removing.
''' </summary>
''' <param name="removingObject">Removing object.</param>
Public Sub AdjustAfterRemove(ByVal removingObject As IIndexNumberSupport)
End Sub
''' <summary>
''' Set minimal index for object and adjust numbers.
''' </summary>
''' <param name="movingObject">Object.</param>
Public Sub MoveToTop(ByVal movingObject As IIndexNumberSupport)
End Sub
''' <summary>
''' Set maximal index for object and adjust numbers.
''' </summary>
''' <param name="movingObject">Object.</param>
Public Sub MoveToLast(ByVal movingObject As IIndexNumberSupport)
End Sub
''' <summary>
''' Returns criteria for object.
''' </summary>
''' <param name="obj">Object.</param>
''' <returns></returns>
Public Function GetCriteriaByObject(ByVal obj As IIndexNumberSupport) As CriteriaOperator
End Function