public IndexFilterManager(IndexFilterSettings indexFilterSettings, ILog logger) { Contract.Requires(indexFilterSettings != null, "IndexFilterManager:Constructor - index filter settings cannot be null!"); Contract.Requires(logger != null, "IndexFilterManager:Constructor - logger cannot be null!"); IndexFilterSettings = indexFilterSettings; Logger = logger; }
private static void SaveIndexFilterSettingsToFile(IndexFilterSettings currentFilterSettings, string indexStatePath) { if (currentFilterSettings == null) return; XmlSerializer xmlSerializer = null; TextWriter textWriter = null; try { xmlSerializer = new XmlSerializer(typeof(IndexFilterSettings)); textWriter = new StreamWriter(indexStatePath); xmlSerializer.Serialize(textWriter, currentFilterSettings); } finally { if (textWriter != null) textWriter.Close(); } }
private static IndexFilterSettings GetDefaultIndexFilterSettings() { var indexFilterSettings = new IndexFilterSettings { IgnoredExtensions = new List<string> { ".tmp", ".db" }, IgnoredDirectories = new List<string> { "bin", "obj", ".hg" } }; return indexFilterSettings; }