Zero Install .NET API 2.20.0
ZeroInstall.DesktopIntegration.SyncIntegrationManager Class Reference

Synchronizes the AppList with other computers. More...

Inheritance diagram for ZeroInstall.DesktopIntegration.SyncIntegrationManager:
ZeroInstall.DesktopIntegration.IntegrationManager ZeroInstall.DesktopIntegration.IntegrationManagerBase ZeroInstall.Store.ManagerBase ZeroInstall.DesktopIntegration.IIntegrationManager

Public Member Functions

 SyncIntegrationManager (Config config, Converter< FeedUri, Feed > feedRetriever, ITaskHandler handler, bool machineWide=false)
 Creates a new sync manager. Performs Mutex-based locking! More...
 
void Sync (SyncResetMode resetMode=SyncResetMode.None)
 Synchronize the AppList with the sync server and (un)apply AccessPoints accordingly. More...
 
- Public Member Functions inherited from ZeroInstall.DesktopIntegration.IntegrationManager
 IntegrationManager (Config config, ITaskHandler handler, bool machineWide=false)
 Creates a new integration manager using the default DesktopIntegration.AppList (creating a new one if missing). Performs Mutex-based locking! More...
 
- Public Member Functions inherited from ZeroInstall.DesktopIntegration.IntegrationManagerBase
AppEntry AddApp (FeedTarget target)
 Creates a new unnamed AppEntry and adds it to the AppList. More...
 
AppEntry AddApp (string petName, Requirements requirements, Feed feed)
 Creates a new named AppEntry and adds it to the AppList. More...
 
void RemoveApp (AppEntry appEntry)
 Removes an AppEntry from the AppList while unapplying any remaining AccessPoints. More...
 
void UpdateApp (AppEntry appEntry, Feed feed)
 Updates an AppEntry with new metadata and capabilities from a Feed. This may unapply and remove some existing AccessPoints. More...
 
void UpdateApp (AppEntry appEntry, Feed feed, Requirements requirements)
 Updates a named AppEntry with new Requirements. More...
 
void AddAccessPoints (AppEntry appEntry, Feed feed, IEnumerable< AccessPoint > accessPoints)
 Applies AccessPoints for an application. More...
 
void RemoveAccessPoints (AppEntry appEntry, IEnumerable< AccessPoint > accessPoints)
 Removes already applied AccessPoints for an application. More...
 
void Repair (Converter< FeedUri, Feed > feedRetriever)
 Reapplies all AccessPoints for all AppEntrys. More...
 
- Public Member Functions inherited from ZeroInstall.Store.ManagerBase
void Dispose ()
 Releases the mutex.
 

Static Public Attributes

const string AppListLastSyncSuffix = ".last-sync"
 The suffix added to the AppList path to store a copy of the state at the last sync point.
 
- Static Public Attributes inherited from ZeroInstall.DesktopIntegration.IntegrationManager
static readonly int ChangedWindowMessageID = WindowsUtils.RegisterWindowMessage("ZeroInstall.DesktopIntegration")
 The window message ID (for use with WindowsUtils.BroadcastMessage) that signals integration changes to interested observers.
 

Additional Inherited Members

- Static Public Member Functions inherited from ZeroInstall.DesktopIntegration.IntegrationManager
static string GetDir (bool machineWide, params string[] resource)
 Returns a path for a directory that can be used for desktop integration. More...
 
- Protected Member Functions inherited from ZeroInstall.DesktopIntegration.IntegrationManager
override AppEntry AddAppInternal (FeedTarget target)
 Creates a new unnamed AppEntry and adds it to the AppList. More...
 
override AppEntry AddAppInternal (string petName, Requirements requirements, Feed feed)
 Creates a new named AppEntry and adds it to the AppList. More...
 
override void AddAppInternal (AppEntry prototype, Converter< FeedUri, Feed > feedRetriever)
 Creates a new AppEntry based on an existing prototype (applying any AccessPoints) and adds it to the AppList. More...
 
override void RemoveAppInternal (AppEntry appEntry)
 Removes an AppEntry from the AppList while unapplying any remaining AccessPoints. More...
 
override void UpdateAppInternal (AppEntry appEntry, Feed feed)
 Updates an AppEntry with new metadata and capabilities from a Feed. This may unapply and remove some existing AccessPoints. More...
 
override void AddAccessPointsInternal (AppEntry appEntry, Feed feed, IReadOnlyCollection< AccessPoint > accessPoints)
 Applies AccessPoints for an application. More...
 
override void RemoveAccessPointsInternal (AppEntry appEntry, IEnumerable< AccessPoint > accessPoints)
 Removes already applied AccessPoints for an application. More...
 
override void RepairAppInternal (AppEntry appEntry, Feed feed)
 Reapplies all AccessPoints for a specific AppEntry. More...
 
override void Finish ()
 To be called after integration operations have been completed to inform the desktop environment and save the DesktopIntegration.AppList. More...
 
- Protected Member Functions inherited from ZeroInstall.DesktopIntegration.IntegrationManagerBase
 IntegrationManagerBase (ITaskHandler handler, bool machineWide=false)
 Creates a new integration manager. More...
 
- Protected Member Functions inherited from ZeroInstall.Store.ManagerBase
void AcquireMutex ()
 Tries to acquire a mutex with the name MutexName. Call this at the end of your constructors. More...
 
- Protected Attributes inherited from ZeroInstall.DesktopIntegration.IntegrationManager
readonly Config Config
 User settings controlling network behaviour.
 
readonly string AppListPath
 The storage location of the AppList file.
 
- Protected Attributes inherited from ZeroInstall.Store.ManagerBase
readonly ITaskHandler Handler
 A callback object used when the the user needs to be asked questions or informed about download and IO tasks.
 
- Properties inherited from ZeroInstall.DesktopIntegration.IntegrationManager
override string MutexName [get]
 The name of the cross-process mutex used to signal that a desktop integration process class is currently active.
 
- Properties inherited from ZeroInstall.DesktopIntegration.IntegrationManagerBase
AppList AppList = default! [get]
 Stores a list of applications and their desktop integrations. Only use for read-access externally! Use this class' methods for any modifications.
 
- Properties inherited from ZeroInstall.Store.ManagerBase
bool MachineWide [get]
 Apply operations machine-wide instead of just for the current user.
 
abstract string MutexName [get]
 The name of the cross-process mutex used by AcquireMutex.
 
- Properties inherited from ZeroInstall.DesktopIntegration.IIntegrationManager
AppList AppList [get]
 Stores a list of applications and their desktop integrations. Only use for read-access externally! Use this class' methods for any modifications.
 
bool MachineWide [get]
 Apply operations machine-wide instead of just for the current user.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ SyncIntegrationManager()

ZeroInstall.DesktopIntegration.SyncIntegrationManager.SyncIntegrationManager ( Config  config,
Converter< FeedUri, Feed feedRetriever,
ITaskHandler  handler,
bool  machineWide = false 
)
inline

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

Parameters
configConfiguration for communicating with a sync server.
feedRetrieverCallback method used to retrieve additional Feeds on demand.
handlerA callback object used when the the user is to be informed about the progress of long-running operations such as downloads.
machineWideApply operations machine-wide instead of just for the current user.
Exceptions
IOExceptionA problem occurred while accessing the AppList file.
UnauthorizedAccessExceptionRead or write access to the AppList file is not permitted or another desktop integration class is currently active.
InvalidDataExceptionA problem occurred while deserializing the XML data.

Member Function Documentation

◆ Sync()

void ZeroInstall.DesktopIntegration.SyncIntegrationManager.Sync ( SyncResetMode  resetMode = SyncResetMode.None)
inline

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

Parameters
resetModeControls how synchronization data is reset.
Exceptions
OperationCanceledExceptionThe user canceled the task.
InvalidDataExceptionA problem occurred while deserializing the XML data or the specified crypto key was wrong.
KeyNotFoundExceptionAn AccessPoint reference to a Capability is invalid.
ConflictExceptionOne or more new AccessPoint would cause a conflict with the existing AccessPoints in AppList.
WebExceptionA problem occurred while communicating with the sync server or while downloading additional data (such as icons).
IOExceptionA problem occurs while writing to the filesystem or registry.
UnauthorizedAccessExceptionWrite access to the filesystem or registry is not permitted.

The documentation for this class was generated from the following file: