Package.Flush 方法
定义
保存包中包含的所有部件和关系的内容。Saves the contents of all parts and relationships that are contained in the package.
public:
void Flush();
public void Flush ();
member this.Flush : unit -> unit
Public Sub Flush ()
例外
包未打开(已调用了 Dispose(Boolean) 或 Close())。The package is not open (Dispose(Boolean) or Close() has been called).
包为只读的,无法进行修改。The package is read-only and cannot be modified.
注解
Flush 在内部调用派生类的 FlushCore 实现,以执行实际的特定于格式的刷新操作。Flush internally calls the derived class's FlushCore implementation to perform the actual format-specific flush operation. 派生类的 FlushCore 方法负责实际将部分和关系内容保存到特定的物理派生类实现。The derived class's FlushCore method is responsible for actually saving the part and relationship content to the specific physical derived class implementation.
默认情况下, ZipPackage Package 提供并使用抽象基类的派生实现。By default, a ZipPackage derived implementation of the abstract Package base class is provided and used. 在默认操作中,在 Flush 内部调用 FlushCore 以保存 ZIP 文件包中的部件和关系。In the default operation, Flush internally calls FlushCore to save the parts and relationships in a ZIP file package.
Flush 由和方法自动调用 Close Dispose 。Flush is called automatically by the Close and Dispose methods. 如果 Close 调用了或 Dispose ,则不必 Flush 单独调用。When Close or Dispose is called you do not have to call Flush separately.