IReposProperty Interface

See Also

The IReposProperty interface provides access to a persistent member (a property or collection) of a tool information model interface.

When you instantiate an Automation object that represents an object from your tool information model, and that object conforms to a class for which there is no custom implementation (in other words, you have provided no software implementation of the class), the Repository will provide an interface implementation for you. This interface implementation uses IRepositoryDispatch as its dispatch interface.

The IRepositoryDispatch interface is an enhanced IDispatch interface; in addition to all of the standard IDispatch methods, IRepositoryDispatch also provides access to the Properties collection. The Properties collection gives you a convenient mechanism to enumerate through all of the persistent properties and collections of an interface. The IReposProperty interface can be used to access the individual members in the Properties collection.

This support enables the Automation programmer to use syntax like:

Dim firstPropName As String
Let firstPropName = repObject.Properties(1).Name

The second statement resolves like this:

  1. In this example, repObject is an Automation instantiation of a Repository object where the default implementation has been used.

  2. The Properties term is the Automation level name for the get_Properties method that is supplied by the IRepositoryDispatch interface.

  3. The get_Properties method returns the interface pointer to the IReposProperties interface.

  4. The default method of the IReposProperties interface is the get_Item method, which returns an IReposProperty interface pointer for the specified property object in the Properties collection.

  5. The Name term is the Automation level name for the get_Name method that is supplied by the IReposProperty interface.

At this point, the Automation programmer has access to the name of the first property in the collection through the firstPropName variable.

When to Use

Use the IReposProperty interface to access a persistent interface member, when no custom implementation is available, and you do not already know the type or name of the member. With this interface, you can:

Methods

IUnknown Method Description
QueryInterface Returns pointers to supported interfaces.
AddRef Increments the reference count.
Release Decrements the reference count.

IDispatch Method Description
GetIDsOfNames Maps a single member and a set of argument names to a corresponding set of dispatch identifiers.
GetTypeInfo Retrieves a type information object, which can be used to get the type information for an interface.
GetTypeInfoCount Retrieves the number of type information interfaces that an object provides (either 0 or 1).
Invoke Provides access to properties and methods exposed by an Automation object.

IReposProperty Method Description
get_Type Retrieves the type of a persistent interface member.
get_Name Retrieves the name of a persistent interface member.
get_Value Retrieves the value of a persistent interface member.
put_Value Sets the value of a persistent property.

Remarks

Only persistent members (that is, members that are stored in the Repository) can be accessed by the IReposProperty interface.