-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AOT] clean up AOT issue in Settings.UI #36559
Draft
moooyo
wants to merge
1
commit into
main
Choose a base branch
from
yuleng/AOT/settingsUI
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright (c) Microsoft Corporation | ||
// The Microsoft Corporation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics.CodeAnalysis; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Text.Json.Serialization; | ||
using System.Threading.Tasks; | ||
|
||
namespace Microsoft.PowerToys.Settings.UI.Helpers | ||
{ | ||
public sealed class ActionMessage | ||
{ | ||
[JsonPropertyName("action")] | ||
public SettingsAction Action { get; set; } | ||
|
||
public static ActionMessage Create(string actionName) | ||
{ | ||
return new ActionMessage | ||
{ | ||
Action = new SettingsAction | ||
{ | ||
PublishedDate = new SettingsGeneral | ||
{ | ||
ActionName = actionName, | ||
}, | ||
}, | ||
}; | ||
} | ||
} | ||
|
||
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:File may only contain a single type", Justification = "Those are just a define for one simple struct")] | ||
public sealed class SettingsAction | ||
{ | ||
[JsonPropertyName("general")] | ||
public SettingsGeneral PublishedDate { get; set; } | ||
} | ||
|
||
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:File may only contain a single type", Justification = "Those are just a define for one simple struct")] | ||
public sealed class SettingsGeneral | ||
{ | ||
[JsonPropertyName("action_name")] | ||
public string ActionName { get; set; } | ||
} | ||
} |
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
29 changes: 29 additions & 0 deletions
29
src/settings-ui/Settings.UI/Helpers/PowerToysReleaseInfo.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,29 @@ | ||
// Copyright (c) Microsoft Corporation | ||
// The Microsoft Corporation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Text.Json.Serialization; | ||
using System.Threading.Tasks; | ||
|
||
namespace Microsoft.PowerToys.Settings.UI.Helpers | ||
{ | ||
// Contains information for a release. Used to deserialize release JSON info from GitHub. | ||
public sealed class PowerToysReleaseInfo | ||
{ | ||
[JsonPropertyName("published_at")] | ||
public DateTimeOffset PublishedDate { get; set; } | ||
|
||
[JsonPropertyName("name")] | ||
public string Name { get; set; } | ||
|
||
[JsonPropertyName("tag_name")] | ||
public string TagName { get; set; } | ||
|
||
[JsonPropertyName("body")] | ||
public string ReleaseNotes { get; set; } | ||
} | ||
} |
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
35 changes: 35 additions & 0 deletions
35
src/settings-ui/Settings.UI/Helpers/SettingsUIJsonSerializerContext.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,35 @@ | ||
// Copyright (c) Microsoft Corporation | ||
// The Microsoft Corporation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Text.Json.Serialization; | ||
using System.Threading.Tasks; | ||
using Microsoft.PowerToys.Settings.UI.Library; | ||
|
||
namespace Microsoft.PowerToys.Settings.UI.Helpers; | ||
|
||
[JsonSerializable(typeof(WINDOWPLACEMENT))] | ||
[JsonSerializable(typeof(AdvancedPasteSettings))] | ||
[JsonSerializable(typeof(Dictionary<string, List<string>>))] | ||
[JsonSerializable(typeof(AlwaysOnTopSettings))] | ||
[JsonSerializable(typeof(ColorPickerSettings))] | ||
[JsonSerializable(typeof(CropAndLockSettings))] | ||
[JsonSerializable(typeof(FileLocksmithSettings))] | ||
[JsonSerializable(typeof(MeasureToolSettings))] | ||
[JsonSerializable(typeof(MouseWithoutBordersSettings))] | ||
[JsonSerializable(typeof(NewPlusSettings))] | ||
[JsonSerializable(typeof(PeekSettings))] | ||
[JsonSerializable(typeof(PowerLauncherSettings))] | ||
[JsonSerializable(typeof(PowerOcrSettings))] | ||
[JsonSerializable(typeof(RegistryPreviewSettings))] | ||
[JsonSerializable(typeof(VideoConferenceSettings))] | ||
[JsonSerializable(typeof(WorkspacesSettings))] | ||
[JsonSerializable(typeof(IList<PowerToysReleaseInfo>))] | ||
[JsonSerializable(typeof(ActionMessage))] | ||
public sealed partial class SettingsUIJsonSerializerContext : JsonSerializerContext | ||
{ | ||
} |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is
INPUT
blittable? If so you should just dosizeof(INPUT)
. Same for all otherMarshal.SizeOf
uses in this PR.