Interface IProfileService
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
FocusProfileElement
Gets or sets the profile element which is rendered exclusively.
ProfileElement? FocusProfileElement { get; set; }
Property Value
ProfileCategories
Gets a read only collection containing all the profile categories.
ReadOnlyCollection<ProfileCategory> ProfileCategories { get; }
Property Value
ProfileRenderingDisabled
Gets or sets whether profiles are rendered each frame by calling their Render method
bool ProfileRenderingDisabled { get; set; }
Property Value
UpdateFocusProfile
Gets or sets a value indicating whether the currently focused profile should receive updates.
bool UpdateFocusProfile { get; set; }
Property Value
Methods
ActivateProfile(ProfileConfiguration)
Activates the profile of the given ProfileConfiguration with the currently active surface.
Profile ActivateProfile(ProfileConfiguration profileConfiguration)
Parameters
profileConfigurationProfileConfigurationThe profile configuration of the profile to activate.
Returns
AdaptProfile(Profile)
Adapts a given profile to the currently active devices.
void AdaptProfile(Profile profile)
Parameters
profileProfileThe profile to adapt.
CloneProfileConfiguration(ProfileConfiguration)
Creates a copy of the provided profile configuration.
ProfileConfiguration CloneProfileConfiguration(ProfileConfiguration profileConfiguration)
Parameters
profileConfigurationProfileConfigurationThe 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
namestringThe name of the new profile category, must be unique.
addToTopboolA 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
categoryProfileCategoryThe profile category to add the profile to.
namestringThe name of the new profile configuration.
iconstringThe 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
profileConfigurationProfileConfigurationThe profile configuration of the profile to activate.
DeleteProfileCategory(ProfileCategory)
Permanently deletes the provided profile category.
void DeleteProfileCategory(ProfileCategory profileCategory)
Parameters
profileCategoryProfileCategory
ExportProfile(ProfileConfiguration)
Exports the profile described in the given ProfileConfiguration into a zip archive.
Task<Stream> ExportProfile(ProfileConfiguration profileConfiguration)
Parameters
profileConfigurationProfileConfigurationThe profile configuration of the profile to export.
Returns
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
archiveStreamStreamThe zip archive containing the profile to import.
categoryProfileCategoryThe ProfileCategory in which to import the profile.
makeUniqueboolWhether or not to give the profile a new GUID, making it unique.
markAsFreshImportboolWhether or not to mark the profile as a fresh import, causing it to be adapted until any changes are made to it.
nameAffixstringText to add after the name of the profile (separated by a dash).
targetProfileConfigurationThe 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
profileConfigurationProfileConfiguration
RenderProfiles(SKCanvas)
Renders all currently active profiles.
void RenderProfiles(SKCanvas canvas)
Parameters
canvasSKCanvas
SaveProfile(Profile, bool)
Writes the profile to persistent storage.
void SaveProfile(Profile profile, bool includeChildren)
Parameters
SaveProfileCategory(ProfileCategory)
Saves the provided ProfileCategory and it's ProfileConfigurations but not the Profiles themselves.
void SaveProfileCategory(ProfileCategory profileCategory)
Parameters
profileCategoryProfileCategoryThe profile category to update.
UpdateProfiles(double)
Updates all currently active profiles
void UpdateProfiles(double deltaTime)
Parameters
deltaTimedouble
Events
ProfileActivated
Occurs whenever a profile has been activated.
event EventHandler<ProfileConfigurationEventArgs>? ProfileActivated
Event Type
ProfileAdded
Occurs whenever a profile is removed.
event EventHandler<ProfileConfigurationEventArgs>? ProfileAdded
Event Type
ProfileCategoryAdded
Occurs whenever a profile category is added.
event EventHandler<ProfileCategoryEventArgs>? ProfileCategoryAdded
Event Type
ProfileCategoryRemoved
Occurs whenever a profile category is removed.
event EventHandler<ProfileCategoryEventArgs>? ProfileCategoryRemoved
Event Type
ProfileDeactivated
Occurs whenever a profile has been deactivated.
event EventHandler<ProfileConfigurationEventArgs>? ProfileDeactivated
Event Type
ProfileRemoved
Occurs whenever a profile is added.
event EventHandler<ProfileConfigurationEventArgs>? ProfileRemoved