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