mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Replace JSON.NET with System.Text.json (#840)
This commit is contained in:
1 parent
e112ca9da8
commit
a340f8822e
63 files changed
+466
-584
No files matched your search
@@ -14,7 +14,6 @@ using Artemis.UI.Shared;
|
||||
using Artemis.UI.Shared.Routing;
|
||||
using Artemis.UI.Shared.Services;
|
||||
using Artemis.UI.Shared.Services.ProfileEditor;
|
||||
using Newtonsoft.Json;
|
||||
using PropertyChanged.SourceGenerator;
|
||||
using ReactiveUI;
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ using Artemis.Core.Services;
|
||||
using Artemis.Storage.Entities.Profile;
|
||||
using Artemis.UI.DryIoc.Factories;
|
||||
using Artemis.UI.Extensions;
|
||||
using Artemis.UI.Models;
|
||||
using Artemis.UI.Shared.Services;
|
||||
using Artemis.UI.Shared.Services.ProfileEditor;
|
||||
using Artemis.UI.Shared.Services.ProfileEditor.Commands;
|
||||
@@ -36,11 +37,9 @@ public class FolderTreeItemViewModel : TreeItemViewModel
|
||||
{
|
||||
await ProfileEditorService.SaveProfileAsync();
|
||||
|
||||
FolderEntity copy = CoreJson.DeserializeObject<FolderEntity>(CoreJson.SerializeObject(Folder.FolderEntity, true), true)!;
|
||||
copy.Id = Guid.NewGuid();
|
||||
copy.Name = Folder.Parent.GetNewFolderName(copy.Name + " - copy");
|
||||
FolderClipboardModel copy = CoreJson.Deserialize<FolderClipboardModel>(CoreJson.Serialize(new FolderClipboardModel(Folder)))!;
|
||||
Folder copied = copy.Paste(Folder.Profile, Folder.Parent);
|
||||
|
||||
Folder copied = new(Folder.Profile, Folder.Parent, copy);
|
||||
ProfileEditorService.ExecuteCommand(new AddProfileElement(copied, Folder.Parent, Folder.Order - 1));
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public class LayerTreeItemViewModel : TreeItemViewModel
|
||||
{
|
||||
await ProfileEditorService.SaveProfileAsync();
|
||||
|
||||
LayerEntity copy = CoreJson.DeserializeObject<LayerEntity>(CoreJson.SerializeObject(Layer.LayerEntity, true), true)!;
|
||||
LayerEntity copy = CoreJson.Deserialize<LayerEntity>(CoreJson.Serialize(Layer.LayerEntity))!;
|
||||
copy.Id = Guid.NewGuid();
|
||||
copy.Name = Layer.Parent.GetNewFolderName(copy.Name + " - copy");
|
||||
|
||||
|
||||
+1
-1
@@ -135,7 +135,7 @@ public partial class TimelineKeyframeViewModel<T> : ActivatableViewModelBase, IT
|
||||
else
|
||||
keyframes.AddRange(_profileEditorService.SelectedKeyframes.Select(k => new KeyframeClipboardModel(k)));
|
||||
|
||||
string copy = CoreJson.SerializeObject(keyframes, true);
|
||||
string copy = CoreJson.Serialize(keyframes);
|
||||
DataObject dataObject = new();
|
||||
dataObject.Set(KeyframeClipboardModel.ClipboardDataFormat, copy);
|
||||
await Shared.UI.Clipboard.SetDataObjectAsync(dataObject);
|
||||
|
||||
Reference in new issue
Block a user