/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. namespace Mono.Cecil.Cil {
  11. public abstract class VariableReference {
  12. internal int index = -1;
  13. protected TypeReference variable_type;
  14. public TypeReference VariableType {
  15. get { return variable_type; }
  16. set { variable_type = value; }
  17. }
  18. public int Index {
  19. get { return index; }
  20. }
  21. internal VariableReference (TypeReference variable_type)
  22. {
  23. this.variable_type = variable_type;
  24. }
  25. public abstract VariableDefinition Resolve ();
  26. public override string ToString ()
  27. {
  28. if (index >= 0)
  29. return "V_" + index;
  30. return string.Empty;
  31. }
  32. }
  33. }