mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-08 02:06:40 +08:00
修改暂存一下
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using AIStudio.Wpf.DiagramDesigner.Geometry;
|
||||
using AIStudio.Wpf.DiagramDesigner.Geometrys;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
@@ -13,5 +13,17 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
public SizeBase DesignerItemSize { get; set; }
|
||||
public PointBase Position { get; set; }
|
||||
public ConnectorOrientation Orientation { get; set; }
|
||||
|
||||
public static ConnectorInfo GetConnectorInfo(ConnectorOrientation orientation, double left, double top, double width, double height, PointBase position)
|
||||
{
|
||||
return new ConnectorInfo()
|
||||
{
|
||||
Orientation = orientation,
|
||||
DesignerItemSize = new SizeBase(width, height),
|
||||
DesignerItemLeft = left,
|
||||
DesignerItemTop = top,
|
||||
Position = position
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
51
AIStudio.Wpf.DiagramDesigner/Models/GlobalType.cs
Normal file
51
AIStudio.Wpf.DiagramDesigner/Models/GlobalType.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static class GlobalType
|
||||
{
|
||||
static GlobalType()
|
||||
{
|
||||
string rootPath = System.AppDomain.CurrentDomain.BaseDirectory;
|
||||
AllAssemblies = Directory.GetFiles(rootPath, "*.dll")
|
||||
.Where(x => AssemblyPattern.Any(y => new FileInfo(x).Name.Contains(y)))
|
||||
.Select(x => Assembly.LoadFrom(x))
|
||||
.Where(x => !x.IsDynamic)
|
||||
.ToList();
|
||||
|
||||
AllAssemblies.ForEach(aAssembly => {
|
||||
try
|
||||
{
|
||||
AllTypes.AddRange(aAssembly.GetTypes());
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 解决方案程序集匹配名
|
||||
/// </summary>
|
||||
public static readonly List<string> AssemblyPattern = new List<string> { "AIStudio" };
|
||||
|
||||
/// <summary>
|
||||
/// 解决方案所有程序集
|
||||
/// </summary>
|
||||
public static readonly List<Assembly> AllAssemblies;
|
||||
|
||||
/// <summary>
|
||||
/// 解决方案所有自定义类
|
||||
/// </summary>
|
||||
public static readonly List<Type> AllTypes = new List<Type>();
|
||||
}
|
||||
}
|
||||
@@ -17,10 +17,33 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
|
||||
}
|
||||
//public ConnectionItem(Guid id, Guid sourceId, ConnectorOrientation sourceOrientation, Type sourceType, double sourceXRatio, double sourceYRatio, bool sourceInnerPoint,
|
||||
// Guid sinkId, ConnectorOrientation sinkOrientation, Type sinkType, double sinkXRatio, double sinkYRatio, bool sinkInnerPoint,
|
||||
// int zIndex, bool isGroup, Guid parentId, DrawMode vectorLineDrawMode, ColorViewModel colorViewModel, FontViewModel fontViewModel) : base(id, zIndex, isGroup, parentId, colorViewModel, fontViewModel)
|
||||
|
||||
public ConnectionItem(ConnectorViewModel viewmodel) : base(viewmodel)
|
||||
{
|
||||
this.SourceId = viewmodel.SourceConnectorInfo.DataItem.Id;
|
||||
this.SourceOrientation = viewmodel.SourceConnectorInfo.Orientation;
|
||||
this.SourceType = viewmodel.SourceConnectorInfo.DataItem.GetType();
|
||||
this.SourceTypeName = viewmodel.SourceConnectorInfo.DataItem.GetType().FullName;
|
||||
this.SourceXRatio = viewmodel.SourceConnectorInfo.GetXRatioFromConnector();
|
||||
this.SourceYRatio = viewmodel.SourceConnectorInfo.GetYRatioFromConnector();
|
||||
this.SourceInnerPoint = viewmodel.SourceConnectorInfo.IsInnerPoint;
|
||||
|
||||
this.SinkId = viewmodel.SinkConnectorInfoFully.DataItem.Id;
|
||||
this.SinkOrientation = viewmodel.SinkConnectorInfoFully.Orientation;
|
||||
this.SinkType = viewmodel.SinkConnectorInfoFully.DataItem.GetType();
|
||||
this.SinkTypeName = viewmodel.SinkConnectorInfoFully.DataItem.GetType().FullName;
|
||||
this.SinkXRatio = viewmodel.SinkConnectorInfoFully.GetXRatioFromConnector();
|
||||
this.SinkYRatio = viewmodel.SinkConnectorInfoFully.GetYRatioFromConnector();
|
||||
this.SinkInnerPoint = viewmodel.SinkConnectorInfoFully.IsInnerPoint;
|
||||
this.RouterMode = viewmodel.RouterMode;
|
||||
this.PathMode = viewmodel.PathMode;
|
||||
}
|
||||
|
||||
//public ConnectionItem(Guid sourceId, ConnectorOrientation sourceOrientation, Type sourceType, double sourceXRatio, double sourceYRatio, bool sourceInnerPoint,
|
||||
// Guid sinkId, ConnectorOrientation sinkOrientation, Type sinkType, double sinkXRatio, double sinkYRatio, bool sinkInnerPoint, ConnectorViewModel viewmodel) : base(viewmodel)
|
||||
//{
|
||||
|
||||
|
||||
// this.SourceId = sourceId;
|
||||
// this.SourceOrientation = sourceOrientation;
|
||||
// this.SourceType = sourceType;
|
||||
@@ -31,35 +54,15 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
// this.SinkId = sinkId;
|
||||
// this.SinkOrientation = sinkOrientation;
|
||||
// this.SinkType = sinkType;
|
||||
// this.SinkType = sinkType;
|
||||
// this.SinkTypeName = sinkType.FullName;
|
||||
// this.SinkXRatio = sinkXRatio;
|
||||
// this.SinkYRatio = sinkYRatio;
|
||||
// this.SinkInnerPoint = sinkInnerPoint;
|
||||
// this.VectorLineDrawMode = vectorLineDrawMode;
|
||||
// this.RouterMode = viewmodel.RouterMode;
|
||||
// this.DrawMode = viewmodel.DrawMode;
|
||||
//}
|
||||
|
||||
public ConnectionItem(Guid sourceId, ConnectorOrientation sourceOrientation, Type sourceType, double sourceXRatio, double sourceYRatio, bool sourceInnerPoint,
|
||||
Guid sinkId, ConnectorOrientation sinkOrientation, Type sinkType, double sinkXRatio, double sinkYRatio, bool sinkInnerPoint, ConnectorViewModel viewmodel) : base(viewmodel)
|
||||
{
|
||||
this.SourceId = sourceId;
|
||||
this.SourceOrientation = sourceOrientation;
|
||||
this.SourceType = sourceType;
|
||||
this.SourceTypeName = sourceType.FullName;
|
||||
this.SourceXRatio = sourceXRatio;
|
||||
this.SourceYRatio = sourceYRatio;
|
||||
this.SourceInnerPoint = sourceInnerPoint;
|
||||
|
||||
this.SinkId = sinkId;
|
||||
this.SinkOrientation = sinkOrientation;
|
||||
this.SinkType = sinkType;
|
||||
this.SinkTypeName = sinkType.FullName;
|
||||
this.SinkXRatio = sinkXRatio;
|
||||
this.SinkYRatio = sinkYRatio;
|
||||
this.SinkInnerPoint = sinkInnerPoint;
|
||||
this.VectorLineDrawMode = viewmodel.VectorLineDrawMode;
|
||||
}
|
||||
|
||||
[XmlAttribute]
|
||||
public Guid SourceId { get; set; }
|
||||
|
||||
@@ -103,6 +106,15 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
public bool SinkInnerPoint { get; set; }
|
||||
|
||||
[XmlAttribute]
|
||||
public DrawMode VectorLineDrawMode { get; set; }
|
||||
public string RouterMode
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
[XmlAttribute]
|
||||
public string PathMode
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Helpers
|
||||
namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
public class ToolBoxData
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user