Example #1
0
        private void LoadIgnoredDirectories()
        {
            if (File.Exists(IgnoreDirectoryFile))
            {
                Logger.Info("Loading ignore directories...");

                Data.Ignore.Directories ignoreDirectories = null;

                XmlSerializer serializer = new XmlSerializer(typeof(Data.Ignore.Directories));
                using (StreamReader reader = new StreamReader(IgnoreDirectoryFile))
                {
                    ignoreDirectories = (Data.Ignore.Directories)serializer.Deserialize(reader);
                }

                if (ignoreDirectories.Items != null)
                {
                    foreach (var dir in ignoreDirectories.Items)
                    {
                        DirectoryInfo directoryInfo = new DirectoryInfo(dir.Value);

                        if (directoryInfo.Exists)
                        {
                            IgnoreDirectories.Add(directoryInfo.FullName);
                        }
                    }
                }
            }
        }