-
Notifications
You must be signed in to change notification settings - Fork 725
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add contract for to allow user interaction in IDE from the dev-…
…server
- Loading branch information
Showing
5 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
src/Uno.UI.RemoteControl.Messaging/IDEChannel/CommandRequestIdeMessage.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#nullable enable | ||
using System; | ||
using Uno.UI.RemoteControl.Messaging.IdeChannel; | ||
|
||
namespace Uno.UI.RemoteControl.Messaging.IDEChannel; | ||
|
||
/// <summary> | ||
/// A message sent by the IDE to the dev-server when a command is issued (like a menuitem invoked). | ||
/// </summary> | ||
/// <param name="Command">The name/id of the command (e.g. uno.hotreload.open_hotreload_window).</param> | ||
/// <param name="CommandParameter">A json serialized parameter to execute the command.</param> | ||
public record CommandRequestIdeMessage(string Command, string? CommandParameter = null) : IdeMessage(WellKnownScopes.Ide) | ||
{ | ||
/// <summary> | ||
/// A unique identifier of this command execution request that could be used to track the response (if any produced by the remote handler). | ||
/// </summary> | ||
public Guid Id {get; } = Guid.NewGuid(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/Uno.UI.RemoteControl.Messaging/IDEChannel/NotificationIdeMessage.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#nullable enable | ||
using System; | ||
using System.Linq; | ||
using Uno.UI.RemoteControl.Messaging.IdeChannel; | ||
|
||
namespace Uno.UI.RemoteControl.Messaging.IDEChannel; | ||
|
||
/// <summary> | ||
/// A message sent by the sev-server to the IDE to notify the user. | ||
/// </summary> | ||
/// <param name="Title">Title of the notification.</param> | ||
/// <param name="Message">The message of the notification.</param> | ||
/// <param name="Commands">For call-to-action notification, set of commands to show with the notification.</param> | ||
public record NotificationIdeMessage(string Title, string Message, Command[] Commands) : IdeMessage(WellKnownScopes.Ide); | ||
|
||
/// <summary> | ||
/// Description of a command to execute. | ||
/// </summary> | ||
/// <param name="Text">Text content to display to the user.</param> | ||
/// <param name="Name">The name/id of the command (e.g. uno.hotreload.open_hotreload_window).</param> | ||
/// <param name="Parameter">A json serialized parameter to execute the command.</param> | ||
public record Command(string Text, string Name, string? Parameter = null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters