public void RefreshFrom(object obj) { if (!(obj is AccessFDBFeatureClass)) { return; } AccessFDBFeatureClass fc = (AccessFDBFeatureClass)obj; if (fc.Name != this.Name) { return; } this.Envelope = fc.Envelope; this.SpatialReference = fc.SpatialReference; this.IDFieldName = fc.IDFieldName; this.ShapeFieldName = fc.ShapeFieldName; _geomDef.GeometryType = fc.GeometryType; _geomDef.HasZ = fc.HasZ; _geomDef.HasM = fc.HasM; Fields fields = new Fields(fc.Fields); if (fields != null) { fields.PrimaryDisplayField = m_fields.PrimaryDisplayField; } m_fields = fields; }
void SqlFDB_TableAltered(string table) { if (_layers == null) { return; } foreach (IDatasetElement element in _layers) { if (element.Class is AccessFDBFeatureClass && ((AccessFDBFeatureClass)element.Class).Name == table) { var fields = _fdb.FeatureClassFields(this._dsID, table); AccessFDBFeatureClass fc = element.Class as AccessFDBFeatureClass; ((Fields)fc.Fields).Clear(); foreach (IField field in fields) { ((Fields)fc.Fields).Add(field); } } } }