private void Initialize() { Collection <string> tables = FileGeoDatabaseFeatureSource.GetTableNames(gdbPath); foreach (string table in tables) { tableComBox.Items.Add(table.TrimStart('\\')); tableComBox.SelectedIndex = 0; } }
protected override SimpleShapeType GetFeatureSimpleShapeTypeCore(FeatureLayer featureLayer) { FileGeoDatabaseFeatureLayer layer = featureLayer as FileGeoDatabaseFeatureLayer; if (layer != null) { WellKnownType wellKnownType = WellKnownType.Invalid; layer.SafeProcess(() => { FileGeoDatabaseFeatureSource featureSource = (FileGeoDatabaseFeatureSource)layer.FeatureSource; wellKnownType = featureSource.GetFirstFeaturesWellKnownType(); }); return(MapHelper.GetSimpleShapeType(wellKnownType)); } return(SimpleShapeType.Unknown); }
private void TableComBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { fieldComBox.Items.Clear(); if (e.AddedItems.Count > 0) { Collection <string> fields = FileGeoDatabaseFeatureSource.GetColumnNames(gdbPath, e.AddedItems[0] as string); foreach (string item in fields) { fieldComBox.Items.Add(item); } if (fields.Contains("OBJECTID")) { fieldComBox.SelectedItem = "OBJECTID"; } else { fieldComBox.SelectedIndex = 0; } okButton.IsEnabled = tableComBox.SelectedItem != null && fieldComBox.SelectedItem != null; } }