private void LoadConfiguration()
        {
            if (!_fileReader.FileExists(REPOSITORY_CONFIGURATION_FILE))
            {
                throw CreateConfigurationNotFoundException(REPOSITORY_CONFIGURATION_FILE);
            }

            var lines = _fileReader.ReadAllLines(REPOSITORY_CONFIGURATION_FILE);

            foreach (var line in lines)
            {
                if (!line.StartsWith("//"))
                {
                    var directory = line.Trim();

                    if (_directoryReader.DirectoryExists(directory))
                    {
                        Registry.Add(new Repository(directory));
                    }
                    else
                    {
                        throw CreateDirectoryNotFoundException(directory);
                    }
                }
            }
        }
        /// <summary>
        /// Compares the files defined in the WixDirectoryElement against those
        /// on the file system and returns any differences.
        /// </summary>
        public WixPackageFilesDiffResult[] Compare(WixDirectoryElementBase directoryElement)
        {
            List <string> wixPackageFiles = GetAllFiles(directoryElement);
            List <string> files           = new List <string>();

            // Find all files on the file system based on the directories
            // used in the Wix document.
            searchedDirectories = new List <string>();
            foreach (string fileName in wixPackageFiles)
            {
                string directory = Path.GetDirectoryName(fileName);
                if (!HasDirectoryBeenSearched(directory))
                {
                    if (directoryReader.DirectoryExists(directory))
                    {
                        foreach (string directoryFileName in directoryReader.GetFiles(directory))
                        {
                            if (!excludedFileNames.IsExcluded(directoryFileName))
                            {
                                files.Add(Path.Combine(directory, directoryFileName));
                            }
                        }
                    }
                }
            }

            // Look for new files.
            List <string> missingFiles = new List <string>();
            List <string> removedFiles = new List <string>();

            foreach (string fileName in wixPackageFiles)
            {
                int index = GetFileNameIndex(files, fileName);
                if (index >= 0)
                {
                    removedFiles.Add(files[index]);
                    files.RemoveAt(index);
                }
                else
                {
                    // Check that this file has not already been removed.
                    index = GetFileNameIndex(removedFiles, fileName);
                    if (index == -1)
                    {
                        missingFiles.Add(fileName);
                    }
                }
            }

            // Add new files.
            List <WixPackageFilesDiffResult> results = new List <WixPackageFilesDiffResult>();

            foreach (string fileName in files)
            {
                results.Add(new WixPackageFilesDiffResult(fileName, WixPackageFilesDiffResultType.NewFile));
            }

            // Add missing files.
            foreach (string fileName in missingFiles)
            {
                results.Add(new WixPackageFilesDiffResult(fileName, WixPackageFilesDiffResultType.MissingFile));
            }

            // Add new directories.
            results.AddRange(GetNewDirectories());

            return(results.ToArray());
        }