ArcFM Desktop Overview > ArcFM Solution Basics > Customizing with C# > Register C# Projects |
When you create a custom component, it will need to be registered in a specific component category. The component category into which an object is registered determines where in the application the object appears.
You must make a reference in the project to Miner.System. Also, you must include the following using statement in your code:
using Miner.ComCategories
The following line of code allows you to register your C# project in the correct component category using the 32-bit or 64-bit RegX executable (as of 10.1, only ArcFM Server has a 64-bit architecture). The sample below registers the component in the MMCustomTextSources category. If you need to register your component in multiple categories, modify the line of code below for each category.
C# Snippet |
Copy Code
|
---|---|
[ComponentCategory(ComCategory.MMCustomTextSources)] |
When you've created a custom component that contains the code shown above, you can use RegX.exe to register your DLL. To register a DLL, RegX creates .ecfg files and places them in the appropriate locations for ArcGIS Engine, ArcGIS for Desktop, or ArcGIS for Server.
You can drag the .dll file and drop it on top of RegX.exe to register it. By default this registers the DLL and places .ecfg files for all ArcGIS applications (Desktop, Engine, and Server).
Default RegX Installation Locations | |
---|---|
32-bit RegX.exe | Miner and Miner\ArcFM Solution\Bin |
64-bit RegX.exe |
Program Files\ArcGIS\Server\bin |
You can use the switches listed below to register your component for a specific ArcGIS application, rather than all of them.
Switch | Description |
---|---|
/c | If the target is a .NET assembly or an object for an autoupdater, register it with the CODEBASE flag. Use this if the DLL resides outside of the ArcFM Bin directory. |
/d | ArcGIS for Desktop |
/e | ArcGIS Engine |
/svr (or /server) | (64-bit only) ArcGIS for Server |
/wf | (64-bit only) Used with the /svr switch, writes the filepath name into an .ecfg file |
/u | Unregister. This also deletes the corresponding .ecfg file |
/ig | Adds the assembly to the GAC |
/ug | Removes the assembly from the GAC |
If your custom project is written in C++, you can use RegX to register it with ArcGIS 10.1. If your customization requires that your class be registered in a component category, you will need to do the following: