mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 00:00:57 +08:00
58 lines
1.1 KiB
C#
58 lines
1.1 KiB
C#
using AIStudio.Wpf.DiagramDesigner;
|
|
using Newtonsoft.Json.Linq;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace AIStudio.Wpf.DiagramDesigner
|
|
{
|
|
public class ConstParameter : BindableBase, IParameter
|
|
{
|
|
|
|
|
|
private string _text;
|
|
|
|
public string Text
|
|
{
|
|
get
|
|
{
|
|
return _text;
|
|
}
|
|
set
|
|
{
|
|
SetProperty(ref _text, value);
|
|
}
|
|
}
|
|
|
|
private object _value;
|
|
|
|
public object Value
|
|
{
|
|
get
|
|
{
|
|
return _value;
|
|
}
|
|
set
|
|
{
|
|
SetProperty(ref _value, value);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void Add(object value)
|
|
{
|
|
if (double.TryParse(Value?.ToString() ?? "", out var value1) && double.TryParse(value?.ToString() ?? "", out var value2))
|
|
{
|
|
Value = value1 + value2;
|
|
}
|
|
else
|
|
{
|
|
Value = $"{Value}{value}";
|
|
}
|
|
}
|
|
}
|
|
}
|