MediaServer Component Objects

In addition to the methods, properties, and events used for configuring and managing Theater servers, the MediaServer control also manages collections of component objects that encapsulate the status and behavior of clients, servers, disk drives, and titles. Some objects represent a collection of other objects. These component objects are:

The following chart illustrates the hierarchy of objects managed by the MediaServer control:

Using MediaServer Component Objects

As with any object model, you access the methods and properties with the “dot” operator, as illustrated in the following syntax:

<MediaServer Object>.<Component Object>.<Property Name>

For example, you could use

Mediaserver1.Logging.Directory

to access the Directory property of a Logging object.

Using MediaServer Collections

A collection helps to centralize the management of its member objects. All NetShow Theater collection objects are zero-based arrays of like types of objects. All collection objects expose the Count property, which specifies the number of objects contained in the collection, and the Item property for retrieving individual objects in the collection.

To access properties and methods of objects in a collection, the name of the collection object is referenced, with a numeric argument specifying the position of the object in the array. For example, you can use the following syntax to access the Name property of a Client object.

<MediaServer Object>.<Collection Name>[.Item](Index).<Property Name>

The Item property is the default property of each collection object. Explicit use of it to reference a member object is optional. For example, you could write the following code to display the IPAddress property of each Client object in a Clients collection object:

Dim clients as IMSrvClients
Set clients = MediaServer1.Clients
For i=0 to clients.Count-1
  MsgBox clients(i).IPAddress
Next

However, with Visual Basic, you could make the implementation more efficient by using the For Each … In … loop statement:

Dim client As IMSrvClient
For Each client In MediaServer1.Clients
    MsgBox client.ipaddress
Next
© 1996-1998 Microsoft Corporation. All rights reserved.