mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 00:00:57 +08:00
序列化继续改进
This commit is contained in:
@@ -221,7 +221,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
private bool _showGrid;
|
||||
private bool _showGrid = true;
|
||||
public bool ShowGrid
|
||||
{
|
||||
get
|
||||
@@ -1406,8 +1406,8 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
string json = new SerializableObject
|
||||
{
|
||||
DesignerItems = selectedDesignerItems.Select(p => p.ToSerializableItem("json")).Where(p => p != null).ToList(),
|
||||
Connections = selectedConnections.Select(p => p.ToSerializableItem("json")).Where(p => p != null).ToList(),
|
||||
DesignerItems = selectedDesignerItems.Select(p => p.ToSerializableItem(".json")).Where(p => p != null).ToList(),
|
||||
Connections = selectedConnections.Select(p => p.ToSerializableItem(".json")).Where(p => p != null).ToList(),
|
||||
}.ToJson();
|
||||
|
||||
OffsetX = 10;
|
||||
@@ -1420,9 +1420,9 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
if (System.Windows.Clipboard.ContainsData(System.Windows.DataFormats.Serializable))
|
||||
{
|
||||
String clipboardData = System.Windows.Clipboard.GetData(System.Windows.DataFormats.Serializable) as String;
|
||||
string clipboardData = System.Windows.Clipboard.GetData(System.Windows.DataFormats.Serializable) as String;
|
||||
|
||||
if (String.IsNullOrEmpty(clipboardData))
|
||||
if (string.IsNullOrEmpty(clipboardData))
|
||||
return;
|
||||
try
|
||||
{
|
||||
@@ -1435,9 +1435,9 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
DesignerItemViewModelBase newItem = null;
|
||||
|
||||
Type type = TypeHelper.GetType(diagramItemData.TypeName);
|
||||
Type type = TypeHelper.GetType(diagramItemData.ModelTypeName);
|
||||
|
||||
DesignerItemViewModelBase itemBase = Activator.CreateInstance(type, this, diagramItemData.SerializableString, "json") as DesignerItemViewModelBase;
|
||||
DesignerItemViewModelBase itemBase = Activator.CreateInstance(type, this, diagramItemData, ".json") as DesignerItemViewModelBase;
|
||||
Guid newID = Guid.NewGuid();
|
||||
mappingOldToNewIDs.Add(itemBase.Id, newID);
|
||||
itemBase.Id = newID;
|
||||
|
||||
Reference in New Issue
Block a user