MarshalByValueComponent MarshalByValueComponent MarshalByValueComponent MarshalByValueComponent Class


实现 IComponent 并提供可远程控制的组件的基实现,该组件是由值封送的(传递序列化对象的副本)。Implements IComponent and provides the base implementation for remotable components that are marshaled by value (a copy of the serialized object is passed).

public ref class MarshalByValueComponent : IDisposable, IServiceProvider, System::ComponentModel::IComponent
public class MarshalByValueComponent : IDisposable, IServiceProvider, System.ComponentModel.IComponent
type MarshalByValueComponent = class
    interface IComponent
    interface IServiceProvider
    interface IDisposable
Public Class MarshalByValueComponent
Implements IComponent, IDisposable, IServiceProvider


组件可以包含在容器中。A component can be contained in a container. 对于容器中的每个组件, 容器都会创建一个用于管理组件的站点。For each component in a container, the container creates a site that it uses to manage the component. 组件主要通过容器 (提供ISite的容器特定的、每个组件的信息存储库) 与其容器交互。The component interacts with its container primarily through a container-provided ISite, which is a repository of container-specific, per-component information.


从此类继承时, 可以重写Dispose()SiteGetService(Type)方法。When you inherit from this class, you can override the Dispose(), Site, and the GetService(Type) methods.


MarshalByValueComponent() MarshalByValueComponent() MarshalByValueComponent() MarshalByValueComponent()

初始化 MarshalByValueComponent 类的新实例。Initializes a new instance of the MarshalByValueComponent class.


Container Container Container Container

获取组件的容器。Gets the container for the component.

DesignMode DesignMode DesignMode DesignMode

获取指示组件当前是否处于设计模式的值。Gets a value indicating whether the component is currently in design mode.

Events Events Events Events

获取附加到该组件的事件处理程序的列表。Gets the list of event handlers that are attached to this component.

Site Site Site Site

获取或设置组件的位置。Gets or sets the site of the component.


Dispose() Dispose() Dispose() Dispose()

释放由 MarshalByValueComponent 使用的所有资源。Releases all resources used by the MarshalByValueComponent.

Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

释放由 MarshalByValueComponent 占用的非托管资源,还可以另外再释放托管资源。Releases the unmanaged resources used by the MarshalByValueComponent and optionally releases the managed resources.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
Finalize() Finalize() Finalize() Finalize()

在垃圾回收将某一对象回收前允许该对象尝试释放资源并执行其他清理操作。Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetService(Type) GetService(Type) GetService(Type) GetService(Type)

获取 IServiceProvider 的实施者。Gets the implementer of the IServiceProvider.

GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

返回包含 Component 的名称的 String(如果有)。Returns a String containing the name of the Component, if any. 不应重写此方法。This method should not be overridden.


Disposed Disposed Disposed Disposed

添加事件处理程序以侦听组件上的 Disposed 事件。Adds an event handler to listen to the Disposed event on the component.