Skip to content

Commit

Permalink
feat: Add message for to add a menu in the IDE
Browse files Browse the repository at this point in the history
  • Loading branch information
dr1rrb committed Oct 9, 2024
1 parent 2f85fb7 commit 0433d09
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#nullable enable
using System;
using System.Linq;

namespace Uno.UI.RemoteControl.Messaging.IdeChannel;

/// <summary>
/// Request to the IDE to add a menu item.
/// </summary>
/// <param name="Command">The command to add in the IDE menus.</param>
public record AddMenuItemRequestIdeMessage(Command Command) : IdeMessage(WellKnownScopes.Ide);
13 changes: 13 additions & 0 deletions src/Uno.UI.RemoteControl.Messaging/IdeChannel/Command.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#nullable enable
using System;
using System.Linq;

namespace Uno.UI.RemoteControl.Messaging.IdeChannel;

/// <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);
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,10 @@ namespace Uno.UI.RemoteControl.Messaging.IdeChannel;
/// <param name="Title">Title of the notification (might not be visible on all IDEs).</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(NotificationKind Kind, string Title, string Message, Command[] Commands) : IdeMessage(WellKnownScopes.Ide);
public record NotificationRequestIdeMessage(NotificationKind Kind, string Title, string Message, Command[]? Commands = default) : 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);

/// <summary>
/// Kind of <see cref="NotificationIdeMessage"/>
/// Kind of <see cref="NotificationRequestIdeMessage"/>
/// </summary>
public enum NotificationKind
{
Expand Down

0 comments on commit 0433d09

Please sign in to comment.