0
|
1 namespace RazorEngine
|
|
2 {
|
|
3 using System;
|
|
4
|
|
5 public class AttributeValue
|
|
6 {
|
|
7 public AttributeValue(PositionTagged<string> prefix, PositionTagged<object> value, bool literal)
|
|
8 {
|
|
9 Prefix = prefix;
|
|
10 Value = value;
|
|
11 Literal = literal;
|
|
12 }
|
|
13
|
|
14 public PositionTagged<string> Prefix { get; private set; }
|
|
15 public PositionTagged<object> Value { get; private set; }
|
|
16 public bool Literal { get; private set; }
|
|
17
|
|
18 public static AttributeValue FromTuple(Tuple<Tuple<string, int>, Tuple<object, int>, bool> value)
|
|
19 {
|
|
20 return new AttributeValue(value.Item1, value.Item2, value.Item3);
|
|
21 }
|
|
22
|
|
23 public static AttributeValue FromTuple(Tuple<Tuple<string, int>, Tuple<string, int>, bool> value)
|
|
24 {
|
|
25 return new AttributeValue(value.Item1, new PositionTagged<object>(value.Item2.Item1, value.Item2.Item2), value.Item3);
|
|
26 }
|
|
27
|
|
28 public static implicit operator AttributeValue(Tuple<Tuple<string, int>, Tuple<object, int>, bool> value)
|
|
29 {
|
|
30 return FromTuple(value);
|
|
31 }
|
|
32
|
|
33 public static implicit operator AttributeValue(Tuple<Tuple<string, int>, Tuple<string, int>, bool> value)
|
|
34 {
|
|
35 return FromTuple(value);
|
|
36 }
|
|
37 }
|
|
38 } |