Metodo SyncKnowledge.SetLocalTickCount
Imposta il conteggio della replica proprietaria di questa conoscenza.
Spazio dei nomi: Microsoft.Synchronization
Assembly: Microsoft.Synchronization (in microsoft.synchronization.dll)
Sintassi
'Dichiarazione
Public Sub SetLocalTickCount ( _
localTickCount As ULong _
)
'Utilizzo
Dim instance As SyncKnowledge
Dim localTickCount As ULong
instance.SetLocalTickCount(localTickCount)
public void SetLocalTickCount (
ulong localTickCount
)
public:
void SetLocalTickCount (
usigned long long localTickCount
)
public void SetLocalTickCount (
UInt64 localTickCount
)
public function SetLocalTickCount (
localTickCount : ulong
)
Parametri
- localTickCount
Conteggio corrente della replica proprietaria di questa conoscenza.
Osservazioni
Il conteggio corrente è necessario prima dell'invio della conoscenza a un'altra replica. In genere, un provider chiama immediatamente questo metodo prima di inviare la conoscenza, benché sia possibile chiamare il metodo in qualsiasi momento.
Esempio
Nell'esempio seguente il conteggio dell'oggetto SyncKnowledge viene impostato sul conteggio locale prima di restituirlo al chiamante.
Public Overrides Function GetKnowledge() As SyncKnowledge
' If the replica does not yet contain any knowledge, create a new knowledge object.
If _knowledge Is Nothing Then
_knowledge = New SyncKnowledge(IdFormats, ReplicaId, _tickCount)
End If
' Ensure the tick count of the knowledge is set to the current tick count of the replica.
_knowledge.SetLocalTickCount(_tickCount)
Return _knowledge
End Function
public override SyncKnowledge GetKnowledge()
{
// If the replica does not yet contain any knowledge, create a new knowledge object.
if (null == _knowledge)
{
_knowledge = new SyncKnowledge(IdFormats, ReplicaId, _tickCount);
}
// Ensure the tick count of the knowledge is set to the current tick count of the replica.
_knowledge.SetLocalTickCount(_tickCount);
return _knowledge;
}
Vedere anche
Riferimento
Classe SyncKnowledge
Membri SyncKnowledge
Spazio dei nomi Microsoft.Synchronization