Exemplo n.º 1
0
        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        /// <remarks>Documented by Dev03, 2009-01-13</remarks>
        public void Dispose()
        {
            if (DbMediaServer.DbMediaServer.Instance(parent).IsAlive)
            {
                DbMediaServer.DbMediaServer.Instance(parent).Stop();
            }

            if (Parent != null)
            {
                Parent.OnDictionaryClosed(this, EventArgs.Empty);
            }

            if (Parent.CurrentUser.ConnectionString.Typ == DatabaseType.MsSqlCe)
            {
                MSSQLCEConn.CloseMyConnection(this.Connection);
            }
            //MSSQLCEConn.CloseAllConnections();

            FileCleanupQueue.DoCleanup();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Deletes a specific LM.
        /// </summary>
        /// <param name="css">The connection string struct.</param>
        /// <remarks>Documented by Dev02, 2008-07-28</remarks>
        /// <remarks>Documented by Dev08, 2008-12-09</remarks>
        /// <remarks>Documented by Dev08, 2008-12-09</remarks>
        public void Delete(ConnectionStringStruct css)
        {
            if (!this.HasPermission(PermissionTypes.CanModify))
            {
                throw new PermissionException();
            }
            switch (css.Typ)
            {
            case DatabaseType.PostgreSQL:
                parent.CurrentUser.CheckConnection(parent.CurrentUser.ConnectionString);
                connector.DeleteLM(css.LmId);
                break;

            case DatabaseType.MsSqlCe:
                //MSSQLCEConn.CloseAllConnections();
                MSSQLCEConn.CloseMyConnection(css.ConnectionString);            //[ML-1939] "Delete" of EDB needs very long time
                File.Delete(css.ConnectionString);
                break;

            default:
                throw new UnsupportedDatabaseTypeException(css.Typ);
            }
        }