none
About ChangeUnitVersionDefinition constructor RRS feed

  • Question

  • I want to implement one custom provider derived from FullEnumerationSimpleSyncProvider, and not familiar with the ChangeUnitVersionDefinition usage of initialization, specially the ctor parameters.

    Can you show me an example code to explain the relationship between the parameters and the provider ?

    thanks

    Bob

    Thursday, November 25, 2010 5:19 AM

All replies

  • I want to implement one custom provider derived from FullEnumerationSimpleSyncProvider, and not familiar with the ChangeUnitVersionDefinition usage of initialization, specially the ctor parameters.

    Can you show me an example code to explain the relationship between the parameters and the provider ?

    thanks

    Bob


    ps:I have a little try, the code is ,

    ChangeUnitVersionDefinition[] changeUnitVersion = new ChangeUnitVersionDefinition[1];
    byte[] cuid = new byte[4];
    SyncId changedUnitId = new SyncId(cuid, false);
    changeUnitVersion[0] = new ChangeUnitVersionDefinition(IdFormats, changedUnitId, new uint[]{ ItemFields.CUSTOM_FIELD_TIMESTAMP });

    and the "IdFormats" is ,

    IdFormats= new SyncIdFormatGroup();
    IdFormats.ChangeUnitIdFormat.IsVariableLength = false;
    IdFormats.ChangeUnitIdFormat.Length = 4;
    IdFormats.ItemIdFormat.IsVariableLength = false;
    IdFormats.ItemIdFormat.Length = 24;
    IdFormats.ReplicaIdFormat.IsVariableLength = false;
    IdFormats.ReplicaIdFormat.Length = 16;

    the "ItemFields.CUSTOM_FIELD_TIMESTAMP " is a enum value.

    if i initialise the ChangeUnitVersionDefinition object like that,  my code will run in a right way, or throw

    SyncIdFormatMismatchException. And I don't know how it works, please tell the reasonable usage, thanks.

    Thursday, November 25, 2010 6:17 AM