private void LoadSpatialFeatureClasses() { using (ICatalogEntityClass c = new CatalogEntityClassFeatureClass(_connString)) { ICatalogEntity[] objs = c.Query("datasetid='" + Id + "'"); _spatialFeatureClasses = objs; } }
private void Load() { try { using (ICatalogEntityClass cec = new CatalogEntityClassFeatureDataset(_connectionString)) { _featureDatasets = cec.Query(new SpatialFeatureDataset()); } using (ICatalogEntityClass cec = new CatalogEntityClassFeatureClass(_connectionString)) { _featureClasses = cec.Query("length(datasetid)=0"); } _isLoaded = true; } catch (Exception ex) { _isLoaded = false; MsgBox.ShowError(ex.Message); } }
public override void Click(enumContextKeys key) { switch (key) { case enumContextKeys.Delete: if (MsgBox.ShowQuestionYesNo("确定要删除要素类\"" + _name + "\"吗?\n\n删除以后不能恢复。") == System.Windows.Forms.DialogResult.No) { return; } SpatialFeatureClass ds = _tag as SpatialFeatureClass; using (ICatalogEntityClass c = new CatalogEntityClassFeatureClass(ds._connString)) { c.Delete(ds); ICatalogItem pIt = _parent; _parent.Remove(this); pIt.Refresh(); break; } case enumContextKeys.Property: using (frmFetClassDlg frm = new frmFetClassDlg()) { ICatalogEntity entity = _tag as ICatalogEntity; if (frm.ShowDialog(ref entity, false, false)) { entity.Store(); Refresh(); } } break; default: base.Click(key); break; } }