ObjectRevision property for PowerScript controls
Controls
MLSynchronization
and MLSync objects
Description
Specifies the build number for synchronization property values
that are stored in the client registry.
Usage
When you deploy a new version of an application that includes
a wizard–generated synchronization object, you can make
sure that values for synchronization object properties are written
to the application user’s registry by incrementing the
value of the ObjectRevision property. Code in the synchonization
object’s Contructor event checks the value of this property against
the value stored during a previous synchronization.
If the value of the ObjectRevision property is higher than
the value stored in the registry, property values of the synchronization
object are written to the registry, replacing any values previously
stored there. The property values written to the registry are: AdditionalOpts,
DownloadOnly, ExtendedOpts, Host, LogFileName, LogOpts, MLServerVersion,
MLUser, ObjectRevision, Port, Publication, UploadOnly, UseLogFile,
and UseWindow.
Secured properties such as AuthenticateParms, DBPass, and
EncryptionKey are never written to the registry.
In a painter
On the Settings tab of the Properties view for an MLSync object,
type the value you want for the ObjectRevision property in the Object
Revision Number text box.
In scripts
The following code is similar to code in the Constructor event
of the MLSync object generated by the MobiLink synchronization wizard.
It checks the ObjectRevision value against the revision number stored
in the registry. If the registry value is less than the value of
the ObjectRevision value, the object’s synchronization
properties are written to the registry. Otherwise, the synchronization
object retrieves the values stored in the registry:
|
1 |
long rc = 1 |
|
1 |
long RegistryRevision |
|
1 |
if this.ObjectRevision > 0 and &<br>  this.SyncRegistryKey <> "" then |
|
1 |
   RegistryRevision = & |
|
1 |
       this.GetObjectRevisionFromRegistry() |
|
1 |
    if RegistryRevision < this.ObjectRevision then |
|
1 |
       rc = this.SetSyncRegistryProperties() |
|
1 |
    else |
|
1 |
       rc = this.GetSyncRegistryProperties() |
|
1 |
    end if |
|
1 |
end if |
|
1 |
return rc |