Retrieving an associations manager

The associations manager is retrieved using the the GetAssociationManager method of the AssociationsManager. This method supports 5 overloads so the SDK consumer may retrieve the needed manager in several ways. Examples of two different methods are provided below.

/// <summary>

/// Retrieves an association manager given two existing database entities.

/// </summary>

/// <remarks>

/// The entities passed in in this case do not necessarily need to be the entities you wish

/// to relate. Instead they are used to determine entity types for future associations

/// supported by the returned AssociationManager.

/// </remarks>

private AssociationManager GetAssociationManager(Contact contact, Group group)

{

ActFramework ACTFM = new ActFramework();

ACTFM.LogOn("C:\\Documents and Settings\\Administrator\\My Documents\\ACT\\Act for Win 8\\Databases\\Act8Demo.pad", "Chris Huffman", "");

AssociationManager manager = ACTFM.Associations.GetAssociationManager(contact, group);

return manager;

}

/// <summary>

/// Retrieves an association manager given the name of two entity types. IE "Contact" or "Group"

/// </summary>

private AssociationManager GetAssociationManager(string entityOne, string entityTwo)

{

ActFramework ACTFM = new ActFramework();

ACTFM.LogOn("C:\\Documents and Settings\\Administrator\\My Documents\\ACT\\Act for Win 8\\Databases\\Act8Demo.pad", "Chris Huffman", "");

AssociationManager manager = ACTFM.Associations.GetAssociationManager(entityOne, entityTwo);

return manager;

}