-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Andrew Petrochuk (from Dev Box) <[email protected]>
- Loading branch information
Showing
20 changed files
with
275 additions
and
56 deletions.
There are no files selected for viewing
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
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
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,24 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace Microsoft.PowerPlatform.Formulas.Tools; | ||
|
||
internal class SerializationException : Exception | ||
{ | ||
public string FileName { get; init; } | ||
|
||
public SerializationException(string message) | ||
: base(message) | ||
{ | ||
} | ||
|
||
public SerializationException(string message, Exception innerException) | ||
: base(message, innerException) | ||
{ | ||
} | ||
|
||
public SerializationException(string message, string fileName, Exception innerException) | ||
{ | ||
FileName = fileName; | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
using System.Diagnostics; | ||
using YamlDotNet.Serialization; | ||
|
||
namespace Microsoft.PowerPlatform.Formulas.Tools.Model; | ||
|
||
[DebuggerDisplay("{Name}")] | ||
public record Control | ||
{ | ||
public Control() | ||
{ | ||
|
||
} | ||
|
||
public Control(ControlEditorState editorState) | ||
{ | ||
EditorState = editorState; | ||
Name = editorState.Name; | ||
|
||
if (editorState.Children != null) | ||
{ | ||
var childControls = new List<Control>(); | ||
foreach (var child in editorState.Children) | ||
{ | ||
childControls.Add(new Control(child)); | ||
} | ||
Controls = childControls; | ||
editorState.Children = null; | ||
} | ||
} | ||
|
||
[YamlIgnore] | ||
public ControlEditorState EditorState { get; set; } | ||
|
||
public string Name { get; init; } | ||
|
||
public IList<Control> Controls { get; init; } | ||
|
||
public IDictionary<string, object> Properties { get; init; } | ||
} |
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,13 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace Microsoft.PowerPlatform.Formulas.Tools.Model; | ||
|
||
public record ControlEditorState | ||
{ | ||
public string Name { get; init; } | ||
|
||
public ControlEditorState[] Children { get; set; } | ||
|
||
public IList<RuleEditorState> Rules { get; init; } | ||
} |
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,17 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
using System.Diagnostics; | ||
|
||
namespace Microsoft.PowerPlatform.Formulas.Tools.Model; | ||
|
||
[DebuggerDisplay("{Category} / {Property} / {InvariantScript}")] | ||
public record RuleEditorState | ||
{ | ||
public string Category { get; init; } | ||
public string Property { get; init; } | ||
public string NameMap { get; init; } | ||
public string InvariantScript { get; init; } | ||
public string RuleProviderType { get; init; } | ||
public IList<TaggedRuleEditorState> TaggedRuleArray { get; init; } | ||
} |
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 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace Microsoft.PowerPlatform.Formulas.Tools.Model; | ||
|
||
public record TaggedRuleEditorState : RuleEditorState | ||
{ | ||
public string Tag { get; init; } | ||
} |
Oops, something went wrong.