public void Uninitialize() { try { if (_localStorage != null) { _localStorage.Dispose(); _localStorage = null; } if (_msdnStorage != null) { _msdnStorage.Dispose(); _msdnStorage = null; } } catch { } }
public bool Build() { if (String.IsNullOrEmpty(_workingDir) || !Directory.Exists(_workingDir)) { return(false); } string dataDir = null; if (_source != null && Directory.Exists(_source.InputDir)) { dataDir = _source.InputDir; } else { dataDir = Environment.ExpandEnvironmentVariables( @"%DXROOT%\Data\Reflection"); dataDir = Path.GetFullPath(dataDir); } if (!Directory.Exists(dataDir)) { return(false); } this.AddTargets(dataDir, "*.xml", true, ReferenceLinkType.None); if (_storage != null) { _storage.Dispose(); _storage = null; } // Perform a defragmentation of the PersistentDictionary.edb database Process process = new Process(); ProcessStartInfo startInfo = process.StartInfo; startInfo.FileName = "esentutl.exe"; startInfo.Arguments = "-d " + DataSource.DatabaseFileName + " -o"; startInfo.UseShellExecute = false; startInfo.CreateNoWindow = true; startInfo.WorkingDirectory = _workingDir; startInfo.RedirectStandardOutput = false; // Now, start the process - there will still not be output till... process.Start(); // We must wait for the process to complete... process.WaitForExit(); int exitCode = process.ExitCode; process.Close(); if (exitCode != 0) { return(false); } string[] logFiles = Directory.GetFiles(_workingDir, "*.log", SearchOption.TopDirectoryOnly); if (logFiles != null) { for (int i = 0; i < logFiles.Length; i++) { File.Delete(logFiles[i]); } } return(true); }