Device dialog - Added LEDs tab

General - Resolved lots of compile warnings (XML comments)
This commit is contained in:
Robert committed 2022-06-19 14:19:03 +02:00
1 parent 021f17aef4
commit 65837e671a
44 files changed
+1015 -761

No files matched your search

@@ -9,6 +9,9 @@ using ReactiveUI;
namespace Artemis.UI.Shared.Services.NodeEditor;
/// <summary>
/// Represents the command history of a node script.
/// </summary>
public class NodeEditorHistory
{
private readonly Subject<bool> _canRedo = new();
@@ -16,6 +19,10 @@ public class NodeEditorHistory
private readonly Stack<INodeEditorCommand> _redoCommands = new();
private readonly Stack<INodeEditorCommand> _undoCommands = new();
/// <summary>
/// Creates a new instance of the <see cref="NodeEditorHistory" /> class.
/// </summary>
/// <param name="nodeScript">The node script the history relates to.</param>
public NodeEditorHistory(INodeScript nodeScript)
{
NodeScript = nodeScript;
@@ -25,14 +32,39 @@ public class NodeEditorHistory
Redo = ReactiveCommand.Create(ExecuteRedo, CanRedo);
}
/// <summary>
/// Gets the node script the history relates to.
/// </summary>
public INodeScript NodeScript { get; }
/// <summary>
/// Gets an observable sequence containing a boolean value indicating whether history can be undone.
/// </summary>
public IObservable<bool> CanUndo => _canUndo.AsObservable().DistinctUntilChanged();
/// <summary>
/// Gets an observable sequence containing a boolean value indicating whether history can be redone.
/// </summary>
public IObservable<bool> CanRedo => _canRedo.AsObservable().DistinctUntilChanged();
/// <summary>
/// Gets a reactive command that can be executed to execute an instance of a <see cref="INodeEditorCommand" /> and puts it in history.
/// </summary>
public ReactiveCommand<INodeEditorCommand, Unit> Execute { get; }
/// <summary>
/// Gets a reactive command that can be executed to undo history.
/// </summary>
public ReactiveCommand<Unit, INodeEditorCommand?> Undo { get; }
/// <summary>
/// Gets a reactive command that can be executed to redo history.
/// </summary>
public ReactiveCommand<Unit, INodeEditorCommand?> Redo { get; }
/// <summary>
/// Clears the history.
/// </summary>
public void Clear()
{
ClearRedo();
@@ -40,6 +72,10 @@ public class NodeEditorHistory
UpdateSubjects();
}
/// <summary>
/// Executes the provided <paramref name="command" /> and puts it in history.
/// </summary>
/// <param name="command">The command to execute</param>
public void ExecuteEditorCommand(INodeEditorCommand command)
{
command.Execute();