Programming Guide: Data Transfer

# Programming Guide

## Data Transfer

General

- Modify your basic routines for writing and reading data to account for embedded parts. This includes transfers involving the clipboard, the drag-and-drop object, link-source objects, link objects, other parts (as per the Insert command), and fulfilled promises.

  - Do all reading and writing in the context of cloning. In addition to reading and writing intrinsic data, clone embedded frames (and other referenced objects) to or from the storage units involved.

  - If you write a single embedded part, you should write its frame as an annotation to the storage unit. If you read a single embedded part, use that annotated frame as the frame of the part you read.

  - Modify your part's CloneInto method to add cloning of your part's embedded parts.

- Follow the conventions for receiving transferred data. Incorporate the data if your part editor can read it; otherwise, embed it as a separate part.

- Modify your handling of the Paste As dialog box: allow the user to select the Embed as button.

Cutting Data

- If you cut (or drag-move) data from your part that includes embedded frames, keep these cautions in mind:

  - Do not assume that removing one embedded frame removes a part entirely; other frames of the part may still be embedded in your part.

  - Be sure to set the containing frame of each removed frame to null, since it is no longer embedded in your part.

  - Use your own display facet's embedded facet iterator to delete the facets of each frame that was removed.

  - Be sure to remove, rather than release or delete, each cut frame object. To support undo, do the release or delete only when your part's DisposeActionState method is called. See "Undoing Clipboard Operations" for more information.

Linking

- Implement your part's EmbeddedFrameUpdated method, so that embedded frames can notify your part when their content has changed and your part can in turn update any link sources involving that embedded content.

- Implement your part's EditInLinkAttempted method, so that embedded parts can notify you when the user attempts to edit their data when it is part of a link destination that you maintain.

- Call the ChangeLinkStatus method of any embedded frame that becomes part of, or ceases to be part of, a link source or destination that you maintain.

[ Top | Previous | Next | Contents | Index | Documentation Homepage ]