Mercurial > pub > ImplabNet
comparison Implab.ServiceHost/Unity/ArrayTypeReference.cs @ 278:6691aff01de1 v3
Implab: added XmlDefaultSeializer (SerializersPool is now obsolete)
Implab.ServiceHost: rewritten TypeReference (added support for nested types), stable API
author | cin |
---|---|
date | Thu, 03 May 2018 09:59:44 +0300 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
277:963b17c275be | 278:6691aff01de1 |
---|---|
1 using System; | |
2 using System.Text; | |
3 | |
4 namespace Implab.ServiceHost.Unity { | |
5 public class ArrayTypeReference : TypeReference { | |
6 public int Rank { get; private set; } | |
7 | |
8 public TypeReference ItemsType { get; private set; } | |
9 | |
10 public override string Name { | |
11 get { | |
12 return ItemsType.Name; | |
13 } | |
14 } | |
15 | |
16 public override string ClrName { | |
17 get { | |
18 return new StringBuilder() | |
19 .Append(ItemsType.ClrName) | |
20 .Append("[") | |
21 .Append(',', Rank - 1) | |
22 .Append("]") | |
23 .ToString(); | |
24 } | |
25 } | |
26 | |
27 public override string Namespace { | |
28 get { | |
29 return ItemsType.Namespace; | |
30 } | |
31 } | |
32 | |
33 public override int GenericParametersCount { | |
34 get { | |
35 return 0; | |
36 } | |
37 } | |
38 | |
39 internal ArrayTypeReference(TypeReference itemsType, int rank) { | |
40 ItemsType = itemsType; | |
41 Rank = rank; | |
42 } | |
43 | |
44 internal override void Visit(TypeResolutionContext visitor) { | |
45 visitor.Visit(this); | |
46 } | |
47 | |
48 override public string ToString() { | |
49 return new StringBuilder() | |
50 .Append(ItemsType.ToString()) | |
51 .Append('[') | |
52 .Append(',', Rank - 1) | |
53 .Append(']') | |
54 .ToString(); | |
55 } | |
56 } | |
57 } |