-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathControlObject.cs
116 lines (104 loc) · 3.09 KB
/
ControlObject.cs
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
using MMEdit;
using System.Collections.Generic;
namespace MMEffectUI
{
public class ControlObject : Annotation
{
#region Fields
List<ControlObject> controlObjects = new List<ControlObject>();
#endregion
#region Constructor
/// <summary>
/// 初始化 <see cref="ControlObject"/> 类的新实例。
/// </summary>
public ControlObject()
{
}
/// <summary>
/// 初始化 <see cref="ControlObject"/> 类的新实例。
/// </summary>
/// <param name="type"></param>
/// <param name="name"></param>
/// <param name="value"></param>
public ControlObject(string type, string name, string value) : base(type, name, value)
{
}
#endregion
#region Properties
/// <summary>
/// 获取 <see cref="ControlObject"/> 中包含的注解列表。
/// </summary>
public List<ControlObject> ControlObjects
{
get
{
return controlObjects;
}
}
/// <summary>
/// <inheritdoc cref="Annotation.Value"/>
/// </summary>
new public string Value
{
get
{
return base.Value.ToString();
}
set
{
base.Value = value;
}
}
/// <summary>
/// 获取或设置 <see cref="ControlObject"/> 是静态。
/// </summary>
public bool IsStatic
{
get;set;
}
/// <summary>
/// 获取或设置 <see cref="ControlObject"/> 是常量。
/// </summary>
public bool IsConst
{
get;set;
}
/// <summary>
/// 获取或设置 <see cref="ControlObject"/> 在源文件中从零开始的位置。!此属性由导入程序指定。!
/// </summary>
public int _Index
{
get;set;
}
/// <summary>
/// 获取或设置 <see cref="ControlObject"/> 在源文件中的长度。!此属性由导入程序指定。!
/// </summary>
public int _Length
{
get;set;
}
/// <summary>
/// 获取或设置用于编辑 <see cref="ObjectFX"/> 的小部件 WidgetID。<para>= GetAnnotation("UIWidget");</para>
/// </summary>
public override string WidgetID
{
get
{
return GetControlObject("UIWidget")?.Value.ToString();
}
}
#endregion
#region Methods
/// <summary>
/// 搜索与指定名称相匹配的 <see cref="ControlObject"/>, 并返回整个 <see cref="ControlObject.ControlObjects"/> 中的第一个匹配元素。
/// </summary>
/// <param name="controlObject"></param>
/// <param name="name"></param>
/// <returns></returns>
public ControlObject GetControlObject(string name)
{
return ControlObjects.Find(a => a.Name == name);
}
#endregion
}
}