chr
2024-03-04 63f80f007b6b217e124a72bee63063c1868399ad
新增变量类型
3个文件已修改
2个文件已添加
207 ■■■■■ 已修改文件
Models/Param.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Models/Program.cs 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Models/Step.cs 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Models/Variable.cs 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WPFProject.csproj 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Models/Param.cs
New file
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WPFProject.Models
{
    public class Param
    {
    }
}
Models/Program.cs
@@ -1,29 +1,63 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WPFProject.Models
{
    public class Program : NotifyBase
    {
        private string _Name;
        public string Name
        {
            get { return _Name; }
            set => RaiseAndSetIfChanged(ref _Name, value);
        }
        private ObservableCollection<Sequence> _Sequences;
        public ObservableCollection<Sequence> Sequences
        {
            get { return _Sequences; }
            set => RaiseAndSetIfChanged(ref _Sequences, value);
        }
    }
}
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WPFProject.Models
{
    public class Program : NotifyBase
    {
        /// <summary>
        /// 程序名
        /// </summary>
        private string _Name;
        public string Name
        {
            get { return _Name; }
            set => RaiseAndSetIfChanged(ref _Name, value);
        }
        /// <summary>
        /// 程序所需参数
        /// </summary>
        private ObservableCollection<Variable> _Variables;
        public ObservableCollection<Variable> Variables
        {
            get { return _Variables; }
            set => RaiseAndSetIfChanged(ref _Variables, value);
        }
        /// <summary>
        /// 序列集合
        /// </summary>
        private ObservableCollection<Sequence> _Sequences;
        public ObservableCollection<Sequence> Sequences
        {
            get { return _Sequences; }
            set => RaiseAndSetIfChanged(ref _Sequences, value);
        }
        /// <summary>
        /// 所需参数
        /// </summary>
        private Dictionary<string, Variable> _Vars;
        public Dictionary<string, Variable> Vars
        {
            get { return _Vars; }
            set { _Vars = value; }
        }
        /// <summary>
        /// 计算临时参数
        /// </summary>
        private Dictionary<string, Variable> _TempVars;
        public Dictionary<string, Variable> TempVars
        {
            get { return _TempVars; }
            set { _TempVars = value; }
        }
    }
}
Models/Step.cs
@@ -7,13 +7,53 @@
namespace WPFProject.Models
{
    public class Step : NotifyBase
    {
        private string _Name;
    {
        #region 字段
        private int _Index;
        public int Index
        {
            get { return _Index; }
            set => RaiseAndSetIfChanged(ref _Index, value);
        }
        private string _Name;
        public string Name
        {
            get { return _Name; }
            set => RaiseAndSetIfChanged(ref _Name, value);
        }
        private string _DllPath;
        public string DllPath
        {
            get { return _DllPath; }
            set => RaiseAndSetIfChanged(ref _DllPath, value);
        }
        private string _ClassName;
        public string ClassName
        {
            get { return _ClassName; }
            set => RaiseAndSetIfChanged(ref _ClassName, value);
        }
        private string _MethodName;
        public string MethodName
        {
            get { return _MethodName; }
            set => RaiseAndSetIfChanged(ref _MethodName, value);
        }
        private string _Description;
        public string Description
        {
            get { return _Description; }
            set => RaiseAndSetIfChanged(ref _Description, value);
        }
        #endregion
    }
}
Models/Variable.cs
New file
@@ -0,0 +1,58 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
namespace WPFProject.Models
{
    public class Variable : NotifyBase
    {
        /// <summary>
        /// 参数名
        /// </summary>
        private string _Name;
        public string Name
        {
            get { return _Name; }
            set => RaiseAndSetIfChanged(ref _Name, value);
        }
        /// <summary>
        /// 参数类型
        /// </summary>
        private string _TypeName;
        public string TypeName
        {
            get { return _TypeName; }
            set {
                RaiseAndSetIfChanged(ref _TypeName, value);
                Type = value == null ? null : Type.GetType(value);
            }
        }
        public Type Type { get; private set; }
        /// <summary>
        /// 值字符
        /// </summary>
        private string _ValueStr;
        public string ValueStr
        {
            get { return _ValueStr; }
            set => RaiseAndSetIfChanged(ref _ValueStr, value);
        }
        /// <summary>
        /// 参数值
        /// </summary>
        private object _Value;
        public object Value
        {
            get { return _Value; }
            set { _Value = value; }
        }
    }
}
WPFProject.csproj
@@ -134,6 +134,7 @@
    <Compile Include="Models\CanvasPosition.cs" />
    <Compile Include="Models\FuncModel.cs" />
    <Compile Include="Models\NotifyBase.cs" />
    <Compile Include="Models\Param.cs" />
    <Compile Include="Models\Program.cs" />
    <Compile Include="Models\Sequence.cs" />
    <Compile Include="Models\Step.cs" />