Interface IProfileService
Provides access to profile storage and is responsible for activating default profiles.
Namespace: Artemis.Core.Services
Assembly: Artemis.Core.dll
Syntax
public interface IProfileService
Properties
ExportSettings
Gets the JSON serializer settings used to import/export profiles.
Declaration
public static JsonSerializerSettings ExportSettings { get; }
Property Value
Type | Description |
---|---|
JsonSerializerSettings |
FocusProfile
Gets or sets the focused profile configuration which is rendered exclusively.
Declaration
ProfileConfiguration? FocusProfile { get; set; }
Property Value
Type | Description |
---|---|
ProfileConfiguration |
FocusProfileElement
Gets or sets the profile element which is rendered exclusively.
Declaration
ProfileElement? FocusProfileElement { get; set; }
Property Value
Type | Description |
---|---|
ProfileElement |
ProfileCategories
Gets a read only collection containing all the profile categories.
Declaration
ReadOnlyCollection<ProfileCategory> ProfileCategories { get; }
Property Value
Type | Description |
---|---|
ReadOnlyCollection<ProfileCategory> |
ProfileConfigurations
Gets a read only collection containing all the profile configurations.
Declaration
ReadOnlyCollection<ProfileConfiguration> ProfileConfigurations { get; }
Property Value
Type | Description |
---|---|
ReadOnlyCollection<ProfileConfiguration> |
UpdateFocusProfile
Gets or sets a value indicating whether the currently focused profile should receive updates.
Declaration
bool UpdateFocusProfile { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
ActivateProfile(ProfileConfiguration)
Activates the profile of the given ProfileConfiguration with the currently active surface.
Declaration
Profile ActivateProfile(ProfileConfiguration profileConfiguration)
Parameters
Type | Name | Description |
---|---|---|
ProfileConfiguration | profileConfiguration | The profile configuration of the profile to activate. |
Returns
Type | Description |
---|---|
Profile |
AdaptProfile(Profile)
Adapts a given profile to the currently active devices.
Declaration
void AdaptProfile(Profile profile)
Parameters
Type | Name | Description |
---|---|---|
Profile | profile | The profile to adapt. |
CloneProfileConfiguration(ProfileConfiguration)
Creates a copy of the provided profile configuration.
Declaration
ProfileConfiguration CloneProfileConfiguration(ProfileConfiguration profileConfiguration)
Parameters
Type | Name | Description |
---|---|---|
ProfileConfiguration | profileConfiguration | The profile configuration to clone. |
Returns
Type | Description |
---|---|
ProfileConfiguration | The resulting clone. |
CreateProfileCategory(string, bool)
Creates a new profile category and saves it to persistent storage.
Declaration
ProfileCategory CreateProfileCategory(string name, bool addToTop = false)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the new profile category, must be unique. |
bool | addToTop | A boolean indicating whether or not to add the category to the top. |
Returns
Type | Description |
---|---|
ProfileCategory | The newly created profile category. |
CreateProfileConfiguration(ProfileCategory, string, string)
Creates a new profile configuration and adds it to the provided ProfileCategory.
Declaration
ProfileConfiguration CreateProfileConfiguration(ProfileCategory category, string name, string icon)
Parameters
Type | Name | Description |
---|---|---|
ProfileCategory | category | The profile category to add the profile to. |
string | name | The name of the new profile configuration. |
string | icon | The icon of the new profile configuration. |
Returns
Type | Description |
---|---|
ProfileConfiguration | The newly created profile configuration. |
DeactivateProfile(ProfileConfiguration)
Deactivates the profile of the given ProfileConfiguration with the currently active surface.
Declaration
void DeactivateProfile(ProfileConfiguration profileConfiguration)
Parameters
Type | Name | Description |
---|---|---|
ProfileConfiguration | profileConfiguration | The profile configuration of the profile to activate. |
DeleteProfile(ProfileConfiguration)
Permanently deletes the profile of the given ProfileConfiguration.
Declaration
void DeleteProfile(ProfileConfiguration profileConfiguration)
Parameters
Type | Name | Description |
---|---|---|
ProfileConfiguration | profileConfiguration | The profile configuration of the profile to delete. |
DeleteProfileCategory(ProfileCategory)
Permanently deletes the provided profile category.
Declaration
void DeleteProfileCategory(ProfileCategory profileCategory)
Parameters
Type | Name | Description |
---|---|---|
ProfileCategory | profileCategory |
ExportProfile(ProfileConfiguration)
Exports the profile described in the given ProfileConfiguration into a zip archive.
Declaration
Task<Stream> ExportProfile(ProfileConfiguration profileConfiguration)
Parameters
Type | Name | Description |
---|---|---|
ProfileConfiguration | profileConfiguration | The profile configuration of the profile to export. |
Returns
Type | Description |
---|---|
Task<Stream> | The resulting zip archive. |
ImportProfile(Stream, ProfileCategory, bool, bool, string?, int)
Imports the provided ZIP archive stream as a profile configuration.
Declaration
Task<ProfileConfiguration> ImportProfile(Stream archiveStream, ProfileCategory category, bool makeUnique, bool markAsFreshImport, string? nameAffix = "imported", int targetIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
Stream | archiveStream | The zip archive containing the profile to import. |
ProfileCategory | category | The ProfileCategory in which to import the profile. |
bool | makeUnique | Whether or not to give the profile a new GUID, making it unique. |
bool | markAsFreshImport | Whether or not to mark the profile as a fresh import, causing it to be adapted until any changes are made to it. |
string | nameAffix | Text to add after the name of the profile (separated by a dash). |
int | targetIndex | The index at which to import the profile into the category. |
Returns
Type | Description |
---|---|
Task<ProfileConfiguration> | The resulting profile configuration. |
LoadProfileConfigurationIcon(ProfileConfiguration)
Loads the icon of this profile configuration if needed and puts it into ProfileConfiguration.Icon.FileIcon
.
Declaration
void LoadProfileConfigurationIcon(ProfileConfiguration profileConfiguration)
Parameters
Type | Name | Description |
---|---|---|
ProfileConfiguration | profileConfiguration |
OverwriteProfile(MemoryStream, ProfileConfiguration)
Imports the provided ZIP archive stream into the provided profile configuration
Declaration
Task<ProfileConfiguration> OverwriteProfile(MemoryStream archiveStream, ProfileConfiguration profileConfiguration)
Parameters
Type | Name | Description |
---|---|---|
MemoryStream | archiveStream | The zip archive containing the profile to import. |
ProfileConfiguration | profileConfiguration | The profile configuration to overwrite. |
Returns
Type | Description |
---|---|
Task<ProfileConfiguration> | The resulting profile configuration. |
RemoveProfileConfiguration(ProfileConfiguration)
Removes the provided profile configuration from the ProfileCategory.
Declaration
void RemoveProfileConfiguration(ProfileConfiguration profileConfiguration)
Parameters
Type | Name | Description |
---|---|---|
ProfileConfiguration | profileConfiguration |
RenderProfiles(SKCanvas)
Renders all currently active profiles.
Declaration
void RenderProfiles(SKCanvas canvas)
Parameters
Type | Name | Description |
---|---|---|
SKCanvas | canvas |
SaveProfile(Profile, bool)
Writes the profile to persistent storage.
Declaration
void SaveProfile(Profile profile, bool includeChildren)
Parameters
Type | Name | Description |
---|---|---|
Profile | profile | |
bool | includeChildren |
SaveProfileCategory(ProfileCategory)
Saves the provided ProfileCategory and it's ProfileConfigurations but not the Profiles themselves.
Declaration
void SaveProfileCategory(ProfileCategory profileCategory)
Parameters
Type | Name | Description |
---|---|---|
ProfileCategory | profileCategory | The profile category to update. |
SaveProfileConfigurationIcon(ProfileConfiguration)
Saves the current icon of this profile.
Declaration
void SaveProfileConfigurationIcon(ProfileConfiguration profileConfiguration)
Parameters
Type | Name | Description |
---|---|---|
ProfileConfiguration | profileConfiguration |
UpdateProfiles(double)
Updates all currently active profiles
Declaration
void UpdateProfiles(double deltaTime)
Parameters
Type | Name | Description |
---|---|---|
double | deltaTime |
Events
ProfileActivated
Occurs whenever a profile has been activated.
Declaration
event EventHandler<ProfileConfigurationEventArgs>? ProfileActivated
Event Type
Type | Description |
---|---|
EventHandler<ProfileConfigurationEventArgs> |
ProfileCategoryAdded
Occurs whenever a profile category is added.
Declaration
event EventHandler<ProfileCategoryEventArgs>? ProfileCategoryAdded
Event Type
Type | Description |
---|---|
EventHandler<ProfileCategoryEventArgs> |
ProfileCategoryRemoved
Occurs whenever a profile category is removed.
Declaration
event EventHandler<ProfileCategoryEventArgs>? ProfileCategoryRemoved
Event Type
Type | Description |
---|---|
EventHandler<ProfileCategoryEventArgs> |
ProfileDeactivated
Occurs whenever a profile has been deactivated.
Declaration
event EventHandler<ProfileConfigurationEventArgs>? ProfileDeactivated
Event Type
Type | Description |
---|---|
EventHandler<ProfileConfigurationEventArgs> |