annotate src/Core/RazorEngine.Core/AttributeValue.cs @ 3:91d78452a4a0 default tip

sync
author cin
date Thu, 12 Feb 2015 00:20:38 +0300
parents 5bca2d201ad8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
5bca2d201ad8 initial commit
cin
parents:
diff changeset
1 namespace RazorEngine
5bca2d201ad8 initial commit
cin
parents:
diff changeset
2 {
5bca2d201ad8 initial commit
cin
parents:
diff changeset
3 using System;
5bca2d201ad8 initial commit
cin
parents:
diff changeset
4
5bca2d201ad8 initial commit
cin
parents:
diff changeset
5 public class AttributeValue
5bca2d201ad8 initial commit
cin
parents:
diff changeset
6 {
5bca2d201ad8 initial commit
cin
parents:
diff changeset
7 public AttributeValue(PositionTagged<string> prefix, PositionTagged<object> value, bool literal)
5bca2d201ad8 initial commit
cin
parents:
diff changeset
8 {
5bca2d201ad8 initial commit
cin
parents:
diff changeset
9 Prefix = prefix;
5bca2d201ad8 initial commit
cin
parents:
diff changeset
10 Value = value;
5bca2d201ad8 initial commit
cin
parents:
diff changeset
11 Literal = literal;
5bca2d201ad8 initial commit
cin
parents:
diff changeset
12 }
5bca2d201ad8 initial commit
cin
parents:
diff changeset
13
5bca2d201ad8 initial commit
cin
parents:
diff changeset
14 public PositionTagged<string> Prefix { get; private set; }
5bca2d201ad8 initial commit
cin
parents:
diff changeset
15 public PositionTagged<object> Value { get; private set; }
5bca2d201ad8 initial commit
cin
parents:
diff changeset
16 public bool Literal { get; private set; }
5bca2d201ad8 initial commit
cin
parents:
diff changeset
17
5bca2d201ad8 initial commit
cin
parents:
diff changeset
18 public static AttributeValue FromTuple(Tuple<Tuple<string, int>, Tuple<object, int>, bool> value)
5bca2d201ad8 initial commit
cin
parents:
diff changeset
19 {
5bca2d201ad8 initial commit
cin
parents:
diff changeset
20 return new AttributeValue(value.Item1, value.Item2, value.Item3);
5bca2d201ad8 initial commit
cin
parents:
diff changeset
21 }
5bca2d201ad8 initial commit
cin
parents:
diff changeset
22
5bca2d201ad8 initial commit
cin
parents:
diff changeset
23 public static AttributeValue FromTuple(Tuple<Tuple<string, int>, Tuple<string, int>, bool> value)
5bca2d201ad8 initial commit
cin
parents:
diff changeset
24 {
5bca2d201ad8 initial commit
cin
parents:
diff changeset
25 return new AttributeValue(value.Item1, new PositionTagged<object>(value.Item2.Item1, value.Item2.Item2), value.Item3);
5bca2d201ad8 initial commit
cin
parents:
diff changeset
26 }
5bca2d201ad8 initial commit
cin
parents:
diff changeset
27
5bca2d201ad8 initial commit
cin
parents:
diff changeset
28 public static implicit operator AttributeValue(Tuple<Tuple<string, int>, Tuple<object, int>, bool> value)
5bca2d201ad8 initial commit
cin
parents:
diff changeset
29 {
5bca2d201ad8 initial commit
cin
parents:
diff changeset
30 return FromTuple(value);
5bca2d201ad8 initial commit
cin
parents:
diff changeset
31 }
5bca2d201ad8 initial commit
cin
parents:
diff changeset
32
5bca2d201ad8 initial commit
cin
parents:
diff changeset
33 public static implicit operator AttributeValue(Tuple<Tuple<string, int>, Tuple<string, int>, bool> value)
5bca2d201ad8 initial commit
cin
parents:
diff changeset
34 {
5bca2d201ad8 initial commit
cin
parents:
diff changeset
35 return FromTuple(value);
5bca2d201ad8 initial commit
cin
parents:
diff changeset
36 }
5bca2d201ad8 initial commit
cin
parents:
diff changeset
37 }
5bca2d201ad8 initial commit
cin
parents:
diff changeset
38 }