Class ScreenshotManager
Manager for Screenshots.
Inheritance
Implements
Inherited Members
Namespace: Phoenix.Screenshot
Assembly: Phoenix.Plugin.Screenshot.dll
Syntax
public class ScreenshotManager : IScreenshotManager
Constructors
View SourceScreenshotManager(IEventAggregator, IPhoenixLogger, IDeviceManager, ISettingsManager)
Initializes a new instance of the ScreenshotManager class.
Declaration
public ScreenshotManager(IEventAggregator eventAggregator, IPhoenixLogger logger, IDeviceManager deviceManager, ISettingsManager settingsManager)
Parameters
Type | Name | Description |
---|---|---|
IEventAggregator | eventAggregator | The event aggregator for the application. |
IPhoenixLogger | logger | The logger for the application. |
IDeviceManager | deviceManager | Used to get any devices already created. |
ISettingsManager | settingsManager | The manager to get settings from. |
Properties
View SourceGlobalRefreshInterval
Gets the global refresh interval.
Declaration
public ScreenshotRefreshInterval GlobalRefreshInterval { get; }
Property Value
Type | Description |
---|---|
ScreenshotRefreshInterval |
IsAutomaticRefreshActive
Gets a value indicating whether or not screenshots are automatically refreshed.
Declaration
public bool IsAutomaticRefreshActive { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
UseSelectedDevices
Gets or sets a value indicating whether or not the global refresh uses only the selected devices.
Declaration
public bool UseSelectedDevices { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
View SourceAddAutomaticRefreshViewer(Object)
Adds a view of automatically refreshed screenshots.
Declaration
public void AddAutomaticRefreshViewer(object view)
Parameters
Type | Name | Description |
---|---|---|
System.Object | view | The view. |
Remarks
If this is the first view, automatic refreshing will be enabled.
GetLatestScreenshotAsync(IDevice)
Gets the latest screenshot regardless of age. If none is found, it takes a screenshot.
Declaration
public async Task<DeviceScreenshot> GetLatestScreenshotAsync(IDevice device)
Parameters
Type | Name | Description |
---|---|---|
IDevice | device | The screenshot device. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DeviceScreenshot> | The screenshot. |
GetRefreshInterval(IDevice)
Gets the refresh interval for a single device.
Declaration
public ScreenshotRefreshInterval GetRefreshInterval(IDevice device)
Parameters
Type | Name | Description |
---|---|---|
IDevice | device | The device whose interval is to be returned. |
Returns
Type | Description |
---|---|
ScreenshotRefreshInterval | The interval for the device |
RemoveAutomaticRefreshViewer(Object)
Deletes a view of automatically refreshed screenshots.
Declaration
public void RemoveAutomaticRefreshViewer(object view)
Parameters
Type | Name | Description |
---|---|---|
System.Object | view | The view. |
Remarks
If this is the only remaining view, automatic refreshing will be disabled.
SetCaptureParameters(IDevice, Object[])
Sets the capture parameters for a specific device.
Declaration
public void SetCaptureParameters(IDevice device, params object[] captureParameters)
Parameters
Type | Name | Description |
---|---|---|
IDevice | device | The device to set the capture parameters for. |
System.Object[] | captureParameters | The capture parameters. |
SetGlobalRefreshInterval(ScreenshotRefreshInterval)
Sets the global refresh interval that all devices will use when not overridden.
Declaration
public void SetGlobalRefreshInterval(ScreenshotRefreshInterval interval)
Parameters
Type | Name | Description |
---|---|---|
ScreenshotRefreshInterval | interval | The interval to set the global interval to. |
SetRefreshInterval(IDevice, ScreenshotRefreshInterval)
Sets the refresh interval for a single device.
Declaration
public void SetRefreshInterval(IDevice device, ScreenshotRefreshInterval interval)
Parameters
Type | Name | Description |
---|---|---|
IDevice | device | The device whose interval is to be set. |
ScreenshotRefreshInterval | interval | The new interval. |
TakeScreenshotAsync(IDevice, Int32)
Takes a screenshot.
Declaration
public async Task<DeviceScreenshot> TakeScreenshotAsync(IDevice device, int age)
Parameters
Type | Name | Description |
---|---|---|
IDevice | device | The device to take the screenshot. |
System.Int32 | age | Max age of the screenshot taken by the device in milliseconds. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DeviceScreenshot> | The screenshot. |
Remarks
Clamps to 100 milliseconds if age is less than 100 milliseconds. If the screenshot age older than this parameter, it will take a new screenshot. Otherwise it will ignore this parameter and get a recently taken screenshot or take a new one.