-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStateParam.cs
43 lines (34 loc) · 978 Bytes
/
StateParam.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
using System.Collections.Generic;
namespace NeoDoc.Params
{
public abstract class StateParam : Param
{
public string Value { get; set; } = "";
public override Dictionary<string, object> GetData()
{
Dictionary<string, object> tmpDict = new Dictionary<string, object>();
if (!string.IsNullOrEmpty(Value))
tmpDict.Add("value", Value);
return tmpDict;
}
public override void Process(string[] paramData)
{
if (paramData.Length < 1)
return;
Value = paramData[0];
}
public override void ProcessAddition(string[] paramData)
{
Process(paramData);
}
public override void ModifyFileParser(FileParser fileParser)
{
if (string.IsNullOrEmpty(Value))
NeoDoc.WriteErrors("Invalid param argument format", new List<string>
{
"In '@" + GetName() + "' param"
}, fileParser.relPath, fileParser.CurrentLineCount + 1, (int)NeoDoc.ERROR_CODES.INVALID_PARAM_ARGS_FORMAT);
base.ModifyFileParser(fileParser);
}
}
}