mscorlib(4.0.0.0) API with additions
System.ComponentModel.Component Class Reference

Provides the base implementation for the T:System.ComponentModel.IComponent interface and enables object sharing between applications. More...

Inheritance diagram for System.ComponentModel.Component:
[legend]
Collaboration diagram for System.ComponentModel.Component:
[legend]

Public Member Functions

void Dispose ()
 Releases all resources used by the T:System.ComponentModel.Component. More...
 
override string ToString ()
 Returns a T:System.String containing the name of the T:System.ComponentModel.Component, if any. This method should not be overridden. More...
 
- Public Member Functions inherited from System.MarshalByRefObject
object GetLifetimeService ()
 Retrieves the current lifetime service object that controls the lifetime policy for this instance. More...
 
virtual object InitializeLifetimeService ()
 Obtains a lifetime service object to control the lifetime policy for this instance. More...
 
virtual ObjRef CreateObjRef (Type requestedType)
 Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. More...
 

Protected Member Functions

virtual void Dispose (bool disposing)
 Releases the unmanaged resources used by the T:System.ComponentModel.Component and optionally releases the managed resources. More...
 
virtual object GetService (Type service)
 Returns an object that represents a service provided by the T:System.ComponentModel.Component or by its T:System.ComponentModel.Container. More...
 
- Protected Member Functions inherited from System.MarshalByRefObject
MarshalByRefObject MemberwiseClone (bool cloneIdentity)
 Creates a shallow copy of the current T:System.MarshalByRefObject object. More...
 

Protected Attributes

virtual bool CanRaiseEvents => true
 Gets a value indicating whether the component can raise an event. More...
 

Properties

EventHandlerList Events [get]
 Gets the list of event handlers that are attached to this T:System.ComponentModel.Component. More...
 
virtual ISite Site [get, set]
 Gets or sets the T:System.ComponentModel.ISite of the T:System.ComponentModel.Component. More...
 
IContainerContainer [get]
 Gets the T:System.ComponentModel.IContainer that contains the T:System.ComponentModel.Component. More...
 
bool??? DesignMode [get]
 Gets a value that indicates whether the T:System.ComponentModel.Component is currently in design mode. More...
 
EventHandler Disposed
 Occurs when the component is disposed by a call to the M:System.ComponentModel.Component.Dispose method. More...
 
- Properties inherited from System.ComponentModel.IComponent
ISite Site [get, set]
 Gets or sets the T:System.ComponentModel.ISite associated with the T:System.ComponentModel.IComponent. More...
 

Additional Inherited Members

- Events inherited from System.ComponentModel.IComponent
EventHandler Disposed
 Represents the method that handles the E:System.ComponentModel.IComponent.Disposed event of a component. More...
 

Detailed Description

Provides the base implementation for the T:System.ComponentModel.IComponent interface and enables object sharing between applications.

Definition at line 9 of file Component.cs.

Member Function Documentation

◆ Dispose() [1/2]

void System.ComponentModel.Component.Dispose ( )

Releases all resources used by the T:System.ComponentModel.Component.

Implements System.IDisposable.

Definition at line 101 of file Component.cs.

◆ Dispose() [2/2]

virtual void System.ComponentModel.Component.Dispose ( bool  disposing)
protectedvirtual

Releases the unmanaged resources used by the T:System.ComponentModel.Component and optionally releases the managed resources.

Parameters
disposingtrue to release both managed and unmanaged resources; false to release only unmanaged resources.

Reimplemented in System.Diagnostics.Process, System.IO.Ports.SerialPort, System.Diagnostics.EventLog, System.IO.FileSystemWatcher, System.Diagnostics.PerformanceCounter, System.Timers.Timer, and System.Net.NetworkInformation.Ping.

Definition at line 110 of file Component.cs.

◆ GetService()

virtual object System.ComponentModel.Component.GetService ( Type  service)
protectedvirtual

Returns an object that represents a service provided by the T:System.ComponentModel.Component or by its T:System.ComponentModel.Container.

Parameters
serviceA service provided by the T:System.ComponentModel.Component.
Returns
An T:System.Object that represents a service provided by the T:System.ComponentModel.Component, or null if the T:System.ComponentModel.Component does not provide the specified service.

Definition at line 131 of file Component.cs.

◆ ToString()

override string System.ComponentModel.Component.ToString ( )

Returns a T:System.String containing the name of the T:System.ComponentModel.Component, if any. This method should not be overridden.

Returns
A T:System.String containing the name of the T:System.ComponentModel.Component, if any, or null if the T:System.ComponentModel.Component is unnamed.

Definition at line 138 of file Component.cs.

Member Data Documentation

◆ CanRaiseEvents

virtual bool System.ComponentModel.Component.CanRaiseEvents => true
protected

Gets a value indicating whether the component can raise an event.

Returns
true if the component can raise events; otherwise, false. The default is true.

Definition at line 20 of file Component.cs.

Property Documentation

◆ Container

IContainer? System.ComponentModel.Component.Container
get

Gets the T:System.ComponentModel.IContainer that contains the T:System.ComponentModel.Component.

Returns
The T:System.ComponentModel.IContainer that contains the T:System.ComponentModel.Component, if any, or null if the T:System.ComponentModel.Component is not encapsulated in an T:System.ComponentModel.IContainer.

Definition at line 59 of file Component.cs.

◆ DesignMode

bool??? System.ComponentModel.Component.DesignMode
getprotected

Gets a value that indicates whether the T:System.ComponentModel.Component is currently in design mode.

Returns
true if the T:System.ComponentModel.Component is in design mode; otherwise, false.

Definition at line 72 of file Component.cs.

◆ Disposed

EventHandler System.ComponentModel.Component.Disposed
addremove

Occurs when the component is disposed by a call to the M:System.ComponentModel.Component.Dispose method.

Definition at line 83 of file Component.cs.

◆ Events

EventHandlerList System.ComponentModel.Component.Events
getprotected

Gets the list of event handlers that are attached to this T:System.ComponentModel.Component.

Returns
An T:System.ComponentModel.EventHandlerList that provides the delegates for this component.

Definition at line 27 of file Component.cs.

◆ Site

virtual ISite System.ComponentModel.Component.Site
getset

Gets or sets the T:System.ComponentModel.ISite of the T:System.ComponentModel.Component.

Returns
The T:System.ComponentModel.ISite associated with the T:System.ComponentModel.Component, or null if the T:System.ComponentModel.Component is not encapsulated in an T:System.ComponentModel.IContainer, the T:System.ComponentModel.Component does not have an T:System.ComponentModel.ISite associated with it, or the T:System.ComponentModel.Component is removed from its T:System.ComponentModel.IContainer.

Definition at line 43 of file Component.cs.


The documentation for this class was generated from the following file: