A Module Database tree-view editor/control consists of a MS TreeView control and "query date" controls.
The TreeView is the main component of the control, it visualizes the Module Database in a hierarchical manner and allows user interactions, such as database maintenance, drilling down the hierarchy, selection of modules etc.
The query date controls on top of the tree-view show the current date and allow the users to select the date:
- directly typing in the date and pressing the Apply-button. Any PITimeFormat compatible string is a valid entry.
- invoking the "DateTime" picker dialog by pressing the button.
What the control looks like in the Visual Studio.NET toolbox.
What the control looks like in an application.
The MDBTree control can be used to maintain, view and search the Module database in various ways. However, the main use of this control is to allow users to maintain the database and database objects, such as modules, aliases, properties and headings The secondary usage is to allow selection of a module, an alias, a property or a heading for use as context in an application.
How to Use This Control
Site this control on a Windows Form (see instructions below). Set the serverList property to define the servers to connect to, otherwise the the tree comes up empty. Also use the ViewStyle property to set the view suitable to the application. Subscribe to control events in order to get notifications on important events.
The control has numerous properties that affect the behavior and the visibility of different types of database objects. The most important of these is the ViewStyle property that sets the view to a pre-defined setting. The individual properties can be used to further adapt the features to suit the application needs, see Properties for a complete list of available features.
The functionality of this control is mostly exposed via context menus, which loosely resemble those in Windows Explorer. It is possible to copy, move, delete and create new objects. The additional features allow users to edit/view object attributes and/or execute certain functions or define behaviors (reset all, refresh view, usage of EventPipes, defining root nodes to name a few). The control provides full drag and drop features that rely on special clipboard formats, such as full pathnames and persistence strings. There's very little difference between drag-drop and copy, both can be used with external sources or targets and multi-select features.
Assembly: OSIsoft.PISDK.Controls.MDBTreeNet (in OSIsoft.PISDK.Controls.MDBTreeNet.dll)
How to add the control to VS.NET toolbox and site it on a Windows form:
1. Create a new windows application with VS.NET.
2. Add a reference to this control (right-click Project References -> Add -> Browse (to PISDK folder) -> select OSIsoft.PISDK.Controls.MDBTreeNet.dll -> Open -> OK.
3. Add the OSIsoft.PISDK.Controls.MDBTreeNet user control to the toolbox (right-click the toolbar -> Add/Remove items -> Browse ( PISDK folder) -> select OSIsoft.PISDK.Controls.MDBTreeNet.dll) -> Open -> OK. You may may want to sort the toolbox items alphabetically, right-click the toolbox and select "sort....").
4. Click on the toolbox icon of the MDBTreeNet control and place it on the form. The name of the control will be mdbTreeNet1, please don't change it if you plan to use the provided examples.
Host application requirements:
The application that hosts the MDBTreeNet editor must have a manifest file that enables Windows XP visual styles. This is necessary for the embedded TreeView control to render the tree correctly.
The manifest file must be delivered with the application and must be placed in the same folder as the executable. The file must be named as "YourAppName".exe.Manifest. The content of the file is as follows (replace YourAppName with your application name):
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<description>.NET control deployment tool</description>