forked from atauenis/webone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EditSetRule.cs
72 lines (59 loc) · 1.64 KB
/
EditSetRule.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
using System;
using System.Collections.Generic;
using System.Text;
namespace WebOne
{
/// <summary>
/// A real editing rule in a <see cref="EditSet"/> or base for virtual editing rules.<br/>
/// See also: <seealso cref="FindReplaceEditSetRule"/>, <seealso cref="ConvertEditSetRule"/>
/// </summary>
class EditSetRule
{
/// <summary>
/// Rule's action
/// </summary>
public string Action { get; internal set; }
/// <summary>
/// Action's parameter (single)
/// </summary>
public string Value { get; internal set; }
public EditSetRule(string action, string value)
{
Action = action;
Value = value;
}
}
//virtual editing rules (generated from multiple webone.conf lines)
/// <summary>
/// Content Find&Replace virtual editing rule
/// </summary>
class FindReplaceEditSetRule : EditSetRule
{
public string Find { get; internal set; }
public string Replace { get; internal set; }
public FindReplaceEditSetRule(string action, string find, string replace) : base (action, null)
{
Action = action;
Find = find;
Replace = replace;
}
}
/// <summary>
/// Format converting virtual editing rule
/// </summary>
class ConvertEditSetRule : EditSetRule
{
public string Converter { get; internal set; }
public string ConvertDest { get; internal set; }
public string ConvertArg1 { get; internal set; }
public string ConvertArg2 { get; internal set; }
public ConvertEditSetRule(string action, string converter, string dest, string arg1, string arg2) : base(action, null)
{
Action = action;
Converter = converter;
ConvertDest = dest;
ConvertArg1 = arg1;
ConvertArg2 = arg2;
}
}
}