-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added new Microsoft.PowerPlatform.PowerApps.Persistence project (#513)
- Loading branch information
Showing
10 changed files
with
132 additions
and
0 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
....PowerPlatform.PowerApps.Persistence/Microsoft.PowerPlatform.PowerApps.Persistence.csproj
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,9 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
</Project> |
11 changes: 11 additions & 0 deletions
11
src/Microsoft.PowerPlatform.PowerApps.Persistence/Models/BuiltInTemplatesUris.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,11 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace Microsoft.PowerPlatform.PowerApps.Persistence.Models; | ||
|
||
internal static class BuiltInTemplatesUris | ||
{ | ||
public static readonly Uri Screen = new("http://microsoft.com/appmagic/screen#screen"); | ||
public static readonly Uri Button = new("http://microsoft.com/appmagic/button#button"); | ||
public static readonly Uri Label = new("http://microsoft.com/appmagic/label#label"); | ||
} |
14 changes: 14 additions & 0 deletions
14
src/Microsoft.PowerPlatform.PowerApps.Persistence/Models/Button.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,14 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace Microsoft.PowerPlatform.PowerApps.Persistence.Models; | ||
|
||
[FirstClass(Template)] | ||
internal record Button : Control | ||
{ | ||
internal const string Template = "Button"; | ||
public Button() | ||
{ | ||
ControlUri = BuiltInTemplatesUris.Button; | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/Microsoft.PowerPlatform.PowerApps.Persistence/Models/Control.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,30 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace Microsoft.PowerPlatform.PowerApps.Persistence.Models; | ||
|
||
//TODO: abstract? | ||
internal record Control | ||
{ | ||
// TODO: rename to "Control" in yaml | ||
// TODO: make this a string and handle parsing/matchin later | ||
/// <summary> | ||
/// template uri of the control. | ||
/// </summary> | ||
public Uri? ControlUri { get; init; } | ||
|
||
/// <summary> | ||
/// the control's name. | ||
/// </summary> | ||
public string? Name { get; init; } | ||
|
||
/// <summary> | ||
/// key/value pairs of Control properties. Mapped to/from Control rules. | ||
/// </summary> | ||
public IReadOnlyDictionary<string, string>? Properties { get; init; } | ||
|
||
/// <summary> | ||
/// list of child controls nested under this control. | ||
/// </summary> | ||
public Control[]? Controls { get; init; } | ||
} |
14 changes: 14 additions & 0 deletions
14
src/Microsoft.PowerPlatform.PowerApps.Persistence/Models/ControlProperty.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,14 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace Microsoft.PowerPlatform.PowerApps.Persistence.Models; | ||
|
||
// TODO | ||
//internal sealed record ControlProperty | ||
//{ | ||
// public string Name { get; init; } | ||
|
||
// public string? Value { get; init; } | ||
|
||
// public bool IsFormula { get; init; } | ||
//} |
6 changes: 6 additions & 0 deletions
6
src/Microsoft.PowerPlatform.PowerApps.Persistence/Models/CustomControl.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,6 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace Microsoft.PowerPlatform.PowerApps.Persistence.Models; | ||
|
||
internal record CustomControl : Control; |
14 changes: 14 additions & 0 deletions
14
src/Microsoft.PowerPlatform.PowerApps.Persistence/Models/FirstClassAttribute.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,14 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace Microsoft.PowerPlatform.PowerApps.Persistence.Models; | ||
|
||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false)] | ||
internal class FirstClassAttribute : Attribute | ||
{ | ||
public FirstClassAttribute(string? nodeName = null) | ||
{ | ||
NodeName = nodeName ?? string.Empty; | ||
} | ||
public string NodeName { get; } | ||
} |
14 changes: 14 additions & 0 deletions
14
src/Microsoft.PowerPlatform.PowerApps.Persistence/Models/Label.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,14 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace Microsoft.PowerPlatform.PowerApps.Persistence.Models; | ||
|
||
[FirstClass(Template)] | ||
internal record Label : Control | ||
{ | ||
internal const string Template = "Label"; | ||
public Label() | ||
{ | ||
ControlUri = BuiltInTemplatesUris.Label; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/Microsoft.PowerPlatform.PowerApps.Persistence/Models/Screen.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,14 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace Microsoft.PowerPlatform.PowerApps.Persistence.Models; | ||
|
||
[FirstClass(Template)] | ||
internal record Screen : Control | ||
{ | ||
internal const string Template = "Screen"; | ||
public Screen() | ||
{ | ||
ControlUri = BuiltInTemplatesUris.Screen; | ||
} | ||
} |
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