LocalBuilder.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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. public sealed class LocalBuilder : LocalVariableInfo, _LocalBuilder {
  45. // Some fields are already defined in LocalVariableInfo
  46. #region Sync with reflection.h
  47. private string name;
  48. #endregion
  49. internal ILGenerator ilgen;
  50. int startOffset;
  51. int endOffset;
  52. internal LocalBuilder (Type t, ILGenerator ilgen)
  53. {
  54. this.type = t;
  55. this.ilgen = ilgen;
  56. }
  57. public void SetLocalSymInfo (string name, int startOffset, int endOffset)
  58. {
  59. this.name = name;
  60. this.startOffset = startOffset;
  61. this.endOffset = endOffset;
  62. }
  63. public void SetLocalSymInfo (string name)
  64. {
  65. SetLocalSymInfo (name, 0, 0);
  66. }
  67. public override Type LocalType
  68. {
  69. get {
  70. return type;
  71. }
  72. }
  73. public override bool IsPinned
  74. {
  75. get {
  76. return is_pinned;
  77. }
  78. }
  79. public override int LocalIndex
  80. {
  81. get {
  82. return position;
  83. }
  84. }
  85. internal string Name {
  86. get { return name; }
  87. }
  88. internal int StartOffset {
  89. get { return startOffset; }
  90. }
  91. internal int EndOffset {
  92. get { return endOffset; }
  93. }
  94. void _LocalBuilder.GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
  95. {
  96. throw new NotImplementedException ();
  97. }
  98. void _LocalBuilder.GetTypeInfo (uint iTInfo, uint lcid, IntPtr ppTInfo)
  99. {
  100. throw new NotImplementedException ();
  101. }
  102. void _LocalBuilder.GetTypeInfoCount (out uint pcTInfo)
  103. {
  104. throw new NotImplementedException ();
  105. }
  106. void _LocalBuilder.Invoke (uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr)
  107. {
  108. throw new NotImplementedException ();
  109. }
  110. }
  111. }