Simplified Embedding
Simplified embedding is enabled in an editor when its document view object is parented to (that is, made a child of) Visual Studio, and the IVsWindowPane interface is implemented to handle its window commands. Simplified embedding editors cannot host active controls. The objects used to create an editor with simplified embedding are shown in the following illustration.
Editor with simplified embedding
注意
Of the objects in this illustration, only the CYourEditorFactory object is required to create a standard file-based editor. If you are creating a custom editor, you are not required to implement IVsPersistDocData2, because your editor will likely have its own private persistence mechanism. For non-custom editors, however, you must do so.
All interfaces implemented to create an editor with simplified embedding are contained in the CYourEditorDocument object. However, to support multiple views of document data, split the interfaces onto separate data and view objects as indicated in the following table.
Interface |
Location of interface |
Use |
---|---|---|
View |
Provides connection to the parent window. |
|
View |
Handles commands. |
|
View |
Enables status bar updates. |
|
View |
Enables Toolbox items. |
|
Data |
Sends notifications when the file changes. |
|
Data |
Enables the Save As feature for a file type. |
|
Data |
Enables persistence for the document. |
|
Data |
Allows suppression of file change events, such as reload triggering. |