PageRenderTime 45ms CodeModel.GetById 41ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/Mono.Cecil.Cil/VariableReference.cs

http://github.com/jbevain/cecil
C# | 42 lines | 24 code | 9 blank | 9 comment | 1 complexity | 311613702b41ff8f4c0a4e7704bbfc6c 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
11namespace Mono.Cecil.Cil {
12
13	public abstract class VariableReference {
14
15		internal int index = -1;
16		protected TypeReference variable_type;
17
18		public TypeReference VariableType {
19			get { return variable_type; }
20			set { variable_type = value; }
21		}
22
23		public int Index {
24			get { return index; }
25		}
26
27		internal VariableReference (TypeReference variable_type)
28		{
29			this.variable_type = variable_type;
30		}
31
32		public abstract VariableDefinition Resolve ();
33
34		public override string ToString ()
35		{
36			if (index >= 0)
37				return "V_" + index;
38
39			return string.Empty;
40		}
41	}
42}