ArcFM Desktop Overview > Designer Overview > Compatible Units > Referencing the CU Library |
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:
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; } } |