ResourceSet.Dispose ResourceSet.Dispose ResourceSet.Dispose ResourceSet.Dispose Method

定义

释放由当前 ResourceSet 实例使用的资源。Releases resources used by the current ResourceSet instance.

重载

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

处置由 ResourceSet 的当前实例使用的资源(内存除外)。Disposes of the resources (other than memory) used by the current instance of ResourceSet.

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

释放与当前实例关联的资源(内存除外),并关闭内部托管对象(如果请求这样做)。Releases resources (other than memory) associated with the current instance, closing internal managed objects if requested.

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

处置由 ResourceSet 的当前实例使用的资源(内存除外)。Disposes of the resources (other than memory) used by the current instance of ResourceSet.

public:
 virtual void Dispose();
public void Dispose ();
abstract member Dispose : unit -> unit
override this.Dispose : unit -> unit
Public Sub Dispose ()

实现

注解

在完成使用 Dispose 后,应调用 ResourceSetCall Dispose when you are finished using the ResourceSet. Dispose 方法使 ResourceSet 处于不可用状态。The Dispose method leaves the ResourceSet in an unusable state. 在调用Dispose,必须释放对所有引用ResourceSet以便可以通过垃圾回收回收其占用的内存。After calling Dispose, you must release all references to the ResourceSet so the memory it was occupying can be reclaimed by garbage collection.

备注

当前方法是实现IDisposable.DisposeThe current method is the implementation of IDisposable.Dispose. 此实现会调用Dispose(true)。This implementation calls Dispose (true).

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

释放与当前实例关联的资源(内存除外),并关闭内部托管对象(如果请求这样做)。Releases resources (other than memory) associated with the current instance, closing internal managed objects if requested.

protected:
 virtual void Dispose(bool disposing);
protected virtual void Dispose (bool disposing);
abstract member Dispose : bool -> unit
override this.Dispose : bool -> unit
Protected Overridable Sub Dispose (disposing As Boolean)

参数

disposing
Boolean Boolean Boolean Boolean

指示是否应显式关闭当前实例中包含的对象。Indicates whether the objects contained in the current instance should be explicitly closed.

注解

如果dispose参数是true,当前方法将释放与它以及与之关联的所有对象关联的所有资源。If the dispose parameter is true, the current method frees all the resources associated with it as well as with all objects associated with it. 如果disposefalse,当前方法释放仅资源分配给它,并忽略与之关联的任何对象。If dispose is false, the current method frees only the resources allocated to it, and ignores any objects associated with it.

适用于