Esempio n. 1
0
        public override void Dispose()
        {
            base.Dispose();
            if (_queryInfo != null)
            {
                _queryInfo.Dispose();
                _queryInfo = null;
            }

            if (_stream != null)
            {
                _stream.Free();
                _stream = null;
            }

            if (_connection != null)
            {
                try
                {
                    _connection.Close();
                }
                catch { }
                _connection = null;
            }
        }
Esempio n. 2
0
 public IDatasetElement this[string title]
 {
     get
     {
         SE_LAYERINFO layerInfo = new SE_LAYERINFO();
         try
         {
             SdeFeatureClass fc = null;
             //SdeConnection connection = _sConnection.AllocConnection();
             using (ArcSdeConnection connection = new ArcSdeConnection(_connStr))
             {
                 if (connection.Open(this))
                 {
                     if (Wrapper10.SE_layerinfo_create(new SE_COORDREF(), ref layerInfo) != 0)
                     {
                         return(null);
                     }
                     if (Wrapper10.SE_layer_get_info(connection.SeConnection, title, "", layerInfo) != 0)
                     {
                         return(null);
                     }
                     fc = new SdeFeatureClass(this, connection.SeConnection, layerInfo);
                 }
                 connection.Close();
             }
             //_sConnection.FreeConnection();
             return(new DatasetElement(fc));
         }
         finally
         {
             if (layerInfo.handle != IntPtr.Zero)
             {
                 Wrapper10.SE_layerinfo_free(layerInfo);
             }
         }
     }
 }