Concept : Understanding Copy and Paste
Contents |
[edit] Description
Bungee Connect contains a restricted copy and paste feature. You can copy and paste various elements within a class, such as fields, functions, and forms. To copy, right-click the desired element within the Solution Detail panel, and select Copy. To paste, right-click the parent object in the Solution Explorer, and select Paste. See Using Copy and Paste for details on using Copy and Paste.
[edit] Supported Types
[edit] Using the Clipboard
You can also copy and paste using the Bungee Builder clipboard, which is separate from the host operating system's clipboard. When you copy a class member, the member is added to the clipboard as the first item. You can view the contents of the clipboard by right-clicking on a class in the Solution Explorer, then selecting the Open Clipboard... menu option. You can only open the clipboard if you have already copied at least one class member.
You can paste multiple items from the clipboard by opening the clipboard, then selecting the items that you want to paste (use Ctrl-click to select multiple items), then clicking Paste Selected.
[edit] Naming
If you attemp to paste an item that has the same name as an existing item, "CopyOf" is pre-pended to the item's name. In addition, to avoid collisions, numbers are appended to the item name when an item is pasted several times. For example, if Foo already exists in the location to which you're pasting, and you paste Foo three more times, the pasted copies are named:
- CopyOfFoo
- CopyOfFoo1
- CopyOfFoo2
[edit] Duplicate Interfaces
When pasting an object that supports assigned interfaces (forms, and functions), there is a paste check for duplicate interfaces as follows:
- Forms: You are prompted to choose another form interface and continue. This is necessary because Bungee Connect requires that all forms have at least one unique interface. When choosing another form interface, you are required to choose one that is unique. Nothing is pasted if you cancel at any point.
- Functions: There are two possible scenarios when pasting functions:
- The function does not use interfaces (not all do). The function is pasted without user intervention.
- The function uses one or more interfaces. You are prompted as to whether you want to remove the interface from the copy of the function being pasted (you cannot use duplicate interfaces in the same class). Nothing is pasted if you cancel. Removal of duplicate interfaces is okay because functions are not required to have any interfaces. If you want to use an interface with the copy of the function you are pasting, you can add an interface once you have pasted the function.
Note You cannot paste a pre-exisiting adapter within a class. If you attempt to do so, you are informed that the adapter cannot be pasted because the selected class already has an adapter of the same type. This is necessary because an adapter is required to have a unique interface, and the list of interfaces for an adapter is not user-editable; it is assigned when the adapter is created.
[edit] Caveats when Copying Forms
While copying a form can save you lots of time in tweaking layouts, you should be aware that Controls (for example Buttons) retain their bindings to the underlying functionality when you copy and paste the form. This means you should make any needed changes in your new form in a systematic way, otherwise you may make mistakes and create more work for yourself. To avoid some common errors, you may want to follow the steps below in the order given:
- If you have the form you want to copy open in the Design Editor, close the tab displaying the form.
- As soon as you paste the form, select the form in the Solution Details, then change the form's Name to a new name you want, then open that form and re-bind the controls to the different fields and functions you want.
[edit] See Also
Using Copy and Paste
Understanding Forms
Editing a Form
[edit] Tags



