AnsweredAssumed Answered

How to get a list of Class Extensions installed on PC?

Question asked by timdine on Jul 29, 2015
Latest reply on Sep 12, 2016 by harshita123

I'm building a geoprocessing tool which allows Class Extensions to be applied to and removed from an object in the geodatabase.  Works great, it's in a custom toolbox with user defined input parameters.  If I know the guid of a class extension I can apply it.


Exert from set execute function

ITable theITable = _utils.OpenTableFromString(thePath);
IClassSchemaEdit classSchemaEdit = (IClassSchemaEdit)theITable;
if (classSchemaEdit == null)
     message.AddMessage("The selected object does not contain and/or support extension classes.");
     message.AddMessage("The extension class is being set on the selected object");
     ISchemaLock schemaLock = (ISchemaLock)classSchemaEdit;
     //Need an exclusive schema lock on the class.
     classSchemaEdit.AlterClassExtensionCLSID(theGUIDUID, null);


Exert from ParameterInfo section of tool.

//Could write some code here to pull this list of codes from the geodatabase 
IGPCodedValueDomain pGUIDDomain = new GPCodedValueDomainClass();
pGUIDDomain.AddStringCode("{A GUID GOES HERE}", "Test Class 1");
//pAccumulatorsDomain.AddStringCode("Meters", "Meters");
IGPParameterEdit3 theInputGUID = new GPParameterClass();
theInputGUID.DataType = new GPStringType();
theInputGUID.Value = new GPStringClass();
theInputGUID.Direction = esriGPParameterDirection.esriGPParameterDirectionInput;
theInputGUID.DisplayName = "Input GUID";
theInputGUID.Name = "inputGUID";
theInputGUID.ParameterType = esriGPParameterType.esriGPParameterTypeRequired;
theInputGUID.Domain = (IGPDomain)pGUIDDomain;




In there future rather than have the guids hardcoded or in a config file I'd like to find the class extensions that I could apply in the code that I can then populate into a user pick list in the tool.  I don't know how to find the list of extensions.  I'd rather get a list of class extensions on the PC rather than applied in the geodatabase.  Narrowing the list to custom ones would be ideal but not necessary.  It isn't meant to be run by generic users, only administrators.  Thoughts?