private void Dispose(bool disposing) { if (_linkResolver != null) { _linkResolver.Dispose(); _linkResolver = null; } }
private TargetMsdnController(XPathNavigator configuration) { if (configuration == null) { _linkResolver = new MemoryMsdnResolver(); } else { string tempText = configuration.GetAttribute("storage", String.Empty); if (String.IsNullOrEmpty(tempText) || !String.Equals( tempText, "database", StringComparison.OrdinalIgnoreCase)) { _linkResolver = new MemoryMsdnResolver(); } else { bool isCached = true; tempText = configuration.GetAttribute("cache", String.Empty); if (!String.IsNullOrEmpty(tempText)) { isCached = Convert.ToBoolean(tempText); } XPathNodeIterator iterator = configuration.Select("source"); if (iterator == null || iterator.Count == 0) { _linkResolver = new MemoryMsdnResolver(); } else { DatabaseMsdnResolver databaseResolver = new DatabaseMsdnResolver(true, isCached, isCached); List <DataSource> dataSources = new List <DataSource>(); foreach (XPathNavigator navigator in iterator) { DataSource dataSource = new DataSource(false, navigator); string workingDir = dataSource.OutputDir; if (dataSource.IsValid || (!String.IsNullOrEmpty(workingDir) && Directory.Exists(workingDir))) { if (databaseResolver.IsInitialized) { if (dataSource.Exists) { databaseResolver.AddDatabaseSource(workingDir); } } else { databaseResolver.Initialize(workingDir, isCached); } } } // Finally, set the database resolver to the link resolver... _linkResolver = databaseResolver; } } } if (_linkResolver == null) { _linkResolver = new MemoryMsdnResolver(); } }
private TargetMsdnController() { _linkResolver = new MemoryMsdnResolver(); }