public void Dispose() { try { IMapRuntime r = _environment as IMapRuntime; if (r != null && r.RuntimeExchanger != null) { r.RuntimeExchanger.RemoveLayer(this); } if (_class != null) { _class.Dispose(); } if (_featureRender != null) { _featureRender.Dispose(); } } finally { _disposed = true; } }