Component.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. //
  2. // System.ComponentModel.Component.cs
  3. //
  4. // Author:
  5. // Miguel de Icaza ([email protected])
  6. //
  7. // (C) Ximian, Inc. http://www.ximian.com
  8. //
  9. using System;
  10. namespace System.ComponentModel {
  11. // <summary>
  12. // Component class.
  13. // </summary>
  14. //
  15. // <remarks>
  16. // Longer description
  17. // </remarks>
  18. public class Component : MarshalByRefObject, IComponent, IDisposable {
  19. IContainer icontainer;
  20. bool design_mode;
  21. EventHandlerList event_handlers;
  22. ISite isite;
  23. // <summary>
  24. // Component Constructor
  25. // </summary>
  26. public Component ()
  27. {
  28. }
  29. // <summary>
  30. // Get IContainer of this Component
  31. // </summary>
  32. public IContainer Container {
  33. get {
  34. return icontainer;
  35. }
  36. }
  37. protected bool DesignMode {
  38. get {
  39. return design_mode;
  40. }
  41. }
  42. protected EventHandlerList Events {
  43. get {
  44. return event_handlers;
  45. }
  46. }
  47. public virtual ISite Site {
  48. get {
  49. return isite;
  50. }
  51. set {
  52. isite = value;
  53. }
  54. }
  55. // <summary>
  56. // Dispose resources used by this component
  57. // </summary>
  58. public virtual void Dispose ()
  59. {
  60. }
  61. // <summary>
  62. // Controls disposal of resources used by this.
  63. // </summary>
  64. //
  65. // <param name="release_all"> Controls which resources are released</param>
  66. //
  67. // <remarks>
  68. // if release_all is set to true, both managed and unmanaged
  69. // resources should be released. If release_all is set to false,
  70. // only unmanaged resources should be disposed
  71. // </remarks>
  72. protected virtual void Dispose (bool release_all)
  73. {
  74. }
  75. // <summary>
  76. // Implements the IServiceProvider interface
  77. // </summary>
  78. protected virtual object GetService (Type service)
  79. {
  80. // FIXME: Not sure what this should do.
  81. return null;
  82. }
  83. // <summary>
  84. // FIXME: Figure out this one.
  85. // </summary>
  86. public event EventHandler Disposed;
  87. }
  88. }