CodeMemberMethod.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. //
  2. // System.CodeDom CodeMemberMethod Class implementation
  3. //
  4. // Author:
  5. // Miguel de Icaza ([email protected])
  6. // Daniel Stodden ([email protected])
  7. //
  8. // (C) 2001 Ximian, Inc.
  9. //
  10. using System.Runtime.InteropServices;
  11. namespace System.CodeDom
  12. {
  13. [Serializable]
  14. [ClassInterface(ClassInterfaceType.AutoDispatch)]
  15. [ComVisible(true)]
  16. public class CodeMemberMethod
  17. : CodeTypeMember
  18. {
  19. private CodeTypeReferenceCollection implementationTypes;
  20. private CodeParameterDeclarationExpressionCollection parameters;
  21. private CodeTypeReference privateImplementationType;
  22. private CodeTypeReference returnType;
  23. private CodeStatementCollection statements;
  24. private CodeAttributeDeclarationCollection returnTypeCustomAttributes;
  25. //
  26. // Constructors
  27. //
  28. public CodeMemberMethod()
  29. {
  30. }
  31. //
  32. // Properties
  33. //
  34. public CodeTypeReferenceCollection ImplementationTypes {
  35. get {
  36. if ( implementationTypes == null ) {
  37. implementationTypes = new CodeTypeReferenceCollection();
  38. PopulateImplementationTypes( this, EventArgs.Empty );
  39. }
  40. return implementationTypes;
  41. }
  42. }
  43. public CodeParameterDeclarationExpressionCollection Parameters {
  44. get {
  45. if ( parameters == null ) {
  46. parameters = new CodeParameterDeclarationExpressionCollection();
  47. PopulateParameters( this, EventArgs.Empty );
  48. }
  49. return parameters;
  50. }
  51. }
  52. public CodeTypeReference PrivateImplementationType {
  53. get {
  54. return privateImplementationType;
  55. }
  56. set {
  57. privateImplementationType = value;
  58. }
  59. }
  60. public CodeTypeReference ReturnType {
  61. get {
  62. return returnType;
  63. }
  64. set {
  65. returnType = value;
  66. }
  67. }
  68. public CodeStatementCollection Statements {
  69. get {
  70. if ( statements == null ) {
  71. statements = new CodeStatementCollection();
  72. PopulateStatements( this, EventArgs.Empty );
  73. }
  74. return statements;
  75. }
  76. }
  77. public CodeAttributeDeclarationCollection ReturnTypeCustomAttributes {
  78. get {
  79. if ( returnTypeCustomAttributes == null )
  80. returnTypeCustomAttributes = new CodeAttributeDeclarationCollection();
  81. return returnTypeCustomAttributes;
  82. }
  83. }
  84. //
  85. // Events
  86. //
  87. public event EventHandler PopulateImplementationTypes;
  88. public event EventHandler PopulateParameters;
  89. public event EventHandler PopulateStatements;
  90. }
  91. }