-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathDCExpressionItem.cs
More file actions
85 lines (77 loc) · 2.04 KB
/
DCExpressionItem.cs
File metadata and controls
85 lines (77 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
都昌数值表达式引擎 DCSoft.Expression
南京都昌信息科技有限公司 2018年 版权所有
公司网址 http://www.dcwriter.cn
*/
using System;
using System.Collections.Generic;
using System.Text;
namespace DCSoft.Expression
{
/// <summary>
/// 抽象的表达式元素类型。所有的表达式元素都是从这个类型派生出来的。
/// </summary>
[System.Runtime.InteropServices.ComVisible(false)]
public abstract class DCExpressionItem
{
/// <summary>
/// 初始化对象
/// </summary>
public DCExpressionItem()
{
}
/// <summary>
/// 执行表达式
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public virtual object Eval(IDCExpressionContext context)
{
return null;
}
private int _Priority = 0;
/// <summary>
/// 运算优先级。数值越大则优先级越高。
/// </summary>
internal int Priority
{
get
{
return _Priority;
}
set
{
_Priority = value;
}
}
private bool _Collapsed = false;
/// <summary>
/// 已经收缩了的表达式
/// </summary>
internal bool Collapsed
{
get
{
return _Collapsed;
}
set
{
_Collapsed = value;
}
}
/// <summary>
/// 复制对象
/// </summary>
/// <returns>复制品</returns>
public virtual DCExpressionItem Clone()
{
throw new NotSupportedException("Clone()");
}
internal virtual void AddSubItem(DCExpressionItem item)
{
}
public virtual void ToDebugString(int indentLevel, StringBuilder str)
{
}
}
}