Table of Contents

Interface IProfileService

Namespace
Artemis.Core.Services
Assembly
Artemis.Core.dll

Provides access to profile storage and is responsible for activating default profiles.

public interface IProfileService

Properties

FocusProfile

Gets or sets the focused profile configuration which is rendered exclusively.

ProfileConfiguration? FocusProfile { get; set; }

Property Value

ProfileConfiguration

FocusProfileElement

Gets or sets the profile element which is rendered exclusively.

ProfileElement? FocusProfileElement { get; set; }

Property Value

ProfileElement

ProfileCategories

Gets a read only collection containing all the profile categories.

ReadOnlyCollection<ProfileCategory> ProfileCategories { get; }

Property Value

ReadOnlyCollection<ProfileCategory>

ProfileRenderingDisabled

Gets or sets whether profiles are rendered each frame by calling their Render method

bool ProfileRenderingDisabled { get; set; }

Property Value

bool

UpdateFocusProfile

Gets or sets a value indicating whether the currently focused profile should receive updates.

bool UpdateFocusProfile { get; set; }

Property Value

bool

Methods

ActivateProfile(ProfileConfiguration)

Activates the profile of the given ProfileConfiguration with the currently active surface.

Profile ActivateProfile(ProfileConfiguration profileConfiguration)

Parameters

profileConfiguration ProfileConfiguration

The profile configuration of the profile to activate.

Returns

Profile

AdaptProfile(Profile)

Adapts a given profile to the currently active devices.

void AdaptProfile(Profile profile)

Parameters

profile Profile

The profile to adapt.

CloneProfileConfiguration(ProfileConfiguration)

Creates a copy of the provided profile configuration.

ProfileConfiguration CloneProfileConfiguration(ProfileConfiguration profileConfiguration)

Parameters

profileConfiguration ProfileConfiguration

The profile configuration to clone.

Returns

ProfileConfiguration

The resulting clone.

CreateProfileCategory(string, bool)

Creates a new profile category and saves it to persistent storage.

ProfileCategory CreateProfileCategory(string name, bool addToTop = false)

Parameters

name string

The name of the new profile category, must be unique.

addToTop bool

A boolean indicating whether or not to add the category to the top.

Returns

ProfileCategory

The newly created profile category.

CreateProfileConfiguration(ProfileCategory, string, string)

Creates a new profile configuration and adds it to the provided ProfileCategory.

ProfileConfiguration CreateProfileConfiguration(ProfileCategory category, string name, string icon)

Parameters

category ProfileCategory

The profile category to add the profile to.

name string

The name of the new profile configuration.

icon string

The icon of the new profile configuration.

Returns

ProfileConfiguration

The newly created profile configuration.

DeactivateProfile(ProfileConfiguration)

Deactivates the profile of the given ProfileConfiguration with the currently active surface.

void DeactivateProfile(ProfileConfiguration profileConfiguration)

Parameters

profileConfiguration ProfileConfiguration

The profile configuration of the profile to activate.

DeleteProfileCategory(ProfileCategory)

Permanently deletes the provided profile category.

void DeleteProfileCategory(ProfileCategory profileCategory)

Parameters

profileCategory ProfileCategory

ExportProfile(ProfileConfiguration)

Exports the profile described in the given ProfileConfiguration into a zip archive.

Task<Stream> ExportProfile(ProfileConfiguration profileConfiguration)

Parameters

profileConfiguration ProfileConfiguration

The profile configuration of the profile to export.

Returns

Task<Stream>

The resulting zip archive.

ImportProfile(Stream, ProfileCategory, bool, bool, string?, ProfileConfiguration?)

Imports the provided ZIP archive stream as a profile configuration.

Task<ProfileConfiguration> ImportProfile(Stream archiveStream, ProfileCategory category, bool makeUnique, bool markAsFreshImport, string? nameAffix = "imported", ProfileConfiguration? target = null)

Parameters

archiveStream Stream

The zip archive containing the profile to import.

category ProfileCategory

The ProfileCategory in which to import the profile.

makeUnique bool

Whether or not to give the profile a new GUID, making it unique.

markAsFreshImport bool

Whether or not to mark the profile as a fresh import, causing it to be adapted until any changes are made to it.

nameAffix string

Text to add after the name of the profile (separated by a dash).

target ProfileConfiguration

The profile before which to import the profile into the category.

Returns

Task<ProfileConfiguration>

The resulting profile configuration.

RemoveProfileConfiguration(ProfileConfiguration)

Removes the provided profile configuration from the ProfileCategory.

void RemoveProfileConfiguration(ProfileConfiguration profileConfiguration)

Parameters

profileConfiguration ProfileConfiguration

RenderProfiles(SKCanvas)

Renders all currently active profiles.

void RenderProfiles(SKCanvas canvas)

Parameters

canvas SKCanvas

SaveProfile(Profile, bool)

Writes the profile to persistent storage.

void SaveProfile(Profile profile, bool includeChildren)

Parameters

profile Profile
includeChildren bool

SaveProfileCategory(ProfileCategory)

Saves the provided ProfileCategory and it's ProfileConfigurations but not the Profiles themselves.

void SaveProfileCategory(ProfileCategory profileCategory)

Parameters

profileCategory ProfileCategory

The profile category to update.

UpdateProfiles(double)

Updates all currently active profiles

void UpdateProfiles(double deltaTime)

Parameters

deltaTime double

Events

ProfileActivated

Occurs whenever a profile has been activated.

event EventHandler<ProfileConfigurationEventArgs>? ProfileActivated

Event Type

EventHandler<ProfileConfigurationEventArgs>

ProfileAdded

Occurs whenever a profile is removed.

event EventHandler<ProfileConfigurationEventArgs>? ProfileAdded

Event Type

EventHandler<ProfileConfigurationEventArgs>

ProfileCategoryAdded

Occurs whenever a profile category is added.

event EventHandler<ProfileCategoryEventArgs>? ProfileCategoryAdded

Event Type

EventHandler<ProfileCategoryEventArgs>

ProfileCategoryRemoved

Occurs whenever a profile category is removed.

event EventHandler<ProfileCategoryEventArgs>? ProfileCategoryRemoved

Event Type

EventHandler<ProfileCategoryEventArgs>

ProfileDeactivated

Occurs whenever a profile has been deactivated.

event EventHandler<ProfileConfigurationEventArgs>? ProfileDeactivated

Event Type

EventHandler<ProfileConfigurationEventArgs>

ProfileRemoved

Occurs whenever a profile is added.

event EventHandler<ProfileConfigurationEventArgs>? ProfileRemoved

Event Type

EventHandler<ProfileConfigurationEventArgs>