ArcFM Desktop Developer Guide
Referencing the CU Library

Resource Center Home

The ArcFM Desktop SDK includes a LoadLibrary method that returns a reference to the CU library. In most cases, however, it's more efficient for custom programs to store a reference to the CuLibraryExtension. If the extension does not already contain a local reference to the library, it will call LoadLibrary(). Consequently, you should leverage Esri's extension manager to get a reference to the library's extension:

  1. Create a method or a class property that returns a CuLibrary object.
  2. Include a get accessor that creates an instance of Esri's extension manager.
  3. Use Esri's extension manager to locate the CuLibraryExtension.
  4. Return the CuLibrary stored in the extension.

Getting a reference to the cu library extension
Copy Code
public CuLibrary Library
{
    get
    {
        if (_cuLibraryExtension == null)
        {
           // Get the ESRI Extension Manager
           IExtensionMangager extMgr = (IExtensionManager)Activator.CreateInstance(Type.GetTypeFromProgID("esriSystem.ExtensionManager", true));

           // Use the Esri extension manager to get the Cu Library Extension
           _cuLibraryExtension = extMgr.FindExtension("CuLibraryExtension") as CuLibraryExtension;
        }

        // If it still equals null, no extension could be found.
        if (_cuLibraryExtension == null)
        {
           return null;
        }
        return _cuLibraryExtension.CuLibrary;
    }
}

 

 


Send Comment to ArcFMdocumentation@schneider-electric.com