This topic has not yet been rated - Rate this topic

IPersistFileFormat Interface

Obtains file format information about items that require saving, and enables the programmatic loading or saving of an object in a format specified by the user.

Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop (in microsoft.visualstudio.shell.interop.dll)

[InterfaceTypeAttribute(1)] 
[GuidAttribute("3AFAE242-B530-11D0-8199-00A0C91BBEE3")] 
public interface IPersistFileFormat : IPersist
/** @attribute InterfaceTypeAttribute(1) */ 
/** @attribute GuidAttribute("3AFAE242-B530-11D0-8199-00A0C91BBEE3") */ 
public interface IPersistFileFormat extends IPersist
InterfaceTypeAttribute(1) 
GuidAttribute("3AFAE242-B530-11D0-8199-00A0C91BBEE3") 
public interface IPersistFileFormat extends IPersist

The IPersistFileFormat interface is based on the standard IPersistFile interface and augments it in the following ways:

  • Shows you how to properly specify a new, untitled file to the InitNew method.

  • Shows you that the file should be opened as a read-only file.

  • Eliminates the unnecessary Save As prompt string from GetCurFile.

  • Returns an error code when Save(null) is called on an untitled object.

IPersistFileFormat provides enough information for the client of an object to implement the Save As dialog box—that is, to fill in the Save As Type drop-down list and manage the initial file extension but still give complete flexibility to the object. Thus, the object owns all aspects of its file and format, including the name of its format.

See illustrations of the implementation and/or calling of this interface in the samples Basic Edit Overview, Basic Project Sample, Figures Language Service Sample, and Figures Project Sample.

Notes to Implementers When saving documents or document editors that use the standard Save As dialog box implementation of the environment.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ