private void Dispose(bool disposing) { if (_storage != null) { _storage.Dispose(); _storage = null; } }
public DatabaseMsdnBuilder(string workingDir, string locale) { if (String.IsNullOrEmpty(workingDir)) { throw new ArgumentException("workingDir"); } _storage = new BuilderMsdnStorage(true, workingDir, locale); _workingDir = workingDir; }
public DatabaseMsdnBuilder(string workingDir, string locale) { if (String.IsNullOrEmpty(workingDir)) { _storage = new BuilderMsdnStorage(true, locale); } else { _storage = new BuilderMsdnStorage(true, workingDir, locale); } }
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.AddLinks(dataDir, "*.xml", true, ReferenceLinkType.None); if (_storage != null) { // Retrieve any exceptions _exceptions = _storage.Exceptions; _storage.Dispose(); _storage = null; } if (_exceptions != null && _exceptions.Count != 0) { return(false); } // Perform a defragmentation of the PersistentDictionary.edb database return(this.Defragmentation()); }
public DatabaseMsdnBuilder(string locale, DataSource source) { if (source == null) { throw new ArgumentNullException("source"); } if (!source.IsBuilding || !source.IsValid) { throw new ArgumentException("source"); } string workingDir = source.OutputDir; if (String.IsNullOrEmpty(workingDir)) { throw new ArgumentException("workingDir"); } _source = source; _storage = new BuilderMsdnStorage(true, workingDir, locale); _workingDir = workingDir; }