PageRenderTime 12ms CodeModel.GetById 8ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/Mono.Cecil/ParameterReference.cs

http://github.com/jbevain/cecil
C# | 57 lines | 36 code | 12 blank | 9 comment | 2 complexity | 8c435239b123269a8e14eb8dc712ff95 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
13namespace Mono.Cecil {
14
15	public abstract class ParameterReference : IMetadataTokenProvider {
16
17		string name;
18		internal int index = -1;
19		protected TypeReference parameter_type;
20		internal MetadataToken token;
21
22		public string Name {
23			get { return name; }
24			set { name = value; }
25		}
26
27		public int Index {
28			get { return index; }
29		}
30
31		public TypeReference ParameterType {
32			get { return parameter_type; }
33			set { parameter_type = value; }
34		}
35
36		public MetadataToken MetadataToken {
37			get { return token; }
38			set { token = value; }
39		}
40
41		internal ParameterReference (string name, TypeReference parameterType)
42		{
43			if (parameterType == null)
44				throw new ArgumentNullException ("parameterType");
45
46			this.name = name ?? string.Empty;
47			this.parameter_type = parameterType;
48		}
49
50		public override string ToString ()
51		{
52			return name;
53		}
54
55		public abstract ParameterDefinition Resolve ();
56	}
57}