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

Manages an AppList and desktop integration via AccessPoints. More...

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

Public Member Functions

 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 Member Functions

static string GetDir (bool machineWide, params string[] resource)
 Returns a path for a directory that can be used for desktop integration. More...
 

Static Public Attributes

static readonly int ChangedWindowMessageID = WindowsUtils.RegisterWindowMessage("ZeroInstall.DesktopIntegration")
 The window message ID (for use with WindowsUtils.BroadcastMessage) that signals integration changes to interested observers.
 

Protected Member Functions

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

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

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

Manages an AppList and desktop integration via AccessPoints.

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

◆ IntegrationManager()

ZeroInstall.DesktopIntegration.IntegrationManager.IntegrationManager ( Config  config,
ITaskHandler  handler,
bool  machineWide = false 
)
inline

Creates a new integration manager using the default DesktopIntegration.AppList (creating a new one if missing). Performs Mutex-based locking!

Parameters
configUser settings controlling network behaviour.
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

◆ AddAccessPointsInternal()

override void ZeroInstall.DesktopIntegration.IntegrationManager.AddAccessPointsInternal ( AppEntry  appEntry,
Feed  feed,
IReadOnlyCollection< AccessPoint accessPoints 
)
inlineprotectedvirtual

Applies AccessPoints for an application.

Implements ZeroInstall.DesktopIntegration.IntegrationManagerBase.

◆ AddAppInternal() [1/3]

override void ZeroInstall.DesktopIntegration.IntegrationManager.AddAppInternal ( AppEntry  prototype,
Converter< FeedUri, Feed feedRetriever 
)
inlineprotectedvirtual

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

Implements ZeroInstall.DesktopIntegration.IntegrationManagerBase.

◆ AddAppInternal() [2/3]

override AppEntry ZeroInstall.DesktopIntegration.IntegrationManager.AddAppInternal ( FeedTarget  target)
inlineprotectedvirtual

Creates a new unnamed AppEntry and adds it to the AppList.

Implements ZeroInstall.DesktopIntegration.IntegrationManagerBase.

◆ AddAppInternal() [3/3]

override AppEntry ZeroInstall.DesktopIntegration.IntegrationManager.AddAppInternal ( string  petName,
Requirements  requirements,
Feed  feed 
)
inlineprotectedvirtual

Creates a new named AppEntry and adds it to the AppList.

Implements ZeroInstall.DesktopIntegration.IntegrationManagerBase.

◆ Finish()

override void ZeroInstall.DesktopIntegration.IntegrationManager.Finish ( )
inlineprotectedvirtual

To be called after integration operations have been completed to inform the desktop environment and save the DesktopIntegration.AppList.

Implements ZeroInstall.DesktopIntegration.IntegrationManagerBase.

◆ GetDir()

static string ZeroInstall.DesktopIntegration.IntegrationManager.GetDir ( bool  machineWide,
params string[]  resource 
)
static

Returns a path for a directory that can be used for desktop integration.

Parameters
machineWidetrue if the directory should be machine-wide and machine-specific instead of roaming with the user profile.
resourceThe directory name of the resource to be stored.
Returns
A fully qualified directory path. The directory is guaranteed to already exist.
Exceptions
IOExceptionA problem occurred while creating a directory.
UnauthorizedAccessExceptionCreating a directory is not permitted.

If a new directory is created with machineWide set to true on Windows, ACLs are set to deny write access for non-Administrator users.

◆ RemoveAccessPointsInternal()

override void ZeroInstall.DesktopIntegration.IntegrationManager.RemoveAccessPointsInternal ( AppEntry  appEntry,
IEnumerable< AccessPoint accessPoints 
)
inlineprotectedvirtual

Removes already applied AccessPoints for an application.

Implements ZeroInstall.DesktopIntegration.IntegrationManagerBase.

◆ RemoveAppInternal()

override void ZeroInstall.DesktopIntegration.IntegrationManager.RemoveAppInternal ( AppEntry  appEntry)
inlineprotectedvirtual

Removes an AppEntry from the AppList while unapplying any remaining AccessPoints.

Implements ZeroInstall.DesktopIntegration.IntegrationManagerBase.

◆ RepairAppInternal()

override void ZeroInstall.DesktopIntegration.IntegrationManager.RepairAppInternal ( AppEntry  appEntry,
Feed  feed 
)
inlineprotectedvirtual

Reapplies all AccessPoints for a specific AppEntry.

Implements ZeroInstall.DesktopIntegration.IntegrationManagerBase.

◆ UpdateAppInternal()

override void ZeroInstall.DesktopIntegration.IntegrationManager.UpdateAppInternal ( AppEntry  appEntry,
Feed  feed 
)
inlineprotectedvirtual

Updates an AppEntry with new metadata and capabilities from a Feed. This may unapply and remove some existing AccessPoints.

Implements ZeroInstall.DesktopIntegration.IntegrationManagerBase.


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