PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/Mono.Cecil/TypeSpecification.cs

http://github.com/jbevain/cecil
C# | 68 lines | 44 code | 15 blank | 9 comment | 0 complexity | e8683bba8147fbe0485da02fba4e47a6 MD5 | raw file
 1//
 2// Author:
 3//   Jb Evain (jbevain@gmail.com)
 4//
 5// Copyright (c) 2008 - 2015 Jb Evain
 6// Copyright (c) 2008 - 2011 Novell, Inc.
 7//
 8// Licensed under the MIT/X11 license.
 9//
10
11using System;
12
13using Mono.Cecil.Metadata;
14
15namespace Mono.Cecil {
16
17	public abstract class TypeSpecification : TypeReference {
18
19		readonly TypeReference element_type;
20
21		public TypeReference ElementType {
22			get { return element_type; }
23		}
24
25		public override string Name {
26			get { return element_type.Name; }
27			set { throw new InvalidOperationException (); }
28		}
29
30		public override string Namespace {
31			get { return element_type.Namespace; }
32			set { throw new InvalidOperationException (); }
33		}
34
35		public override IMetadataScope Scope {
36			get { return element_type.Scope; }
37			set { throw new InvalidOperationException (); }
38		}
39
40		public override ModuleDefinition Module {
41			get { return element_type.Module; }
42		}
43
44		public override string FullName {
45			get { return element_type.FullName; }
46		}
47
48		public override bool ContainsGenericParameter {
49			get { return element_type.ContainsGenericParameter; }
50		}
51
52		public override MetadataType MetadataType {
53			get { return (MetadataType) etype; }
54		}
55
56		internal TypeSpecification (TypeReference type)
57			: base (null, null)
58		{
59			this.element_type = type;
60			this.token = new MetadataToken (TokenType.TypeSpec);
61		}
62
63		public override TypeReference GetElementType ()
64		{
65			return element_type.GetElementType ();
66		}
67	}
68}