支持到6.0

This commit is contained in:
艾竹
2023-04-16 23:32:55 +08:00
parent 81f91f3f35
commit 033bebb6bc
11 changed files with 74 additions and 12 deletions

View File

@@ -31,7 +31,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AIStudio.Wpf.Mind", "Extens
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AIStudio.Wpf.DiagramDesigner.Serializable", "AIStudio.Wpf.DiagramDesigner.Serializable\AIStudio.Wpf.DiagramDesigner.Serializable.csproj", "{439D0631-D9C2-4D36-BFCE-80DFCCABE9E7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AIStudio.Wpf.RoslynScript", "Extensions\AIStudio.Wpf.RoslynScript\AIStudio.Wpf.RoslynScript.csproj", "{E986D954-C2C5-47B9-9653-62943AE9AD85}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AIStudio.Wpf.Script", "Extensions\AIStudio.Wpf.Script\AIStudio.Wpf.Script.csproj", "{63C1101D-7F7C-41B0-AE78-F30DC5CEA810}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -75,10 +75,10 @@ Global
{439D0631-D9C2-4D36-BFCE-80DFCCABE9E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{439D0631-D9C2-4D36-BFCE-80DFCCABE9E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{439D0631-D9C2-4D36-BFCE-80DFCCABE9E7}.Release|Any CPU.Build.0 = Release|Any CPU
{E986D954-C2C5-47B9-9653-62943AE9AD85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E986D954-C2C5-47B9-9653-62943AE9AD85}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E986D954-C2C5-47B9-9653-62943AE9AD85}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E986D954-C2C5-47B9-9653-62943AE9AD85}.Release|Any CPU.Build.0 = Release|Any CPU
{63C1101D-7F7C-41B0-AE78-F30DC5CEA810}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{63C1101D-7F7C-41B0-AE78-F30DC5CEA810}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63C1101D-7F7C-41B0-AE78-F30DC5CEA810}.Release|Any CPU.ActiveCfg = Release|Any CPU
{63C1101D-7F7C-41B0-AE78-F30DC5CEA810}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -88,7 +88,7 @@ Global
{CC68D39D-7935-4079-9CEB-FC2FD498D511} = {4959F170-02FB-4B7F-8F53-93DAF22713F9}
{2AB69067-277E-4EE0-9949-8326A145EEE4} = {4959F170-02FB-4B7F-8F53-93DAF22713F9}
{85C437B9-16D2-4076-ABCD-52029AC232FC} = {4959F170-02FB-4B7F-8F53-93DAF22713F9}
{E986D954-C2C5-47B9-9653-62943AE9AD85} = {4959F170-02FB-4B7F-8F53-93DAF22713F9}
{63C1101D-7F7C-41B0-AE78-F30DC5CEA810} = {4959F170-02FB-4B7F-8F53-93DAF22713F9}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D30FC641-F06C-4E35-AEA5-48A9B6E59CE0}

View File

@@ -131,7 +131,7 @@
<ProjectReference Include="..\Extensions\AIStudio.Wpf.Flowchart\AIStudio.Wpf.Flowchart.csproj" />
<ProjectReference Include="..\Extensions\AIStudio.Wpf.Logical\AIStudio.Wpf.Logical.csproj" />
<ProjectReference Include="..\Extensions\AIStudio.Wpf.Mind\AIStudio.Wpf.Mind.csproj" />
<ProjectReference Include="..\Extensions\AIStudio.Wpf.RoslynScript\AIStudio.Wpf.RoslynScript.csproj" />
<ProjectReference Include="..\Extensions\AIStudio.Wpf.Script\AIStudio.Wpf.Script.csproj" />
<ProjectReference Include="..\Extensions\AIStudio.Wpf.SFC\AIStudio.Wpf.SFC.csproj" />
</ItemGroup>

View File

@@ -516,6 +516,10 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
{
flow = new MindViewModel(filename, diagram);
}
else if (diagram.DiagramType == DiagramType.Script)
{
flow = new ScriptViewModel(filename, diagram);
}
else
{
flow = new PageViewModel(filename, diagram);
@@ -631,6 +635,10 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
{
PageViewModel = new SFCViewModel(NewNameHelper.GetNewName(DiagramsViewModels.Select(p => p.Title), "新建-"), "*", (DiagramType)Enum.Parse(typeof(DiagramType), type));
}
else if (type == DiagramType.Script.ToString())
{
PageViewModel = new ScriptViewModel(NewNameHelper.GetNewName(DiagramsViewModels.Select(p => p.Title), "新建-"), "*", (DiagramType)Enum.Parse(typeof(DiagramType), type));
}
else
{
PageViewModel = new PageViewModel(NewNameHelper.GetNewName(DiagramsViewModels.Select(p => p.Title), "新建-"), "*", (DiagramType)Enum.Parse(typeof(DiagramType), type));

View File

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AIStudio.Wpf.DiagramApp.Models;
using AIStudio.Wpf.DiagramDesigner;
namespace AIStudio.Wpf.DiagramApp.ViewModels
{
public class ScriptViewModel : PageViewModel
{
public ScriptViewModel(string title, string status, DiagramType diagramType) : base(title, status, diagramType)
{
Init(true);
}
public ScriptViewModel(string filename, DiagramDocument diagramDocument) : base(filename, diagramDocument)
{
if (DiagramViewModel != null)
{
}
}
protected override void InitDiagramViewModel()
{
base.InitDiagramViewModel();
}
}
}

View File

@@ -97,6 +97,13 @@
<Button Margin="5" ToolTip="顺序控制图" Command="{Binding NewCommand}" CommandParameter="SFC" Width="80" Height="80" Foreground="{DynamicResource BlackBrush}" Background="{DynamicResource WhiteBrush}" BorderBrush="{DynamicResource BlackBrush}">
<Path Stretch="Fill" Margin="20" Fill="{DynamicResource GrayBrush2}" Data="M10.984 13.836a.5.5 0 0 1-.353-.146l-.745-.743a.5.5 0 1 1 .706-.708l.392.391 1.181-1.18a.5.5 0 0 1 .708.707l-1.535 1.533a.504.504 0 0 1-.354.146zm9.353-.147l1.534-1.532a.5.5 0 0 0-.707-.707l-1.181 1.18-.392-.391a.5.5 0 1 0-.706.708l.746.743a.497.497 0 0 0 .706-.001zM4.527 7.452l2.557-1.585A1 1 0 0 0 7.09 4.17L4.533 2.56A1 1 0 0 0 3 3.406v3.196a1.001 1.001 0 0 0 1.527.85zm2.03-2.436L4 6.602V3.406l2.557 1.61zM24 12.5c0 1.93-1.57 3.5-3.5 3.5a3.503 3.503 0 0 1-3.46-3h-2.08a3.503 3.503 0 0 1-3.46 3 3.502 3.502 0 0 1-3.46-3h-.558c-.972 0-1.85-.399-2.482-1.042V17c0 1.654 1.346 3 3 3h.04c.244-1.693 1.7-3 3.46-3 1.93 0 3.5 1.57 3.5 3.5S13.43 24 11.5 24a3.502 3.502 0 0 1-3.46-3H8c-2.206 0-4-1.794-4-4V9.899A5.008 5.008 0 0 1 0 5c0-2.757 2.243-5 5-5s5 2.243 5 5a5.005 5.005 0 0 1-4.952 4.998A2.482 2.482 0 0 0 7.482 12h.558c.244-1.693 1.7-3 3.46-3a3.502 3.502 0 0 1 3.46 3h2.08a3.503 3.503 0 0 1 3.46-3c1.93 0 3.5 1.57 3.5 3.5zm-15 8c0 1.378 1.122 2.5 2.5 2.5s2.5-1.122 2.5-2.5-1.122-2.5-2.5-2.5S9 19.122 9 20.5zM5 9c2.206 0 4-1.794 4-4S7.206 1 5 1 1 2.794 1 5s1.794 4 4 4zm9 3.5c0-1.378-1.122-2.5-2.5-2.5S9 11.122 9 12.5s1.122 2.5 2.5 2.5 2.5-1.122 2.5-2.5zm9 0c0-1.378-1.122-2.5-2.5-2.5S18 11.122 18 12.5s1.122 2.5 2.5 2.5 2.5-1.122 2.5-2.5zm-13 8a.5.5 0 1 0 1 0 .5.5 0 0 0-1 0zm2 0a.5.5 0 1 0 1 0 .5.5 0 0 0-1 0zm12 0c0 1.93-1.57 3.5-3.5 3.5a3.503 3.503 0 0 1-3.46-3.002c-.007.001-.013.005-.021.005l-.506.017h-.017a.5.5 0 0 1-.016-.999l.506-.017c.018-.002.035.006.052.007A3.503 3.503 0 0 1 20.5 17c1.93 0 3.5 1.57 3.5 3.5zm-1 0c0-1.378-1.122-2.5-2.5-2.5S18 19.122 18 20.5s1.122 2.5 2.5 2.5 2.5-1.122 2.5-2.5z" ></Path>
</Button>
<Button Margin="5" ToolTip="C#脚本" Command="{Binding NewCommand}" CommandParameter="Script" Width="80" Height="80" Foreground="{DynamicResource BlackBrush}" Background="{DynamicResource WhiteBrush}" BorderBrush="{DynamicResource BlackBrush}">
<Path Stretch="Uniform" Margin="20" Fill="{DynamicResource GrayBrush2}" Data="M490.666667 681.386667l17.493333 104.106666c-11.093333 5.973333-29.013333 11.52-52.906667 16.64-24.32 5.546667-52.906667 8.533333-85.76 8.533334-94.293333-1.706667-165.12-29.866667-212.48-83.626667C109.226667 672.853333 85.333333 604.16 85.333333 520.96c2.133333-98.56 30.72-174.08 85.333334-226.986667C226.986667 240.64 296.96 213.333333 381.44 213.333333c32 0 59.733333 2.986667 82.773333 8.106667s40.106667 10.666667 51.2 17.066667l-24.746666 106.24-45.226667-14.506667c-17.066667-4.266667-36.693333-6.4-59.306667-6.4-49.493333-0.426667-90.453333 15.36-122.453333 46.933333-32.426667 31.146667-49.066667 78.933333-50.346667 142.506667 0 58.026667 15.786667 103.253333 46.08 136.533333 30.293333 32.853333 72.96 49.92 127.573334 50.346667l56.746666-5.12c18.346667-3.413333 33.706667-8.106667 46.933334-13.653333M592.64 810.666667l26.026667-170.666667H554.666667l14.506666-85.333333h64l13.653334-85.333334h-64L597.333333 384h64l26.026667-170.666667h85.333333l-26.026666 170.666667h42.666666l26.026667-170.666667h85.333333l-26.026666 170.666667H938.666667l-14.506667 85.333333h-64l-13.653333 85.333334h64L896 640h-64l-26.026667 170.666667h-85.333333l26.026667-170.666667h-42.666667l-26.026667 170.666667h-85.333333m125.866667-256h42.666666l13.653334-85.333334h-42.666667l-13.653333 85.333334z" ></Path>
</Button>
</WrapPanel>
</TabItem>
<TabItem Header="思维导图" >
<WrapPanel Margin="5">
<Button Margin="5" ToolTip="思维导图" Command="{Binding NewMindCommand}" CommandParameter="Mind" Width="80" Height="80" Foreground="{DynamicResource BlackBrush}" Background="{DynamicResource WhiteBrush}" BorderBrush="{DynamicResource BlackBrush}">
<Path Stretch="Fill" Margin="20" Fill="{DynamicResource GrayBrush2}" Data="M903.526 542.788c-11.476-109.267-69.113-209.266-157.91-273.966 1.775-42.203-8.091-85.392-30.916-124.607C651.078 34.909 510.893-2.126 401.587 61.495c-75.837 44.141-116.869 125.136-113.649 207.104-69.606 50.492-123.007 124.277-147.063 213.792a391.809 391.809 0 0 0-11.196 59.809c-37.458 19.563-69.947 49.713-92.506 89.106-62.851 109.751-24.832 249.672 84.919 312.523 76.13 43.597 166.769 38.645 236.139-5.102a391.907 391.907 0 0 0 57.362 20.29c89.516 24.056 180.13 14.833 258.713-20.088 35.68 22.675 78.051 35.746 123.464 35.587 126.472-0.444 228.638-103.331 228.194-229.803-0.31-87.709-49.894-163.714-122.438-201.925zM343.497 234.956c7.264-51.226 37.068-98.744 85.254-126.791 83.531-48.619 190.659-20.317 239.278 63.214 11.79 20.256 19.044 41.901 22.096 63.762a175.057 175.057 0 0 1-2.102 60.33c-9.855 46.729-38.683 89.27-83.209 115.186-83.531 48.619-190.659 20.317-239.278-63.214-9.688-16.645-16.312-34.228-20.063-52.097a174.622 174.622 0 0 1-1.976-60.39z m9.101 640.606a174.59 174.59 0 0 1-51.354 31.888c-47.97 19.273-103.973 17.204-152.318-10.482-83.87-48.03-112.925-154.957-64.894-238.828 11.641-20.328 26.749-37.424 44.142-50.994a175.094 175.094 0 0 1 53.336-28.371c45.394-14.826 96.646-11.13 141.349 14.471 83.871 48.031 112.925 154.957 64.894 238.828-9.586 16.742-21.526 31.292-35.155 43.488z m77.009 31.305a339.803 339.803 0 0 1-24.38-7.545 229.776 229.776 0 0 0 29.388-40.412c62.851-109.751 24.832-249.672-84.919-312.523-51.188-29.314-108.937-36.677-162.371-25.063a339.779 339.779 0 0 1 5.7-24.919c18.21-67.764 55.959-125.048 105.538-167.454a229.77 229.77 0 0 0 20.304 45.656c63.621 109.306 203.806 146.341 313.112 82.72 51.001-29.685 86.26-76.04 102.911-128.148 57.693 49.633 96.988 117.799 111.025 192.597a229.761 229.761 0 0 0-49.756-5.258c-126.472 0.444-228.638 103.331-228.194 229.803 0.207 58.987 22.705 112.68 59.48 153.148-61.556 21.657-130.06 25.612-197.838 7.398z m367.972 13.649c-23.467 0.082-45.866-4.47-66.346-12.777a175.093 175.093 0 0 1-51.198-32.023c-35.495-31.897-57.89-78.104-58.07-129.584-0.34-96.649 77.735-175.274 174.384-175.614 19.296-0.068 37.87 2.998 55.249 8.705a174.572 174.572 0 0 1 53.254 28.504c40.693 31.906 66.915 81.451 67.111 137.175 0.34 96.649-77.735 175.274-174.384 175.614z" ></Path>
</Button>
@@ -116,8 +123,7 @@
<Path Stretch="Fill" Margin="20" Fill="{DynamicResource GrayBrush2}" Data="M832 368c42.666667-98.346667 46.08-183.466667 0-228.693333A125.226667 125.226667 0 0 0 740.906667 106.666667c-65.28 0-149.333333 31.146667-236.8 86.826666A341.333333 341.333333 0 0 0 193.493333 503.466667C105.173333 642.346667 79.146667 772.48 139.306667 832a125.226667 125.226667 0 0 0 91.733333 32.64A356.693333 356.693333 0 0 0 368.213333 832 341.333333 341.333333 0 0 0 832 368zM740.906667 192a47.786667 47.786667 0 0 1 31.36 7.68c10.666667 10.453333 11.733333 42.666667-1.706667 88.533333A341.333333 341.333333 0 0 0 650.666667 213.333333a260.906667 260.906667 0 0 1 90.24-21.333333zM533.333333 277.333333a256 256 0 0 1 200.746667 97.706667 861.44 861.44 0 0 1-154.666667 204.373333 874.666667 874.666667 0 0 1-204.586666 154.666667A256 256 0 0 1 533.333333 277.333333zM199.68 772.266667c-13.013333-12.8-11.306667-58.026667 13.44-121.386667a344.32 344.32 0 0 0 74.88 119.466667 208.426667 208.426667 0 0 1-56.96 9.6 47.786667 47.786667 0 0 1-31.36-7.68zM533.333333 789.333333a252.586667 252.586667 0 0 1-67.626666-9.386666A997.973333 997.973333 0 0 0 640 640a1005.866667 1005.866667 0 0 0 140.373333-173.866667A252.586667 252.586667 0 0 1 789.333333 533.333333a256 256 0 0 1-256 256z" ></Path>
</Button>
</WrapPanel>
</TabItem>
<TabItem Header="待续" />
</TabItem>
</TabControl>
</Fluent:BackstageTabItem>
<Fluent:Button Header="保存"

View File

@@ -10,6 +10,7 @@ namespace AIStudio.Wpf.DiagramDesigner
FlowChart,
Logical,
SFC,
Mind
Mind,
Script
}
}

View File

@@ -1,7 +1,7 @@
<Project>
<!-- Project properties -->
<PropertyGroup>
<TargetFrameworks>net461;netcoreapp3.1;net5.0-windows</TargetFrameworks>
<TargetFrameworks>net461;netcoreapp3.1;net5.0-windows;net6.0-windows</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

View File

@@ -5,7 +5,7 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\AIStudio.Wpf.DiagramModels\AIStudio.Wpf.DiagramDesigner.Serializable.csproj" />
<ProjectReference Include="..\..\AIStudio.Wpf.DiagramDesigner.Serializable\AIStudio.Wpf.DiagramDesigner.Serializable.csproj" />
</ItemGroup>
</Project>

View File

@@ -12,4 +12,16 @@
<ProjectReference Include="..\..\AIStudio.Wpf.DiagramDesigner\AIStudio.Wpf.DiagramDesigner.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<PackageReference Include="AvalonEdit">
<Version>6.2.0.78</Version>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0-windows'">
<PackageReference Include="AvalonEdit">
<Version>6.2.0.78</Version>
</PackageReference>
</ItemGroup>
</Project>