This document is archived and information here might be outdated. Recommended version. |
Provides access to members that define a memory relationship class name.
Name | Description | |
---|---|---|
BackwardPathLabel | The back label of the relationship. | |
DestinationName | The name object of the destination class of the memory relationship. | |
ForwardPathLabel | The forward label of the relationship. | |
OriginForeignKey | Origin foreign key field name. | |
OriginName | The name object for the origin table of the memory relationship. | |
OriginPrimaryKey | Origin primary key field name. |
CoClasses and Classes | Description |
---|---|
MemoryRelationshipClassName | A name class that represents as in memory relationship class. |
The IMemoryRelationshipClassName interface contains properties that correspond to the parameters used with the IMemoryRelationshipClassFactory::Open method. These include the Origin and Destination tables, the fields and the forward and backward path names.
The only parameters from the IMemoryRelationshipClassFactory::Open method that don't have a corresponding property in IMemoryRelationshipClassName are the name and the cardinality. The name can be set using the IDatasetName interface and the cardinality can be set using the IRelationshipClassName interface. Both of these interfaces are inherited by MemoryRelationshipClassName.
The diagram below describes the associations that define a MemoryRelationshipClass .
Since a MemoryRelationshipClass implements IDataset, you can use the IDataset::FullName property to get a MemoryRelationshipClassName object that corresponds to an existing MemoryRelationshipClass.
See the IName interface topic for more information on Name objects in general.
The example below creates a new MemoryRelationshipClass using name objects.
public static IRelationshipClass CreateMemRelClass(IName originName, IName destinationName, String originField, String destField)
{
// Set the memory relationship class properties.
IMemoryRelationshipClassName memoryRelationshipClassName=new MemoryRelationshipClassNameClass
{
OriginName=originName,
DestinationName=destinationName,
OriginPrimaryKey=originField,
OriginForeignKey=destField,
ForwardPathLabel="FWD",
BackwardPathLabel="BACK"
};
// Set the relationship class properties.
IRelationshipClassName relationshipClassName=(IRelationshipClassName)memoryRelationshipClassName;
relationshipClassName.Cardinality=esriRelCardinality.esriRelCardinalityOneToOne;
IDatasetName datasetName=(IDatasetName)relationshipClassName;
datasetName.Name="New_MemRC";
// Open and return the memory relationship class.
IName name=(IName)relationshipClassName;
return (IRelationshipClass)name.Open();
}
The example below creates a new MemoryRelationshipClass using name objects.
Public Shared Function CreateMemRelClass(ByVal originName As IName, ByVal destinationName As IName, _
ByVal originField As String, ByVal destField As String) As IRelationshipClass
' Set the memory relationship class properties.
Dim memoryRelationshipClassName As IMemoryRelationshipClassName=New MemoryRelationshipClassNameClass With _
{ _
.OriginName=originName, _
.DestinationName=destinationName, _
.OriginPrimaryKey=originField, _
.OriginForeignKey=destField, _
.ForwardPathLabel="FWD", _
.BackwardPathLabel="BACK" _
}
' Set the relationship class properties.
Dim relationshipClassName As IRelationshipClassName=CType(memoryRelationshipClassName, IRelationshipClassName)
relationshipClassName.Cardinality=esriRelCardinality.esriRelCardinalityOneToOne
Dim datasetName As IDatasetName=CType(relationshipClassName, IDatasetName)
datasetName.Name="New_MemRC"
' Open and return the memory relationship class.
Dim name As IName=CType(relationshipClassName, IName)
Return CType(name.Open(), IRelationshipClass)
End Function
IRelationshipClass Interface | IMemoryRelationshipClassFactory Interface | IName Interface