Looking at the 2008 API documentation, this appears to be a
way to add a reference count for a file in PDM. However, there is
no example of usage and I have not yet determined how to use it.
Anyone know how and have an example to share?
public void UpdateReferenceCount(string filePath, string
referenceName, int newCount)
{
IEdmRawReferenceMgr refMgr =
(IEdmRawReferenceMgr)m_vault.CreateUtility(EdmUtility.EdmUtil_RawReferenceMgr);
try
{
if (refMgr.Open(filePath))
{
Array references =
Array.CreateInstance(typeof(EdmRawReference), 99);
refMgr.GetReferences(ref references);
for (int i = 0; i < references.Length; i++)
{
EdmRawReference reference =
(EdmRawReference)references.GetValue(i);
if (reference.mbsRefName == referenceName)
{
reference.mlCount = newCount;
references.SetValue(reference, i);
break;
}
}
refMgr.UpdateReferences(newReferences);
}
}
catch (Exception)
{
throw;
}
finally
{
refMgr.Close();
}
}