The Labs \ Source Viewer \ SSCLI \ System.Diagnostics.SymbolStore \ ISymbolMethod

  1. // ==++==
  2. //
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. //
  14. // ==--==
  15. /*============================================================
  16. **
  17. ** Class:  ISymbolMethod
  18. **
  19. **
  20. ** Represents a method within a symbol reader. This provides access to
  21. ** only the symbol-related attributes of a method, such as sequence
  22. ** points, lexical scopes, and parameter information. Use it in
  23. ** conjucntion with other means to read the type-related attrbiutes of
  24. ** a method, such as Reflections.
  25. **
  26. **
  27. ===========================================================*/
  28. namespace System.Diagnostics.SymbolStore
  29. {
  30.     using System.Runtime.InteropServices;
  31.     using System;
  32.    
  33.     // Interface does not need to be marked with the serializable attribute
  34.     [System.Runtime.InteropServices.ComVisible(true)]
  35.     public interface ISymbolMethod
  36.     {
  37.         // Get the token for this method.
  38.         SymbolToken Token {
  39.             get;
  40.         }
  41.        
  42.         // Get the count of sequence points.
  43.         int SequencePointCount {
  44.             get;
  45.         }
  46.        
  47.         // Get the sequence points for this method. The sequence points
  48.         // are sorted by offset and are for all documents in the
  49.         // method. Use GetSequencePointCount to retrieve the count of all
  50.         // sequence points and create arrays of the proper size.
  51.         // GetSequencePoints will verify the size of each array and place
  52.         // the sequence point information into each. If any array is NULL,
  53.         // then the data for that array is simply not returned.
  54.         void GetSequencePoints(int[] offsets, ISymbolDocument[] documents, int[] lines, int[] columns, int[] endLines, int[] endColumns);
  55.        
  56.         // Get the root lexical scope for this method. This scope encloses
  57.         // the entire method.
  58.         ISymbolScope RootScope {
  59.             get;
  60.         }
  61.        
  62.         // Given an offset within the method, returns the most enclosing
  63.         // lexical scope. This can be used to start local variable
  64.         // searches.
  65.         ISymbolScope GetScope(int offset);
  66.        
  67.         // Given a position in a document, return the offset within the
  68.         // method that corresponds to the position.
  69.         int GetOffset(ISymbolDocument document, int line, int column);
  70.        
  71.         // Given a position in a document, return an array of start/end
  72.         // offset paris that correspond to the ranges of IL that the
  73.         // position covers within this method. The array is an array of
  74.         // integers and is [start,end,start,end]. The number of range
  75.         // pairs is the length of the array / 2.
  76.         int[] GetRanges(ISymbolDocument document, int line, int column);
  77.        
  78.         // Get the parameters for this method. The paraemeters are
  79.         // returned in the order they are defined within the method's
  80.         // signature.
  81.         ISymbolVariable[] GetParameters();
  82.        
  83.         // Get the namespace that this method is defined within.
  84.         ISymbolNamespace GetNamespace();
  85.        
  86.         // Get the start/end document positions for the source of this
  87.         // method. The first array position is the start while the second
  88.         // is the end. Returns true if positions were defined, false
  89.         // otherwise.
  90.         bool GetSourceStartEnd(ISymbolDocument[] docs, int[] lines, int[] columns);
  91.     }
  92.    
  93. }

Developer Fusion