Welcome to mirror list, hosted at ThFree Co, Russian Federation.

LocalBuilder.cs « System.Reflection.Emit « corlib « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: db7f05c30ec24a51570c9b6c2eae9447a38f12ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62

//
// System.Reflection.Emit/LocalBuilder.cs
//
// Authors:
//   Paolo Molaro (lupus@ximian.com)
//   Martin Baulig (martin@gnome.org)
//   Miguel de Icaza (miguel@ximian.com)
//
// (C) 2001, 2002 Ximian, Inc.  http://www.ximian.com
//

using System;
using System.Reflection;
using System.Reflection.Emit;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Diagnostics.SymbolStore;

namespace System.Reflection.Emit {
	public sealed class LocalBuilder {
		//
		// These are kept in sync with reflection.h
		//
		#region Sync with reflection.h
		private Type type;
		private string name;
		#endregion
		
		//
		// Order does not matter after here
		//
		private ModuleBuilder module;
		internal uint position;

		internal LocalBuilder (ModuleBuilder m, Type t)
		{
			this.module = m;
			this.type = t;
		}
		public void SetLocalSymInfo (string lname, int startOffset, int endOffset)
		{
			this.name = lname;

			module.SymWriter_DefineLocalVariable (lname, this, FieldAttributes.Private,
							      (int) position, startOffset, endOffset);
		}

		public void SetLocalSymInfo (string lname)
		{
			SetLocalSymInfo (lname, 0, 0);
		}


		public Type LocalType
		{
			get {
				return type;
			}
		}
	}
}