Beispiel #1
0
        public void Dispose()
        {
            try
            {
                if (!DirectoryUtility.DeleteIfEmpty(_backupDirectory))
                {
                    Platform.Log(LogLevel.Warn, "Some backup files can be found left in {0}", BackupDirectory);
                }

                if (Platform.IsLogLevelEnabled(LogLevel.Debug) && Directory.Exists(_tempDirectory))
                {
                    Platform.Log(LogLevel.Debug, "Deleting temp folder: {0}", _tempDirectory);
                }

                DirectoryUtility.DeleteIfEmpty(_tempDirectory);
            }
            finally
            {
                if (_updateContext != null)
                {
                    Rollback();
                }

                if (_readContext != null)
                {
                    _readContext.Dispose();
                    _readContext = null;
                }
                // reset the current context for the thread
                _current = _inheritFrom;
            }
        }
Beispiel #2
0
        public ServerExecutionContext(String contextId, ServerExecutionContext inheritFrom)
        {
            Platform.CheckForNullReference(contextId, "contextId");

            _contextId   = contextId;
            _inheritFrom = inheritFrom;
            _current     = this;
        }