PresentationLockingBehavior

IBlobManagementOptions.PresentationLockingBehavior property

This property defines if an instance of the Presentation class can be an owner of the source - file or stream during the instance lifetime. If the instance is an owner, it locks the source. This helps to improve memory consumption and performance while working with BLOBs, but the source (stream or file) can’t be changed during Presentation’s instance lifetime. This is an example:

public PresentationLockingBehavior PresentationLockingBehavior { get; set; }

Examples

LoadOptions loadOptions = new LoadOptions { 
  BlobManagementOptions = {PresentationLockingBehavior = PresentationLockingBehavior.KeepLocked} };
using (Presentation pres = new Presentation("pres.pptx", loadOptions)) {
  // IOException will be thrown because pres.pptx is locked for a Presentation lifetime
  // File.Delete("pres.pptx");
}
// after Presentation object disposed, file is unlocked and can be deleted
File.Delete("pres.pptx");

See Also