Component Class

 

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

Namespace:   System.ComponentModel
Assembly:  System (in System.dll)

System::Object
  System::MarshalByRefObject
    System.ComponentModel::Component
      Microsoft.VisualBasic.Compatibility.VB6::BaseControlArray
      System.CodeDom.Compiler::CodeDomProvider
      System.ComponentModel::BackgroundWorker
      System.Configuration.Install::Installer
      System.Data.Common::DataAdapter
      System.Data.Common::DbCommand
      System.Data.Common::DbCommandBuilder
      System.Data.Common::DbConnection
      System.Diagnostics::EventLog
      System.Diagnostics::EventLogEntry
      System.Diagnostics::PerformanceCounter
      System.Diagnostics::Process
      System.Diagnostics::ProcessModule
      System.Diagnostics::ProcessThread
      System.DirectoryServices::DirectoryEntry
      System.DirectoryServices::DirectorySearcher
      System.Drawing.Printing::PrintDocument
      System.IO::FileSystemWatcher
      System.IO.Ports::SerialPort
      System.Management::ManagementBaseObject
      System.Management::ManagementEventWatcher
      System.Management::ManagementObjectSearcher
      System.Media::SoundPlayer
      System.Messaging::Message
      System.Messaging::MessageQueue
      System.Net.NetworkInformation::Ping
      System.Net::WebClient
      System.Runtime.Remoting.Services::RemotingClientProxy
      System.Runtime.Remoting.Services::RemotingService
      System.ServiceProcess::ServiceBase
      System.ServiceProcess::ServiceController
      System.Timers::Timer
      System.Web.Services.Protocols::WebClientProtocol
      System.Web.UI.WebControls::Style
      System.Windows.Forms::BindingSource
      System.Windows.Forms::ColumnHeader
      System.Windows.Forms::CommonDialog
      System.Windows.Forms::Control
      System.Windows.Forms::DataGridColumnStyle
      System.Windows.Forms::DataGridTableStyle
      System.Windows.Forms.Design::FolderNameEditor::FolderBrowser
      System.Windows.Forms::ErrorProvider
      System.Windows.Forms::HelpProvider
      System.Windows.Forms::ImageList
      System.Windows.Forms::Menu
      System.Windows.Forms::NotifyIcon
      System.Windows.Forms::StatusBarPanel
      System.Windows.Forms::Timer
      System.Windows.Forms::ToolBarButton
      System.Windows.Forms::ToolStripItem
      System.Windows.Forms::ToolStripPanelRow
      System.Windows.Forms::ToolTip

[ComVisibleAttribute(true)]
[ClassInterfaceAttribute(ClassInterfaceType::AutoDispatch)]
public ref class Component : MarshalByRefObject, IComponent, 
	IDisposable

NameDescription
System_CAPS_pubmethodComponent()

Initializes a new instance of the Component class.

NameDescription
System_CAPS_protpropertyCanRaiseEvents

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

System_CAPS_pubpropertyContainer

Gets the IContainer that contains the Component.

System_CAPS_protpropertyDesignMode

Gets a value that indicates whether the Component is currently in design mode.

System_CAPS_protpropertyEvents

Gets the list of event handlers that are attached to this Component.

System_CAPS_pubpropertySite

Gets or sets the ISite of the Component.

NameDescription
System_CAPS_pubmethodCreateObjRef(Type^)

Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.(Inherited from MarshalByRefObject.)

System_CAPS_pubmethodDispose()

Releases all resources used by the Component.

System_CAPS_protmethodDispose(Boolean)

Releases the unmanaged resources used by the Component and optionally releases the managed resources.

System_CAPS_pubmethodEquals(Object^)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Releases unmanaged resources and performs other cleanup operations before the Component is reclaimed by garbage collection.(Overrides Object::Finalize().)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetLifetimeService()

Retrieves the current lifetime service object that controls the lifetime policy for this instance.(Inherited from MarshalByRefObject.)

System_CAPS_protmethodGetService(Type^)

Returns an object that represents a service provided by the Component or by its Container.

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodInitializeLifetimeService()

Obtains a lifetime service object to control the lifetime policy for this instance.(Inherited from MarshalByRefObject.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone(Boolean)

Creates a shallow copy of the current MarshalByRefObject object.(Inherited from MarshalByRefObject.)

System_CAPS_pubmethodToString()

Returns a String containing the name of the Component, if any. This method should not be overridden.(Overrides Object::ToString().)

NameDescription
System_CAPS_pubeventDisposed

Occurs when the component is disposed by a call to the Dispose method.

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

You can host a Component in any object that implements the IContainer interface, and you 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.

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

.NET Framework
Available since 1.1

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

Return to top
Show: