LocalBuilder.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. //
  2. // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining
  5. // a copy of this software and associated documentation files (the
  6. // "Software"), to deal in the Software without restriction, including
  7. // without limitation the rights to use, copy, modify, merge, publish,
  8. // distribute, sublicense, and/or sell copies of the Software, and to
  9. // permit persons to whom the Software is furnished to do so, subject to
  10. // the following conditions:
  11. //
  12. // The above copyright notice and this permission notice shall be
  13. // included in all copies or substantial portions of the Software.
  14. //
  15. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  16. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  17. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  18. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  19. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  20. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  21. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  22. //
  23. //
  24. // System.Reflection.Emit/LocalBuilder.cs
  25. //
  26. // Authors:
  27. // Paolo Molaro ([email protected])
  28. // Martin Baulig ([email protected])
  29. // Miguel de Icaza ([email protected])
  30. //
  31. // (C) 2001, 2002 Ximian, Inc. http://www.ximian.com
  32. //
  33. using System;
  34. using System.Reflection;
  35. using System.Reflection.Emit;
  36. using System.Globalization;
  37. using System.Runtime.CompilerServices;
  38. using System.Runtime.InteropServices;
  39. using System.Diagnostics.SymbolStore;
  40. namespace System.Reflection.Emit {
  41. [ComVisible (true)]
  42. [ComDefaultInterface (typeof (_LocalBuilder))]
  43. [ClassInterface (ClassInterfaceType.None)]
  44. [StructLayout (LayoutKind.Sequential)]
  45. public sealed class LocalBuilder : LocalVariableInfo, _LocalBuilder {
  46. // Some fields are already defined in LocalVariableInfo
  47. #region Sync with reflection.h
  48. private string name;
  49. #endregion
  50. internal ILGenerator ilgen;
  51. int startOffset;
  52. int endOffset;
  53. internal LocalBuilder (Type t, ILGenerator ilgen)
  54. {
  55. this.type = t;
  56. this.ilgen = ilgen;
  57. }
  58. public void SetLocalSymInfo (string name, int startOffset, int endOffset)
  59. {
  60. this.name = name;
  61. this.startOffset = startOffset;
  62. this.endOffset = endOffset;
  63. }
  64. public void SetLocalSymInfo (string name)
  65. {
  66. SetLocalSymInfo (name, 0, 0);
  67. }
  68. public override Type LocalType
  69. {
  70. get {
  71. return type;
  72. }
  73. }
  74. public override bool IsPinned
  75. {
  76. get {
  77. return is_pinned;
  78. }
  79. }
  80. public override int LocalIndex
  81. {
  82. get {
  83. return position;
  84. }
  85. }
  86. internal string Name {
  87. get { return name; }
  88. }
  89. internal int StartOffset {
  90. get { return startOffset; }
  91. }
  92. internal int EndOffset {
  93. get { return endOffset; }
  94. }
  95. void _LocalBuilder.GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
  96. {
  97. throw new NotImplementedException ();
  98. }
  99. void _LocalBuilder.GetTypeInfo (uint iTInfo, uint lcid, IntPtr ppTInfo)
  100. {
  101. throw new NotImplementedException ();
  102. }
  103. void _LocalBuilder.GetTypeInfoCount (out uint pcTInfo)
  104. {
  105. throw new NotImplementedException ();
  106. }
  107. void _LocalBuilder.Invoke (uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
  108. {
  109. throw new NotImplementedException ();
  110. }
  111. }
  112. }