Interface IProfileEditorService
Provides access the the profile editor back-end logic.
Namespace: Artemis.UI.Shared.Services.ProfileEditor
Assembly: Artemis.UI.Shared.dll
Syntax
public interface IProfileEditorService : IArtemisSharedUIService
  Properties
FocusMode
Gets an observable of the suspended keybindings state.
Declaration
IObservable<ProfileEditorFocusMode> FocusMode { get; }
  Property Value
| Type | Description | 
|---|---|
| IObservable<ProfileEditorFocusMode> | 
History
Gets an observable of the current editor history.
Declaration
IObservable<ProfileEditorHistory?> History { get; }
  Property Value
| Type | Description | 
|---|---|
| IObservable<ProfileEditorHistory> | 
LayerProperty
Gets an observable of the currently selected layer property.
Declaration
IObservable<ILayerProperty?> LayerProperty { get; }
  Property Value
| Type | Description | 
|---|---|
| IObservable<ILayerProperty> | 
PixelsPerSecond
Gets an observable of the zoom level.
Declaration
IObservable<int> PixelsPerSecond { get; }
  Property Value
| Type | Description | 
|---|---|
| IObservable<int> | 
Playing
Gets an observable of the profile preview playing state.
Declaration
IObservable<bool> Playing { get; }
  Property Value
| Type | Description | 
|---|---|
| IObservable<bool> | 
ProfileConfiguration
Gets an observable of the currently selected profile configuration.
Declaration
IObservable<ProfileConfiguration?> ProfileConfiguration { get; }
  Property Value
| Type | Description | 
|---|---|
| IObservable<ProfileConfiguration> | 
ProfileElement
Gets an observable of the currently selected profile element.
Declaration
IObservable<RenderProfileElement?> ProfileElement { get; }
  Property Value
| Type | Description | 
|---|---|
| IObservable<RenderProfileElement> | 
SelectedKeyframes
Gets an observable read only collection of selected keyframes.
Declaration
ReadOnlyObservableCollection<ILayerPropertyKeyframe> SelectedKeyframes { get; }
  Property Value
| Type | Description | 
|---|---|
| ReadOnlyObservableCollection<ILayerPropertyKeyframe> | 
SuspendedEditing
Gets an observable of the suspended state.
Declaration
IObservable<bool> SuspendedEditing { get; }
  Property Value
| Type | Description | 
|---|---|
| IObservable<bool> | 
Time
Gets an observable of the profile preview playback time.
Declaration
IObservable<TimeSpan> Time { get; }
  Property Value
| Type | Description | 
|---|---|
| IObservable<TimeSpan> | 
Methods
ChangeCurrentLayerProperty(ILayerProperty?)
Change the selected layer property.
Declaration
void ChangeCurrentLayerProperty(ILayerProperty? layerProperty)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ILayerProperty | layerProperty | The layer property to select.  | 
      
ChangeCurrentProfileConfiguration(ProfileConfiguration?)
Changes the selected profile by its ProfileConfiguration.
Declaration
Task ChangeCurrentProfileConfiguration(ProfileConfiguration? profileConfiguration)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ProfileConfiguration | profileConfiguration | The profile configuration of the profile to select.  | 
      
Returns
| Type | Description | 
|---|---|
| Task | 
ChangeCurrentProfileElement(RenderProfileElement?)
Changes the selected profile element.
Declaration
void ChangeCurrentProfileElement(RenderProfileElement? renderProfileElement)
  Parameters
| Type | Name | Description | 
|---|---|---|
| RenderProfileElement | renderProfileElement | The profile element to select.  | 
      
ChangeFocusMode(ProfileEditorFocusMode)
Changes the current focus mode.
Declaration
void ChangeFocusMode(ProfileEditorFocusMode focusMode)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ProfileEditorFocusMode | focusMode | The new focus mode.  | 
      
ChangePixelsPerSecond(int)
Changes the current pixels per second
Declaration
void ChangePixelsPerSecond(int pixelsPerSecond)
  Parameters
| Type | Name | Description | 
|---|---|---|
| int | pixelsPerSecond | The new pixels per second.  | 
      
ChangeSuspendedEditing(bool)
Changes the current suspended state.
Declaration
void ChangeSuspendedEditing(bool suspend)
  Parameters
| Type | Name | Description | 
|---|---|---|
| bool | suspend | The new suspended state.  | 
      
ChangeTime(TimeSpan)
Changes the current profile preview playback time.
Declaration
void ChangeTime(TimeSpan time)
  Parameters
| Type | Name | Description | 
|---|---|---|
| TimeSpan | time | The new time.  | 
      
CreateAndAddFolder(ProfileElement)
Creates a new folder as a sibling or child of the given target.
Declaration
Folder CreateAndAddFolder(ProfileElement target)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ProfileElement | target | The target, if this is a layer the new layer will become a sibling, otherwise a child.  | 
      
Returns
| Type | Description | 
|---|---|
| Folder | The resulting folder.  | 
      
CreateAndAddLayer(ProfileElement)
Creates a new layer with the default brush and all current LEDs as a sibling or child of the given target.
Declaration
Layer CreateAndAddLayer(ProfileElement target)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ProfileElement | target | The target, if this is a layer the new layer will become a sibling, otherwise a child.  | 
      
Returns
| Type | Description | 
|---|---|
| Layer | The resulting layer.  | 
      
CreateCommandScope(string)
Creates a new command scope which can be used to group undo/redo actions of multiple commands.
Declaration
ProfileEditorCommandScope CreateCommandScope(string name)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | name | The name of the command scope.  | 
      
Returns
| Type | Description | 
|---|---|
| ProfileEditorCommandScope | The command scope that will group any commands until disposed.  | 
      
ExecuteCommand(IProfileEditorCommand)
Executes the provided command and adds it to the history.
Declaration
void ExecuteCommand(IProfileEditorCommand command)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IProfileEditorCommand | command | The command to execute.  | 
      
Pause()
Pauses profile preview playback.
Declaration
void Pause()
  Play()
Resumes profile preview playback.
Declaration
void Play()
  RoundTime(TimeSpan)
Rounds the given time to something appropriate for the current zoom level.
Declaration
TimeSpan RoundTime(TimeSpan time)
  Parameters
| Type | Name | Description | 
|---|---|---|
| TimeSpan | time | The time to round  | 
      
Returns
| Type | Description | 
|---|---|
| TimeSpan | The rounded time.  | 
      
SaveProfile()
Saves the current profile.
Declaration
void SaveProfile()
  SaveProfileAsync()
Asynchronously saves the current profile.
Declaration
Task SaveProfileAsync()
  Returns
| Type | Description | 
|---|---|
| Task | A task representing the save action.  | 
      
SelectKeyframe(ILayerPropertyKeyframe?, bool, bool)
Selects the provided keyframe.
Declaration
void SelectKeyframe(ILayerPropertyKeyframe? keyframe, bool expand, bool toggle)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ILayerPropertyKeyframe | keyframe | The keyframe to select.  | 
      
| bool | expand | If true expands the current selection; otherwise replaces it with only the
provided   | 
      
| bool | toggle | If true toggles the selection and only for the provided
  | 
      
SelectKeyframes(IEnumerable<ILayerPropertyKeyframe>, bool)
Selects the provided keyframes.
Declaration
void SelectKeyframes(IEnumerable<ILayerPropertyKeyframe> keyframes, bool expand)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IEnumerable<ILayerPropertyKeyframe> | keyframes | The keyframes to select.  | 
      
| bool | expand | If true expands the current selection; otherwise replaces it with only the
provided   | 
      
SnapToTimeline(TimeSpan, TimeSpan, bool, bool, List<TimeSpan>?)
Snaps the given time to the closest relevant element in the timeline, this can be the cursor, a keyframe or a segment end.
Declaration
TimeSpan SnapToTimeline(TimeSpan time, TimeSpan tolerance, bool snapToSegments, bool snapToCurrentTime, List<TimeSpan>? snapTimes = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| TimeSpan | time | The time to snap.  | 
      
| TimeSpan | tolerance | How close the time must be to snap.  | 
      
| bool | snapToSegments | Enable snapping to timeline segments.  | 
      
| bool | snapToCurrentTime | Enable snapping to the current time of the editor.  | 
      
| List<TimeSpan> | snapTimes | An optional extra list of times to snap to.  | 
      
Returns
| Type | Description | 
|---|---|
| TimeSpan | The snapped time.  |