C# Class ZeroInstall.DesktopIntegration.SyncIntegrationManager

Synchronizes the AppList with other computers.
To prevent race-conditions there may only be one desktop integration class instance active at any given time. This class acquires a mutex upon calling its constructor and releases it upon calling IDisposable.Dispose.
Inheritance: IntegrationManager
显示文件 Open project: 0install/0install-win Class Usage Examples

Public Methods

Method Description
Sync ( SyncResetMode resetMode = SyncResetMode.None ) : void

Synchronize the AppList with the sync server and (un)apply AccessPoints accordingly.

SyncIntegrationManager ( SyncServer server, [ cryptoKey, Feed>.[ feedRetriever, [ handler, bool machineWide = false ) : System

Creates a new sync manager. Performs Mutex-based locking!

SyncIntegrationManager ( [ appListPath, SyncServer server, Feed>.[ feedRetriever, [ handler, bool machineWide = false ) : System

Creates a new sync manager for a custom AppList file. Used for testing. Uses no mutex!

Private Methods

Method Description
AddAppHelper ( [ prototype ) : void

Creates a new AppEntry based on an existing prototype (applying any AccessPoints) and adds it to the AppList.

DownloadAppList ( [ appListUri, [ webClient, SyncResetMode resetMode ) : byte[]
HandleDownloadedAppList ( SyncResetMode resetMode, [ appListData ) : void
MergeData ( [ remoteAppList, bool resetClient ) : void

Merges a new IntegrationManagerBase.AppList with the existing data.

Performs a three-way merge using _appListLastSync as base.

UploadAppList ( [ appListUri, [ webClient, SyncResetMode resetMode ) : void

Upload the encrypted AppList back to the server (unless the client was reset)

Method Details

Sync() public method

Synchronize the AppList with the sync server and (un)apply AccessPoints accordingly.
The user canceled the task. A problem occurred while deserializing the XML data or the specified crypto key was wrong. A problem occured while communicating with the sync server or while downloading additional data (such as icons). A problem occurs while writing to the filesystem or registry. Write access to the filesystem or registry is not permitted.
public Sync ( SyncResetMode resetMode = SyncResetMode.None ) : void
resetMode SyncResetMode Controls how synchronization data is reset.
return void

SyncIntegrationManager() public method

Creates a new sync manager. Performs Mutex-based locking!
A problem occurs while accessing the file. Read or write access to the file is not permitted or another desktop integration class is currently active. A problem occurs while deserializing the XML data.
public SyncIntegrationManager ( SyncServer server, [ cryptoKey, Feed>.[ feedRetriever, [ handler, bool machineWide = false ) : System
server SyncServer Access information for the sync server.
cryptoKey [ The local key used to encrypt data before sending it to the .
feedRetriever Feed>.[ Callback method used to retrieve additional s on demand.
handler [ A callback object used when the the user is to be informed about the progress of long-running operations such as downloads.
machineWide bool Apply operations machine-wide instead of just for the current user.
return System

SyncIntegrationManager() public method

Creates a new sync manager for a custom AppList file. Used for testing. Uses no mutex!
A problem occurs while accessing the file. Read or write access to the file is not permitted or another desktop integration class is currently active. A problem occurs while deserializing the XML data.
public SyncIntegrationManager ( [ appListPath, SyncServer server, Feed>.[ feedRetriever, [ handler, bool machineWide = false ) : System
appListPath [ The storage location of the file.
server SyncServer Access information for the sync server.
feedRetriever Feed>.[ Callback method used to retrieve additional s on demand.
handler [ A callback object used when the the user is to be informed about the progress of long-running operations such as downloads.
machineWide bool Apply operations machine-wide instead of just for the current user.
return System