private string FindFKey(FeatureClassField[] theFkeys, IFeatureClass fc, out int fkeyIndex) { string theReturn = ""; fkeyIndex = -1; IDataset theDataset = (IDataset)fc; foreach (FeatureClassField fcf in theFkeys) { if (fcf.FeatureClassName == theDataset.Name) { fkeyIndex = fc.FindField(fcf.FieldName); if (fkeyIndex == -1) return ""; theReturn = fcf.FieldName; break; } } return theReturn; }
public ChooseFieldsParameterInfo(string name, string text, FeatureClassField[] initValue) { base._name = name; base._text = text; this._value = initValue; }
private bool FindFeatureClassField(FeatureClassField fcf, out int layerIdx, out int fieldIdx) { layerIdx = -1; fieldIdx = -1; for (int i = 0; i < this.LayerCount; i++) { IFeatureLayer theWorkLayer = this.get_Layer(i); if (fcf.FeatureClassName == ((IDataset)theWorkLayer.FeatureClass).Name) { for (int j = 0; j < theWorkLayer.FeatureClass.Fields.FieldCount; j++) { if (theWorkLayer.FeatureClass.Fields.get_Field(j).Name == fcf.FieldName) { layerIdx = i; fieldIdx = j; return true; } } } } return false; }