mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-02 15:16:37 +08:00
ReDo Undo Item ItemWidth 和 Angle 等工具栏设置完成
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using AIStudio.Wpf.DiagramDesigner.Helpers;
|
||||
using AIStudio.Wpf.DiagramDesigner.Models;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -6,6 +7,7 @@ using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
@@ -555,7 +557,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
return value;
|
||||
}
|
||||
|
||||
public static string SerializeObject(object obj, string serializableType)
|
||||
public static string SerializeObject(object obj, string serializableType = null)
|
||||
{
|
||||
if (serializableType?.ToLower() == ".xml")
|
||||
{
|
||||
@@ -581,7 +583,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
}
|
||||
|
||||
public static SelectableItemBase DeserializeObject(Type type, string serializableString, string serializableType)
|
||||
public static SelectableItemBase DeserializeObject(Type type, string serializableString, string serializableType = null)
|
||||
{
|
||||
if (serializableType?.ToLower() == ".xml")
|
||||
{
|
||||
@@ -597,7 +599,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
public static SelectableItemBase DeserializeObject(string typename, string serializableString, string serializableType)
|
||||
public static SelectableItemBase DeserializeObject(string typename, string serializableString, string serializableType = null)
|
||||
{
|
||||
Type type = TypeHelper.GetType(typename);
|
||||
if (serializableType?.ToLower() == ".xml")
|
||||
@@ -613,6 +615,11 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
return JsonConvert.DeserializeObject(serializableString, type) as SelectableItemBase;
|
||||
}
|
||||
}
|
||||
|
||||
public static SelectableItemBase DeserializeObject(SerializableItem serializableItem, string serializableType = null)
|
||||
{
|
||||
return DeserializeObject(serializableItem.SerializableTypeName, serializableItem.SerializableString, serializableType);
|
||||
}
|
||||
}
|
||||
|
||||
public struct XmlFont
|
||||
|
||||
Reference in New Issue
Block a user