diff --git a/AIStudio.Wpf.Diagram.sln b/AIStudio.Wpf.Diagram.sln index 09fd910..d0ba126 100644 --- a/AIStudio.Wpf.Diagram.sln +++ b/AIStudio.Wpf.Diagram.sln @@ -33,8 +33,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Demos", "Demos", "{62DC8608 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AIStudio.Wpf.DiagramDesigner.Demo", "Demos\AIStudio.Wpf.DiagramDesigner.Demo\AIStudio.Wpf.DiagramDesigner.Demo.csproj", "{FCFC5ABF-8459-4B45-ABA0-9B820C7ED5C6}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AIStudio.Wpf.Script", "Extensions\AIStudio.Wpf.Script\AIStudio.Wpf.Script.csproj", "{27A4C86D-3792-4D14-BAEE-3B103A709872}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AIStudio.Wpf.Block", "Extensions\AIStudio.Wpf.Block\AIStudio.Wpf.Block.csproj", "{C7031E27-57A9-498E-95EE-9C3E7DCCA642}" EndProject Global @@ -79,10 +77,6 @@ Global {FCFC5ABF-8459-4B45-ABA0-9B820C7ED5C6}.Debug|Any CPU.Build.0 = Debug|Any CPU {FCFC5ABF-8459-4B45-ABA0-9B820C7ED5C6}.Release|Any CPU.ActiveCfg = Release|Any CPU {FCFC5ABF-8459-4B45-ABA0-9B820C7ED5C6}.Release|Any CPU.Build.0 = Release|Any CPU - {27A4C86D-3792-4D14-BAEE-3B103A709872}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {27A4C86D-3792-4D14-BAEE-3B103A709872}.Debug|Any CPU.Build.0 = Debug|Any CPU - {27A4C86D-3792-4D14-BAEE-3B103A709872}.Release|Any CPU.ActiveCfg = Release|Any CPU - {27A4C86D-3792-4D14-BAEE-3B103A709872}.Release|Any CPU.Build.0 = Release|Any CPU {C7031E27-57A9-498E-95EE-9C3E7DCCA642}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C7031E27-57A9-498E-95EE-9C3E7DCCA642}.Debug|Any CPU.Build.0 = Debug|Any CPU {C7031E27-57A9-498E-95EE-9C3E7DCCA642}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -97,7 +91,6 @@ Global {2AB69067-277E-4EE0-9949-8326A145EEE4} = {4959F170-02FB-4B7F-8F53-93DAF22713F9} {85C437B9-16D2-4076-ABCD-52029AC232FC} = {4959F170-02FB-4B7F-8F53-93DAF22713F9} {FCFC5ABF-8459-4B45-ABA0-9B820C7ED5C6} = {62DC8608-D98F-47BB-9F19-ABB0C60B72FF} - {27A4C86D-3792-4D14-BAEE-3B103A709872} = {4959F170-02FB-4B7F-8F53-93DAF22713F9} {C7031E27-57A9-498E-95EE-9C3E7DCCA642} = {4959F170-02FB-4B7F-8F53-93DAF22713F9} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution diff --git a/Extensions/AIStudio.Wpf.Script/AIStudio.Wpf.Script.csproj b/Extensions/AIStudio.Wpf.Script/AIStudio.Wpf.Script.csproj deleted file mode 100644 index 316b0f8..0000000 --- a/Extensions/AIStudio.Wpf.Script/AIStudio.Wpf.Script.csproj +++ /dev/null @@ -1,73 +0,0 @@ - - - - true - AIStudio.Wpf.Controls - akwkevin - https://gitee.com/akwkevin - A.png - - - 1.0.6 - 一个Wpf的脚本生成模块 - - - - - - - - - - - - - - - Dlls\net5.0-windows\AIStudio.Wpf.Script.Core.dll - - - Dlls\net5.0-windows\HL.dll - - - Dlls\net5.0-windows\TextEditLib.dll - - - - - - Dlls\net6.0-windows\AIStudio.Wpf.Script.Core.dll - - - Dlls\net6.0-windows\HL.dll - - - Dlls\net6.0-windows\TextEditLib.dll - - - - - - Dlls\netcoreapp3.1\AIStudio.Wpf.Script.Core.dll - - - Dlls\netcoreapp3.1\HL.dll - - - Dlls\netcoreapp3.1\TextEditLib.dll - - - - - - Dlls\net461\AIStudio.Wpf.Script.Core.dll - - - Dlls\net461\HL.dll - - - Dlls\net461\TextEditLib.dll - - - - diff --git a/Extensions/AIStudio.Wpf.Script/AIStudio.Wpf.Script_5k10wu0u_wpftmp.csproj b/Extensions/AIStudio.Wpf.Script/AIStudio.Wpf.Script_5k10wu0u_wpftmp.csproj deleted file mode 100644 index 59edb5e..0000000 --- a/Extensions/AIStudio.Wpf.Script/AIStudio.Wpf.Script_5k10wu0u_wpftmp.csproj +++ /dev/null @@ -1,203 +0,0 @@ - - - AIStudio.Wpf.Script - obj\Debug\ - obj\ - F:\aistudio.-wpf.-diagram\Extensions\AIStudio.Wpf.Script\obj\ - <_TargetAssemblyProjectName>AIStudio.Wpf.Script - - - - true - AIStudio.Wpf.Controls - akwkevin - https://gitee.com/akwkevin - A.png - - - 1.0.6 - 一个Wpf的脚本生成模块 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Extensions/AIStudio.Wpf.Script/AIStudio.Wpf.Script_a4fgwrgk_wpftmp.csproj b/Extensions/AIStudio.Wpf.Script/AIStudio.Wpf.Script_a4fgwrgk_wpftmp.csproj deleted file mode 100644 index abd163d..0000000 --- a/Extensions/AIStudio.Wpf.Script/AIStudio.Wpf.Script_a4fgwrgk_wpftmp.csproj +++ /dev/null @@ -1,276 +0,0 @@ - - - AIStudio.Wpf.Script - obj\Debug\ - obj\ - F:\aistudio.-wpf.-diagram\Extensions\AIStudio.Wpf.Script\obj\ - <_TargetAssemblyProjectName>AIStudio.Wpf.Script - - - - true - AIStudio.Wpf.Controls - akwkevin - https://gitee.com/akwkevin - A.png - - - 1.0.6 - 一个Wpf的脚本生成模块 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Extensions/AIStudio.Wpf.Script/AIStudio.Wpf.Script_iozmnnjw_wpftmp.csproj b/Extensions/AIStudio.Wpf.Script/AIStudio.Wpf.Script_iozmnnjw_wpftmp.csproj deleted file mode 100644 index 7d1a01b..0000000 --- a/Extensions/AIStudio.Wpf.Script/AIStudio.Wpf.Script_iozmnnjw_wpftmp.csproj +++ /dev/null @@ -1,276 +0,0 @@ - - - AIStudio.Wpf.Script - obj\Debug\ - obj\ - F:\aistudio.-wpf.-diagram\Extensions\AIStudio.Wpf.Script\obj\ - <_TargetAssemblyProjectName>AIStudio.Wpf.Script - - - - true - AIStudio.Wpf.Controls - akwkevin - https://gitee.com/akwkevin - A.png - - - 1.0.6 - 一个Wpf的脚本生成模块 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Extensions/AIStudio.Wpf.Script/AIStudio.Wpf.Script_l225ygvw_wpftmp.csproj b/Extensions/AIStudio.Wpf.Script/AIStudio.Wpf.Script_l225ygvw_wpftmp.csproj deleted file mode 100644 index abd163d..0000000 --- a/Extensions/AIStudio.Wpf.Script/AIStudio.Wpf.Script_l225ygvw_wpftmp.csproj +++ /dev/null @@ -1,276 +0,0 @@ - - - AIStudio.Wpf.Script - obj\Debug\ - obj\ - F:\aistudio.-wpf.-diagram\Extensions\AIStudio.Wpf.Script\obj\ - <_TargetAssemblyProjectName>AIStudio.Wpf.Script - - - - true - AIStudio.Wpf.Controls - akwkevin - https://gitee.com/akwkevin - A.png - - - 1.0.6 - 一个Wpf的脚本生成模块 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Extensions/AIStudio.Wpf.Script/AIStudio.Wpf.Script_vs4rptnz_wpftmp.csproj b/Extensions/AIStudio.Wpf.Script/AIStudio.Wpf.Script_vs4rptnz_wpftmp.csproj deleted file mode 100644 index 186a2f4..0000000 --- a/Extensions/AIStudio.Wpf.Script/AIStudio.Wpf.Script_vs4rptnz_wpftmp.csproj +++ /dev/null @@ -1,268 +0,0 @@ - - - AIStudio.Wpf.Script - obj\Debug\ - obj\ - F:\aistudio.-wpf.-diagram\Extensions\AIStudio.Wpf.Script\obj\ - <_TargetAssemblyProjectName>AIStudio.Wpf.Script - - - - true - AIStudio.Wpf.Controls - akwkevin - https://gitee.com/akwkevin - A.png - - - 1.0.6 - 一个Wpf的脚本生成模块 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Extensions/AIStudio.Wpf.Script/Dlls/net461/AIStudio.Wpf.Script.Core.dll b/Extensions/AIStudio.Wpf.Script/Dlls/net461/AIStudio.Wpf.Script.Core.dll deleted file mode 100644 index c79b0d0..0000000 Binary files a/Extensions/AIStudio.Wpf.Script/Dlls/net461/AIStudio.Wpf.Script.Core.dll and /dev/null differ diff --git a/Extensions/AIStudio.Wpf.Script/Dlls/net461/HL.dll b/Extensions/AIStudio.Wpf.Script/Dlls/net461/HL.dll deleted file mode 100644 index cf7ddcc..0000000 Binary files a/Extensions/AIStudio.Wpf.Script/Dlls/net461/HL.dll and /dev/null differ diff --git a/Extensions/AIStudio.Wpf.Script/Dlls/net461/TextEditLib.dll b/Extensions/AIStudio.Wpf.Script/Dlls/net461/TextEditLib.dll deleted file mode 100644 index d75d67f..0000000 Binary files a/Extensions/AIStudio.Wpf.Script/Dlls/net461/TextEditLib.dll and /dev/null differ diff --git a/Extensions/AIStudio.Wpf.Script/Dlls/net5.0-windows/AIStudio.Wpf.Script.Core.dll b/Extensions/AIStudio.Wpf.Script/Dlls/net5.0-windows/AIStudio.Wpf.Script.Core.dll deleted file mode 100644 index 0e09b58..0000000 Binary files a/Extensions/AIStudio.Wpf.Script/Dlls/net5.0-windows/AIStudio.Wpf.Script.Core.dll and /dev/null differ diff --git a/Extensions/AIStudio.Wpf.Script/Dlls/net5.0-windows/HL.dll b/Extensions/AIStudio.Wpf.Script/Dlls/net5.0-windows/HL.dll deleted file mode 100644 index bda4cfb..0000000 Binary files a/Extensions/AIStudio.Wpf.Script/Dlls/net5.0-windows/HL.dll and /dev/null differ diff --git a/Extensions/AIStudio.Wpf.Script/Dlls/net5.0-windows/TextEditLib.dll b/Extensions/AIStudio.Wpf.Script/Dlls/net5.0-windows/TextEditLib.dll deleted file mode 100644 index 7925962..0000000 Binary files a/Extensions/AIStudio.Wpf.Script/Dlls/net5.0-windows/TextEditLib.dll and /dev/null differ diff --git a/Extensions/AIStudio.Wpf.Script/Dlls/net6.0-windows/AIStudio.Wpf.Script.Core.dll b/Extensions/AIStudio.Wpf.Script/Dlls/net6.0-windows/AIStudio.Wpf.Script.Core.dll deleted file mode 100644 index aef9f0f..0000000 Binary files a/Extensions/AIStudio.Wpf.Script/Dlls/net6.0-windows/AIStudio.Wpf.Script.Core.dll and /dev/null differ diff --git a/Extensions/AIStudio.Wpf.Script/Dlls/net6.0-windows/HL.dll b/Extensions/AIStudio.Wpf.Script/Dlls/net6.0-windows/HL.dll deleted file mode 100644 index 2742612..0000000 Binary files a/Extensions/AIStudio.Wpf.Script/Dlls/net6.0-windows/HL.dll and /dev/null differ diff --git a/Extensions/AIStudio.Wpf.Script/Dlls/net6.0-windows/TextEditLib.dll b/Extensions/AIStudio.Wpf.Script/Dlls/net6.0-windows/TextEditLib.dll deleted file mode 100644 index 292aefe..0000000 Binary files a/Extensions/AIStudio.Wpf.Script/Dlls/net6.0-windows/TextEditLib.dll and /dev/null differ diff --git a/Extensions/AIStudio.Wpf.Script/Dlls/netcoreapp3.1/AIStudio.Wpf.Script.Core.dll b/Extensions/AIStudio.Wpf.Script/Dlls/netcoreapp3.1/AIStudio.Wpf.Script.Core.dll deleted file mode 100644 index 2192239..0000000 Binary files a/Extensions/AIStudio.Wpf.Script/Dlls/netcoreapp3.1/AIStudio.Wpf.Script.Core.dll and /dev/null differ diff --git a/Extensions/AIStudio.Wpf.Script/Dlls/netcoreapp3.1/HL.dll b/Extensions/AIStudio.Wpf.Script/Dlls/netcoreapp3.1/HL.dll deleted file mode 100644 index fc58997..0000000 Binary files a/Extensions/AIStudio.Wpf.Script/Dlls/netcoreapp3.1/HL.dll and /dev/null differ diff --git a/Extensions/AIStudio.Wpf.Script/Dlls/netcoreapp3.1/TextEditLib.dll b/Extensions/AIStudio.Wpf.Script/Dlls/netcoreapp3.1/TextEditLib.dll deleted file mode 100644 index f89dd29..0000000 Binary files a/Extensions/AIStudio.Wpf.Script/Dlls/netcoreapp3.1/TextEditLib.dll and /dev/null differ diff --git a/Extensions/AIStudio.Wpf.Script/Properties/AssemblyInfo.cs b/Extensions/AIStudio.Wpf.Script/Properties/AssemblyInfo.cs deleted file mode 100644 index 858ca0a..0000000 --- a/Extensions/AIStudio.Wpf.Script/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Windows; -using System.Windows.Markup; - -[assembly: ThemeInfo( - ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located - //(used if a resource is not found in the page, - // or application resource dictionaries) - ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located - //(used if a resource is not found in the page, - // app, or any theme specific resource dictionaries) -)] - -[assembly: XmlnsDefinition("https://gitee.com/akwkevin/aistudio.-wpf.-diagram", "AIStudio.Wpf.Script")] - - -[assembly: XmlnsPrefix("https://gitee.com/akwkevin/aistudio.-wpf.-diagram", "dd")] diff --git a/Extensions/AIStudio.Wpf.Script/Themes/ColorBoxCollectorScriptViewModel.xaml b/Extensions/AIStudio.Wpf.Script/Themes/ColorBoxCollectorScriptViewModel.xaml deleted file mode 100644 index 51d191b..0000000 --- a/Extensions/AIStudio.Wpf.Script/Themes/ColorBoxCollectorScriptViewModel.xaml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Extensions/AIStudio.Wpf.Script/Themes/ColorBoxFactoryScriptViewModel.xaml b/Extensions/AIStudio.Wpf.Script/Themes/ColorBoxFactoryScriptViewModel.xaml deleted file mode 100644 index 41a8992..0000000 --- a/Extensions/AIStudio.Wpf.Script/Themes/ColorBoxFactoryScriptViewModel.xaml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Extensions/AIStudio.Wpf.Script/ViewModels/ColorBoxCollectorScriptViewModel.cs b/Extensions/AIStudio.Wpf.Script/ViewModels/ColorBoxCollectorScriptViewModel.cs deleted file mode 100644 index 5cd829d..0000000 --- a/Extensions/AIStudio.Wpf.Script/ViewModels/ColorBoxCollectorScriptViewModel.cs +++ /dev/null @@ -1,82 +0,0 @@ -using AIStudio.Wpf.DiagramDesigner; -using AIStudio.Wpf.DiagramDesigner.Models; -using AIStudio.Wpf.Script.Core.Models; -using AIStudio.Wpf.Script.Core.ViewModels; -using System.Collections.Generic; - -namespace AIStudio.Wpf.Script.ViewModels -{ - public class ColorBoxCollectorScriptViewModel : RoslynScriptViewModel - { - public ColorBoxCollectorScriptViewModel() - { - } - - public ColorBoxCollectorScriptViewModel(IDiagramViewModel root) : base(root) - { - } - - public ColorBoxCollectorScriptViewModel(IDiagramViewModel root, SelectableItemBase designer) : base(root, designer) - { - } - - public ColorBoxCollectorScriptViewModel(IDiagramViewModel root, SerializableItem serializableItem, string serializableType) : base(root, serializableItem, serializableType) - { - } - - protected override void InitNew() - { - base.InitNew(); - - ItemWidth = 230; - ItemHeight = 76; - Code = @"using System; -using System.Collections.Generic; -using AIStudio.Wpf.Script.Core.Models; -using System.Windows.Media; -using System.Linq; - -namespace AIStudio.Wpf.CSharpScript -{ - public class ColorBoxFactory - { - private List ItemsSource { get; set;} = new List(); - public ColorBoxModel Input {private get; set;} - public int Count{ get; private set;} - - public void Execute() - { - if (Input != null) - { - if(ItemsSource.Count >= 100) - { - ItemsSource.Clear(); - } - ItemsSource.Add(Input); - Input = null; - Console.WriteLine($""收集到{Input.Text}号Box""); - } - - Count = ItemsSource.Count; - } - } -}"; - } - - private List _itemsSource; - public List ItemsSource - { - get - { - return _itemsSource; - } - set - { - SetProperty(ref _itemsSource, value); - } - } - - public ColorBoxModel Tag { get; set; } - - } -} diff --git a/Extensions/AIStudio.Wpf.Script/ViewModels/ColorBoxFactoryScriptViewModel.cs b/Extensions/AIStudio.Wpf.Script/ViewModels/ColorBoxFactoryScriptViewModel.cs deleted file mode 100644 index b46561e..0000000 --- a/Extensions/AIStudio.Wpf.Script/ViewModels/ColorBoxFactoryScriptViewModel.cs +++ /dev/null @@ -1,102 +0,0 @@ -using AIStudio.Wpf.DiagramDesigner; -using AIStudio.Wpf.DiagramDesigner.Models; -using AIStudio.Wpf.Script.Core.Models; -using AIStudio.Wpf.Script.Core.ViewModels; -using System.Collections.Generic; - -namespace AIStudio.Wpf.Script.ViewModels -{ - public class ColorBoxFactoryScriptViewModel : RoslynScriptViewModel - { - public ColorBoxFactoryScriptViewModel() - { - } - - public ColorBoxFactoryScriptViewModel(IDiagramViewModel root) : base(root) - { - } - - public ColorBoxFactoryScriptViewModel(IDiagramViewModel root, SelectableItemBase designer) : base(root, designer) - { - } - - public ColorBoxFactoryScriptViewModel(IDiagramViewModel root, SerializableItem serializableItem, string serializableType) : base(root, serializableItem, serializableType) - { - } - - protected override void InitNew() - { - base.InitNew(); - - ItemWidth = 230; - ItemHeight = 230; - Code = @"using System; -using System.Collections.Generic; -using AIStudio.Wpf.Script.Core.Models; -using System.Windows.Media; -using System.Linq; - -namespace AIStudio.Wpf.CSharpScript -{ - public class ColorBoxFactory - { - public int Count{private get;set;} = 100; - private List ItemsSource { get; set;} = new List(); - public ColorBoxModel Output {get;private set;} - - public void Execute() - { - if (ItemsSource.Count == 0) - { - Random random = new Random(); - - for (int i = 0; i < Count; i++) - { - var sharpindex = random.Next(0, 8); - if (sharpindex == 7) - { - sharpindex = 0; - } - - var colorindex = random.Next(0, 8); - if (colorindex == 7) - { - colorindex = 0; - } - string sharp = ColorBoxModel.SettingSharps[sharpindex]; - Color color = ColorBoxModel.SettingColors[colorindex]; - - ColorBoxModel colorBoxModel = new ColorBoxModel(i.ToString(), sharp, color); - ItemsSource.Add(colorBoxModel); - } - Console.WriteLine($""初始化完成,一共初始化Box{Count}个""); - } - else if (Output == null) - { - Output = ItemsSource.FirstOrDefault(); - ItemsSource.RemoveAt(0); - Console.WriteLine($""装配{Output.Text}号Box""); - } - } - } -}"; - } - - private List _itemsSource; - public List ItemsSource - { - get - { - return _itemsSource; - } - set - { - SetProperty(ref _itemsSource, value); - } - } - - - } - - -} diff --git a/Extensions/AIStudio.Wpf.Script/ViewModels/ColorBoxIfScriptViewModel.cs b/Extensions/AIStudio.Wpf.Script/ViewModels/ColorBoxIfScriptViewModel.cs deleted file mode 100644 index 9a3291e..0000000 --- a/Extensions/AIStudio.Wpf.Script/ViewModels/ColorBoxIfScriptViewModel.cs +++ /dev/null @@ -1,96 +0,0 @@ -using AIStudio.Wpf.DiagramDesigner; -using AIStudio.Wpf.DiagramDesigner.Models; -using AIStudio.Wpf.Script.Core.Models; -using AIStudio.Wpf.Script.Core.ViewModels; -using System.Collections.Generic; - -namespace AIStudio.Wpf.Script.ViewModels -{ - public class ColorBoxIfScriptViewModel : RoslynScriptViewModel - { - public ColorBoxIfScriptViewModel() - { - } - - public ColorBoxIfScriptViewModel(IDiagramViewModel root) : base(root) - { - } - - public ColorBoxIfScriptViewModel(IDiagramViewModel root, SelectableItemBase designer) : base(root, designer) - { - } - - public ColorBoxIfScriptViewModel(IDiagramViewModel root, SerializableItem serializableItem, string serializableType) : base(root, serializableItem, serializableType) - { - } - - protected override void InitNew() - { - base.InitNew(); - - ItemWidth = 80; - ItemHeight = 80; - Text = "均衡分配器"; - Code = @"using System; -using System.Collections.Generic; -using AIStudio.Wpf.Script.Core.Models; -using System.Windows.Media; -using System.Linq; - -namespace AIStudio.Wpf.CSharpScript -{ - public class ColorBoxIfScript - { - public int Count1 {private get;set;} - public int Count2 {private get;set;} - public ColorBoxModel Input {private get; set;} - public ColorBoxModel Output1 {get;private set;} - public ColorBoxModel Output2 {get;private set;} - - public void Execute() - { - if (Input != null) - { - Console.WriteLine($""等待均衡负载{Input.Text}号Box""); - if (Count1 <= Count2) - { - if (Output1 == null) - { - Output1 = Input; - Input = null; - Console.WriteLine($""{Output1.Text}号Box均衡负载完毕,送往1号出口""); - } - } - else - { - if (Output2 == null) - { - Output2 = Input; - Input = null; - Console.WriteLine($""{Output2.Text}号Box均衡负载完毕,送往2号出口""); - } - } - } - } - } -}"; - } - - private List _itemsSource; - public List ItemsSource - { - get - { - return _itemsSource; - } - set - { - SetProperty(ref _itemsSource, value); - } - } - - - } - - -} diff --git a/Extensions/AIStudio.Wpf.Script/ViewModels/ColorBoxSwitchScriptViewModel.cs b/Extensions/AIStudio.Wpf.Script/ViewModels/ColorBoxSwitchScriptViewModel.cs deleted file mode 100644 index a5c1f76..0000000 --- a/Extensions/AIStudio.Wpf.Script/ViewModels/ColorBoxSwitchScriptViewModel.cs +++ /dev/null @@ -1,189 +0,0 @@ -using AIStudio.Wpf.DiagramDesigner; -using AIStudio.Wpf.DiagramDesigner.Models; -using AIStudio.Wpf.Script.Core.ViewModels; - -namespace AIStudio.Wpf.Script.ViewModels -{ - public class ColorBoxSwitchScriptViewModel : RoslynScriptViewModel - { - public ColorBoxSwitchScriptViewModel() - { - } - - public ColorBoxSwitchScriptViewModel(IDiagramViewModel root) : base(root) - { - } - - public ColorBoxSwitchScriptViewModel(IDiagramViewModel root, SelectableItemBase designer) : base(root, designer) - { - } - - public ColorBoxSwitchScriptViewModel(IDiagramViewModel root, SerializableItem serializableItem, string serializableType) : base(root, serializableItem, serializableType) - { - } - - protected override void InitNew() - { - base.InitNew(); - - Text = "ColorBox分配器"; - ItemWidth = 100; - ItemHeight = 230; - Code = @"using AIStudio.Wpf.Script.Core.Models; -using System; - -namespace AIStudio.Wpf.CSharpScript -{ - public class ColorBoxSwitch - { - public bool Mode { private get; set; } - public string Description { get; private set; } - public ColorBoxModel Input { private get; set; } - public ColorBoxModel Output1 { get; private set; } - public ColorBoxModel Output2 { get; private set; } - public ColorBoxModel Output3 { get; private set; } - public ColorBoxModel Output4 { get; private set; } - public ColorBoxModel Output5 { get; private set; } - public ColorBoxModel Output6 { get; private set; } - public ColorBoxModel Output7 { get; private set; } - - public void Execute() - { - if (Input == null) - return; - - if (Mode == false) - { - Console.WriteLine($""正在使用按颜色分配,等待分配{Input.Text}号Box""); - Description = ""欢迎来到AIStudio Diagream Box装配工厂,正在使用按颜色分配Box""; - switch (Input.Color.ToString()) - { - case ""#FFFF0000"": - if (Output1 == null) - { - Output1 = Input; - Input = null; - Console.WriteLine($""{Output1.Text}号Box分配完毕,送往1号出口""); - } - break; - case ""#FFFFA500"": - if (Output2 == null) - { - Output2 = Input; - Input = null; - Console.WriteLine($""{Output2.Text}号Box分配完毕,送往2号出口""); - } - break; - case ""#FFFFFF00"": - if (Output3 == null) - { - Output3 = Input; - Input = null; - Console.WriteLine($""{Output3.Text}号Box分配完毕,送往3号出口""); - } - break; - case ""#FF008000"": - if (Output4 == null) - { - Output4 = Input; - Input = null; - Console.WriteLine($""{Output4.Text}号Box分配完毕,送往4号出口""); - } - break; - case ""#FF00FFFF"": - if (Output5 == null) - { - Output5 = Input; - Input = null; - Console.WriteLine($""{Output5.Text}号Box分配完毕,送往5号出口""); - } - break; - case ""#FF0000FF"": - if (Output6 == null) - { - Output6 = Input; - Input = null; - Console.WriteLine($""{Output6.Text}号Box分配完毕,送往6号出口""); - } - break; - default: - if (Output7 == null) - { - Output7 = Input; - Input = null; - Console.WriteLine($""{Output7.Text}号Box分配完毕,送往7号出口""); - } - break; - } - } - else - { - Console.WriteLine($""正在使用按形状分配,等待分配{Input.Text}号Box""); - Description = ""欢迎来到AIStudio Diagream Box装配工厂,正在使用按形状分配Box""; - switch (Input.Path) - { - case ""M 10,20 A 20,20 0 1 1 50,20 A 20,20 0 1 1 10,20"": - if (Output1 == null) - { - Output1 = Input; - Input = null; - Console.WriteLine($""{Output1.Text}号Box分配完毕,送往1号出口""); - } - break; - case ""M1,21H23L12,2"": - if (Output2 == null) - { - Output2 = Input; - Input = null; - Console.WriteLine($""{Output2.Text}号Box分配完毕,送往2号出口""); - } - break; - case ""M3,3V21H21V3"": - if (Output3 == null) - { - Output3 = Input; - Input = null; - Console.WriteLine($""{Output3.Text}号Box分配完毕,送往3号出口""); - } - break; - case ""M 0,20 L 30 0 L 60,20 L 30,40 Z"": - if (Output4 == null) - { - Output4 = Input; - Input = null; - Console.WriteLine($""{Output4.Text}号Box分配完毕,送往4号出口""); - } - break; - case ""M10 3.22l-.61-.6a5.5 5.5 0 0 0-7.78 7.77L10 18.78l8.39-8.4a5.5 5.5 0 0 0-7.78-7.77l-.61.61z"": - if (Output5 == null) - { - Output5 = Input; - Input = null; - Console.WriteLine($""{Output5.Text}号Box分配完毕,送往5号出口""); - } - break; - case ""M 9,2 11,7 17,7 12,10 14,15 9,12 4,15 6,10 1,7 7,7 Z"": - if (Output6 == null) - { - Output6 = Input; - Input = null; - Console.WriteLine($""{Output6.Text}号Box分配完毕,送往6号出口""); - } - break; - default: - if (Output7 == null) - { - Output7 = Input; - Input = null; - Console.WriteLine($""{Output7.Text}号Box分配完毕,送往7号出口""); - } - break; - } - } - } - } -}"; - } - - } -}