Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Анг-язык на 22.10.12.docx
Скачиваний:
1
Добавлен:
20.11.2019
Размер:
38.94 Кб
Скачать
  1. Using the Object Repository: Overview

The Object Repository (Tools|Repository) makes it easy share forms, dialog boxes, frames, and data modules. It also provides templates for new projects and wiz­ards that guide the user through the creation of forms and projects. The Repository is maintained in DELPHI32.DRO (by default in the BIN directory), a text file that con­tains references to the items that appear in the Repository and New Items dialogs.

  1. Sharing items within a project

You can share items within a project without adding them to the Object Re­pository. When you open the New Items dialog box (File|New|Other), you'll see a page tab with the name of the current project. This page lists all the forms, dialog boxes, and data modules in the project. You can derive a new item from an existing item and customize it as needed.

  1. -Adding items to the Object Repository

You can add your own projects, forms, frames, and data modules to those al­ready available in the Object Repository. To add an item to the Object Repository,

    1. If the item is a project or is in a project, open the project.

    2. For a project, choose Project|Add To Repository. For a form or data module, right-click the item and choose Add To Repository.

    3. Type a description, title, and author.

    4. Decide which page you want the item to appear on in the New Items dialog box, then type the name of the page or select it from the Page combo box. If you type the name of a page that doesn't exist, the Object Repository creates a new page.

    5. Choose Browse to select an icon to represent the object in the Object Re­pository.

    6. Choose OK.

  1. Sharing objects in a team environment

You can share objects with your workgroup or development team by making a repository available over a network. To use a shared repository, all team members must select the same Shared Repository directory in the Environment Options dialog:

    1. Choose Tools|Environment Options.

    2. On the Preferences page, locate the Shared Repository panel. In the Direc­tory edit box, enter the directory where you want to locate the shared repository. Be sure to specify a directory that's accessible to all team members.

  1. Using an Object Repository item in a project

To access items in the Object Repository, choose File|New|Other. The New Items dialog appears, showing all the items available. Depending on the type of item you want to use, you have up to three options for adding the item to your project: copy, inherit, use.

  1. Copying an item

Choose Copy to make an exact copy of the selected item and add the copy to your project. Future changes made to the item in the Object Repository will not be reflected in your copy, and alterations made to your copy will not affect the original Object Repository item.

  1. Inheriting an item

Choose Inherit to derive a new class from the selected item in the Object Re­pository and add the new class to your project. When you recompile your project, any changes that have been made to the item in the Object Repository will be reflected in your derived class, in addition to changes you make to the item in your project: Changes made to your derived class do not affect the shared item in the Object Re­pository.