MarshalByValueComponent 类

定义

实现 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
[System.ComponentModel.TypeConverter(typeof(System.ComponentModel.ComponentConverter))]
[System.Runtime.InteropServices.ComVisible(true)]
public class MarshalByValueComponent : IDisposable, IServiceProvider, System.ComponentModel.IComponent
type MarshalByValueComponent = class
    interface IComponent
    interface IServiceProvider
    interface IDisposable
Public Class MarshalByValueComponent
Implements IComponent, IDisposable, IServiceProvider
继承
MarshalByValueComponent
派生
属性
实现

注解

组件可以包含在容器中。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 类的新实例。Initializes a new instance of the MarshalByValueComponent class.

属性

Container

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

DesignMode

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

Events

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

Site

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

方法

Dispose()

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

Dispose(Boolean)

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

Equals(Object)

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

(继承自 Object)
Finalize()

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

GetHashCode()

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

(继承自 Object)
GetService(Type)

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

GetType()

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

(继承自 Object)
MemberwiseClone()

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

(继承自 Object)
ToString()

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

事件

Disposed

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

适用于

另请参阅