Select to view content in your preferred language

Reading extended job properties

2793
1
05-14-2010 09:30 AM
RetoSchöning
New Contributor
I haven't found a way to read a value for a job's extended property. I can get the record from the container, but how can I get the field index for the property name (I would prefer not to hardcode the index)? There is an interface IJTXAuxPropFieldInfoSet which seems to be made for this, but I can't find where it is implemented. I checked all types in ESRI.ArcGIS.JTX via reflection, but that interface seems to not be implemented anywhere. Or is there another way how to get at those property values? Do I have to open the AuxRecordContainer as an ITable?

Here's the method I would like to implement. I'm using JTX 9.3.1 build 128.

private static int GetFieldIndex([NotNull] IJTXAuxRecordContainer recordContainer, [NotNull] string fieldName)
{
 // invalid cast:
 IJTXAuxPropFieldInfoSet fieldInfos = (IJTXAuxPropFieldInfoSet) recordContainer;
 
 fieldInfos.Reset();
 IJTXAuxPropFieldInfo fieldInfo = fieldInfos.Next();

 int index = 0;
 while (fieldInfo != null)
 {
  if (string.Equals(fieldName, fieldInfo.FieldName, StringComparison.OrdinalIgnoreCase))
  {
   return index;
  }

  fieldInfo = fieldInfos.Next();
  index++;
 }

 return -1;
}
0 Kudos
1 Reply
RetoSchöning
New Contributor
ok, once I have a record I can use IJTXAuxRecord.get_PropName(int index) to search for the property index. That works.

If IJTXAuxPropFieldInfoSet is implemented on some public class I would still appreciate a hint, I would prefer to look up the field indexes before accessing the records.
0 Kudos