Skip to content

Commit

Permalink
Sample: Action groups (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
jfevia authored Aug 4, 2024
1 parent fbe6031 commit ab758b9
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 4 deletions.
21 changes: 17 additions & 4 deletions PowerAutomate.Desktop.sln
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2.1.ActionSelectors", "2.1.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Modules.ActionSelectors.Actions", "samples\Modules.ActionSelectors.Actions\Modules.ActionSelectors.Actions.csproj", "{278DD34D-AC4C-4756-A58A-5E5BD4EB84DD}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3.Advanced", "3.Advanced", "{8F617F6B-EB33-4D20-B3EA-18A6D48F38B0}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "4.Advanced", "4.Advanced", "{8F617F6B-EB33-4D20-B3EA-18A6D48F38B0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2.Features", "2.Features", "{C8F10AE7-BB68-4D4E-BF33-6DF7D7D24311}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{FEFFE5BC-DCBD-466C-87DE-5B9D8A553256}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3.Categories", "3.Categories", "{9C21EBF9-3443-4DAE-9000-53E4D41995D2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Modules.Categories.Actions", "samples\Modules.Categories.Actions\Modules.Categories.Actions.csproj", "{283D282B-497D-46B1-A822-BF1F4B116A84}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -123,6 +129,10 @@ Global
{278DD34D-AC4C-4756-A58A-5E5BD4EB84DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{278DD34D-AC4C-4756-A58A-5E5BD4EB84DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{278DD34D-AC4C-4756-A58A-5E5BD4EB84DD}.Release|Any CPU.Build.0 = Release|Any CPU
{283D282B-497D-46B1-A822-BF1F4B116A84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{283D282B-497D-46B1-A822-BF1F4B116A84}.Debug|Any CPU.Build.0 = Debug|Any CPU
{283D282B-497D-46B1-A822-BF1F4B116A84}.Release|Any CPU.ActiveCfg = Release|Any CPU
{283D282B-497D-46B1-A822-BF1F4B116A84}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -137,7 +147,6 @@ Global
{A9858CCE-DDB1-4942-84BE-08991E46A818} = {6709150F-B5E8-4377-BAEA-5394C5340806}
{E7F31F2C-1091-4B82-A685-C7A74FC80A1D} = {3B78C634-DFD6-43DA-A30E-33AC42224BD4}
{EE7E70E2-7838-4B4E-BCC1-C74051ACBBA5} = {3B78C634-DFD6-43DA-A30E-33AC42224BD4}
{A5E3C936-7C1F-4719-9EAA-37F4AE439EF7} = {64A2FE14-920C-4A2F-8F4A-28B77CC84BA4}
{1D4838E3-22A7-4D65-91CF-2395778EE92F} = {A5E3C936-7C1F-4719-9EAA-37F4AE439EF7}
{146D4CFB-A54A-4E9F-8473-FC0D73F7BEFD} = {8EC670BB-BC22-44B4-8228-8F053188C908}
{801F4464-7843-4252-9476-E68830781126} = {33E32C24-4A59-4DE1-B9C5-57CF051AD355}
Expand All @@ -146,12 +155,16 @@ Global
{15602292-F636-4904-8835-5784B644BDA8} = {75B693A3-4FAE-4009-B370-9A062546D8A2}
{121AA4E9-9301-4EB7-A0B7-5AFD70EF65D1} = {3B78C634-DFD6-43DA-A30E-33AC42224BD4}
{278DD34D-AC4C-4756-A58A-5E5BD4EB84DD} = {898CA625-50B2-475F-B1D8-B9A96577DCF8}
{8F617F6B-EB33-4D20-B3EA-18A6D48F38B0} = {64A2FE14-920C-4A2F-8F4A-28B77CC84BA4}
{8EC670BB-BC22-44B4-8228-8F053188C908} = {8F617F6B-EB33-4D20-B3EA-18A6D48F38B0}
{6709150F-B5E8-4377-BAEA-5394C5340806} = {8F617F6B-EB33-4D20-B3EA-18A6D48F38B0}
{33E32C24-4A59-4DE1-B9C5-57CF051AD355} = {8F617F6B-EB33-4D20-B3EA-18A6D48F38B0}
{C8F10AE7-BB68-4D4E-BF33-6DF7D7D24311} = {64A2FE14-920C-4A2F-8F4A-28B77CC84BA4}
{898CA625-50B2-475F-B1D8-B9A96577DCF8} = {C8F10AE7-BB68-4D4E-BF33-6DF7D7D24311}
{FEFFE5BC-DCBD-466C-87DE-5B9D8A553256} = {64A2FE14-920C-4A2F-8F4A-28B77CC84BA4}
{A5E3C936-7C1F-4719-9EAA-37F4AE439EF7} = {FEFFE5BC-DCBD-466C-87DE-5B9D8A553256}
{C8F10AE7-BB68-4D4E-BF33-6DF7D7D24311} = {FEFFE5BC-DCBD-466C-87DE-5B9D8A553256}
{8F617F6B-EB33-4D20-B3EA-18A6D48F38B0} = {FEFFE5BC-DCBD-466C-87DE-5B9D8A553256}
{9C21EBF9-3443-4DAE-9000-53E4D41995D2} = {FEFFE5BC-DCBD-466C-87DE-5B9D8A553256}
{283D282B-497D-46B1-A822-BF1F4B116A84} = {9C21EBF9-3443-4DAE-9000-53E4D41995D2}
EndGlobalSection
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Modules.Actions.Shared\Modules.Actions.Shared.projitems*{7e19e2f1-6de7-4a0e-aed8-7cea38b166af}*SharedItemsImports = 13
Expand Down
43 changes: 43 additions & 0 deletions samples/Modules.Categories.Actions/GroupsAction.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// ---------------------------------------------------
// Copyright (c) Jesus Fernandez. All Rights Reserved.
// ---------------------------------------------------

using System.ComponentModel;
using Microsoft.PowerPlatform.PowerAutomate.Desktop.Actions.SDK;
using Microsoft.PowerPlatform.PowerAutomate.Desktop.Actions.SDK.Attributes;

namespace PowerAutomate.Desktop.Modules.Categories.Actions;

internal static class Groups
{
public const string Advanced = nameof(Advanced);
public const string General = nameof(General);
}

[Action]
[Group(Name = Groups.General, IsDefault = true)]
[Group(Name = Groups.Advanced)]
public class GroupsAction : ActionBase
{
[OutputArgument]
public string Message { get; set; } = null!;

[InputArgument(Group = Groups.General)]
public string Name { get; set; } = null!;

[InputArgument(Group = Groups.Advanced)]
[DefaultValue(false)]
public bool UpperCase { get; set; }

public override void Execute(ActionContext context)
{
var message = $"Hello, {Name}!";

if (UpperCase)
{
message = message.ToUpper();
}

Message = message;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<AssemblyTitle>Categories</AssemblyTitle>
<TargetFramework>net472</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<PackCustomModule Condition=" '$(Configuration)' == 'Debug' ">true</PackCustomModule>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.PowerPlatform.PowerAutomate.Desktop.Actions.SDK" />
</ItemGroup>

</Project>

0 comments on commit ab758b9

Please sign in to comment.