Export (0) Print
Expand All

Component Class

Provides the base implementation for the IComponent interface and enables object-sharing between applications.

For a list of all members of this type, see Component Members.

System.Object
   System.MarshalByRefObject
      System.ComponentModel.Component
         Derived classes

[Visual Basic]
Public Class Component
   Inherits MarshalByRefObject
   Implements IComponent, IDisposable
[C#]
public class Component : MarshalByRefObject, IComponent,
   IDisposable
[C++]
public __gc class Component : public MarshalByRefObject,
   IComponent, IDisposable
[JScript]
public class Component extends MarshalByRefObject implements
   IComponent, IDisposable

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Remarks

Component is the base class for all components in the common language runtime which marshal by reference. Component is remotable and derives from MarshalByRefObject. Component provides an implementation of IComponent. The MarshalByValueComponent provides an implementation of IComponent which marshals by value.

You can host a Component in any object that implements the IContainer interface, and can query and get services from its container. The container creates an ISite for each Component it contains. The container uses the site to manage the Component and is used by the Component to communicate with its container.

It is recommended that a Component release resources explicitly by calls to its Dispose method, without waiting for automatic memory management through an implicit call to Finalize. When a Container is disposed, all components within the Container are also disposed.

Requirements

Namespace: System.ComponentModel

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

Assembly: System (in System.dll)

See Also

Component Members | System.ComponentModel Namespace | IComponent | IContainer | Container | ISite

Show:
© 2014 Microsoft