Class IntegrationManager
Manages an AppList and desktop integration via AccessPoints.
Inheritance
Inherited Members
Namespace: ZeroInstall.DesktopIntegration
Assembly: ZeroInstall.DesktopIntegration.dll
Syntax
public class IntegrationManager : IntegrationManagerBase, IIntegrationManager
Remarks
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 Dispose().
Constructors
IntegrationManager(Config, ITaskHandler, Boolean)
Creates a new integration manager using the default AppList (creating a new one if missing). Performs Mutex-based locking!
Declaration
public IntegrationManager(Config config, ITaskHandler handler, bool machineWide = false)
Parameters
Type | Name | Description |
---|---|---|
Config | config | User settings controlling network behaviour. |
ITaskHandler | handler | A callback object used when the the user is to be informed about the progress of long-running operations such as downloads. |
Boolean | machineWide | Apply operations machine-wide instead of just for the current user. |
Exceptions
Type | Condition |
---|---|
IOException | A problem occurred while accessing the AppList file. |
UnauthorizedAccessException | Read or write access to the AppList file is not permitted or another desktop integration class is currently active. |
InvalidDataException | A problem occurred while deserializing an XML file. |
Fields
AppListPath
The storage location of the AppList file.
Declaration
protected readonly string AppListPath
Field Value
Type | Description |
---|---|
String |
ChangedWindowMessageID
The window message ID (for use with BroadcastMessage(Int32)) that signals integration changes to interested observers.
Declaration
public static readonly int ChangedWindowMessageID
Field Value
Type | Description |
---|---|
Int32 |
Config
User settings controlling network behaviour.
Declaration
protected readonly Config Config
Field Value
Type | Description |
---|---|
Config |
Properties
MutexName
The name of the cross-process mutex used to signal that a desktop integration process class is currently active.
Declaration
protected override string MutexName { get; }
Property Value
Type | Description |
---|---|
String |
Overrides
Methods
AddAccessPointsInternal(AppEntry, Feed, IReadOnlyCollection<AccessPoint>)
Applies AccessPoints for an application.
Declaration
protected override void AddAccessPointsInternal(AppEntry appEntry, Feed feed, IReadOnlyCollection<AccessPoint> accessPoints)
Parameters
Type | Name | Description |
---|---|---|
AppEntry | appEntry | The application being integrated. |
Feed | feed | The feed providing additional metadata, icons, etc. for the application. |
IReadOnlyCollection<AccessPoint> | accessPoints | The access points to apply. |
Overrides
Exceptions
Type | Condition |
---|---|
ArgumentException | Entries from |
OperationCanceledException | The user canceled the task. |
KeyNotFoundException | An AccessPoint reference to a Capability is invalid. |
ConflictException | One or more of the |
WebException | A problem occurred while downloading additional data (such as icons). |
IOException | A problem occurred while writing to the filesystem or registry. |
UnauthorizedAccessException | Write access to the filesystem or registry is not permitted. |
AddAppInternal(String, Requirements, Feed)
Declaration
protected override AppEntry AddAppInternal(string petName, Requirements requirements, Feed feed)
Parameters
Type | Name | Description |
---|---|---|
String | petName | The user-defined pet-name of the application. |
Requirements | requirements | The requirements describing the application to add. |
Feed | feed | The feed providing additional metadata, capabilities, etc. for the application. |
Returns
Type | Description |
---|---|
AppEntry | The newly created application entry (already added to AppList). |
Overrides
Exceptions
Type | Condition |
---|---|
InvalidOperationException | An application with the same |
IOException | A problem occurred while writing to the filesystem or registry. |
UnauthorizedAccessException | Write access to the filesystem or registry is not permitted. |
AddAppInternal(AppEntry, Converter<FeedUri, Feed>)
Creates a new AppEntry based on an existing prototype (applying any AccessPoints) and adds it to the AppList.
Declaration
protected override void AddAppInternal(AppEntry prototype, Converter<FeedUri, Feed> feedRetriever)
Parameters
Type | Name | Description |
---|---|---|
AppEntry | prototype | An existing AppEntry to use as a prototype. |
Converter<FeedUri, Feed> | feedRetriever | Callback method used to retrieve additional Feeds on demand. |
Overrides
AddAppInternal(FeedTarget)
Declaration
protected override AppEntry AddAppInternal(FeedTarget target)
Parameters
Type | Name | Description |
---|---|---|
FeedTarget | target | The application to add. |
Returns
Type | Description |
---|---|
AppEntry | The newly created application entry (already added to AppList). |
Overrides
Exceptions
Type | Condition |
---|---|
InvalidOperationException | The application is already in the list. |
IOException | A problem occurred while writing to the filesystem or registry. |
UnauthorizedAccessException | Write access to the filesystem or registry is not permitted. |
Finish()
To be called after integration operations have been completed to inform the desktop environment and save the AppList.
Declaration
protected override void Finish()
Overrides
GetDir(Boolean, String[])
Returns a path for a directory that can be used for desktop integration.
Declaration
public static string GetDir(bool machineWide, params string[] resource)
Parameters
Type | Name | Description |
---|---|---|
Boolean | machineWide |
|
String[] | resource | The directory name of the resource to be stored. |
Returns
Type | Description |
---|---|
String | A fully qualified directory path. The directory is guaranteed to already exist. |
Remarks
If a new directory is created with machineWide
set to true
on Windows, ACLs are set to deny write access for non-Administrator users.
Exceptions
Type | Condition |
---|---|
IOException | A problem occurred while creating a directory. |
UnauthorizedAccessException | Creating a directory is not permitted. |
RemoveAccessPointsInternal(AppEntry, IEnumerable<AccessPoint>)
Removes already applied AccessPoints for an application.
Declaration
protected override void RemoveAccessPointsInternal(AppEntry appEntry, IEnumerable<AccessPoint> accessPoints)
Parameters
Type | Name | Description |
---|---|---|
AppEntry | appEntry | The AppEntry containing the |
IEnumerable<AccessPoint> | accessPoints | The access points to unapply. |
Overrides
Exceptions
Type | Condition |
---|---|
KeyNotFoundException | An AccessPoint reference to a Capability is invalid. |
IOException | A problem occurred while writing to the filesystem or registry. |
UnauthorizedAccessException | Write access to the filesystem or registry is not permitted. |
RemoveAppInternal(AppEntry)
Removes an AppEntry from the AppList while unapplying any remaining AccessPoints.
Declaration
protected override void RemoveAppInternal(AppEntry appEntry)
Parameters
Type | Name | Description |
---|---|---|
AppEntry | appEntry | The application to remove. |
Overrides
Exceptions
Type | Condition |
---|---|
KeyNotFoundException | An AccessPoint reference to a Capability is invalid. |
IOException | A problem occurred while writing to the filesystem or registry. |
UnauthorizedAccessException | Write access to the filesystem or registry is not permitted. |
RepairAppInternal(AppEntry, Feed)
Reapplies all AccessPoints for a specific AppEntry.
Declaration
protected override void RepairAppInternal(AppEntry appEntry, Feed feed)
Parameters
Type | Name | Description |
---|---|---|
AppEntry | appEntry | The application entry to repair. |
Feed | feed | The feed providing additional metadata, capabilities, etc. for the application. |
Overrides
Exceptions
Type | Condition |
---|---|
OperationCanceledException | The user canceled the task. |
ConflictException |
|
WebException | A problem occurred while downloading additional data (such as icons). |
IOException | A problem occurred while writing to the filesystem or registry. |
UnauthorizedAccessException | Write access to the filesystem or registry is not permitted. |
UpdateAppInternal(AppEntry, Feed)
Updates an AppEntry with new metadata and capabilities from a Feed. This may unapply and remove some existing AccessPoints.
Declaration
protected override void UpdateAppInternal(AppEntry appEntry, Feed feed)
Parameters
Type | Name | Description |
---|---|---|
AppEntry | appEntry | The application entry to update. |
Feed | feed | The feed providing additional metadata, capabilities, etc. for the application. |
Overrides
Exceptions
Type | Condition |
---|---|
KeyNotFoundException | An AccessPoint reference to a Capability is invalid. |