Skip to content
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 some AOT issues in Advanced Paste module #36297

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ internal struct INPUT

internal static int Size
{
get { return Marshal.SizeOf(typeof(INPUT)); }
get { return Marshal.SizeOf<INPUT>(); }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

namespace AdvancedPaste.Settings
{
internal sealed class UserSettings : IUserSettings, IDisposable
internal sealed partial class UserSettings : IUserSettings, IDisposable
{
private readonly SettingsUtils _settingsUtils;
private readonly TaskScheduler _taskScheduler;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// 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.Text.Json.Serialization;

namespace AdvancedPaste.Models
{
[JsonSerializable(typeof(CustomQuery))]
internal sealed partial class AdvancedPasteJsonSerializerContext : JsonSerializerContext
{
}
}
4 changes: 2 additions & 2 deletions src/modules/AdvancedPaste/AdvancedPaste/Models/CustomQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ internal sealed class CustomQuery : ISettingsConfig

public string GetModuleName() => Constants.AdvancedPasteModuleName;

public string ToJsonString() => JsonSerializer.Serialize(this);
public string ToJsonString() => JsonSerializer.Serialize(this, AdvancedPasteJsonSerializerContext.Default.CustomQuery);

public override string ToString()
=> JsonSerializer.Serialize(this);
=> JsonSerializer.Serialize(this, AdvancedPasteJsonSerializerContext.Default.CustomQuery);

public bool UpgradeSettingsConfiguration() => false;
}
Expand Down
Loading