From 55678e72ed1f7701996531c28bcadab1910409a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=89=BE=E7=AB=B9?= Date: Sat, 29 Jul 2023 12:35:09 +0800 Subject: [PATCH] block size --- .../Models/Values/ConstParameter.cs | 31 ++++++++++++++----- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/AIStudio.Wpf.DiagramDesigner/Models/Values/ConstParameter.cs b/AIStudio.Wpf.DiagramDesigner/Models/Values/ConstParameter.cs index 3fdb703..be71378 100644 --- a/AIStudio.Wpf.DiagramDesigner/Models/Values/ConstParameter.cs +++ b/AIStudio.Wpf.DiagramDesigner/Models/Values/ConstParameter.cs @@ -1,16 +1,10 @@ -using AIStudio.Wpf.DiagramDesigner; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; namespace AIStudio.Wpf.DiagramDesigner { public class ConstParameter : BindableBase, IParameter { - + private string _text; @@ -53,5 +47,26 @@ namespace AIStudio.Wpf.DiagramDesigner Value = $"{Value}{value}"; } } + + public T GetValue() + { + T var1 = default(T); + + if (Value is T double1) + { + var1 = double1; + } + else + { + try + { + var1 = (T)Convert.ChangeType(Value?.ToString(), typeof(T)); + } + catch { } + } + + return var1; + + } } }