/// <summary>
        /// Прочитать конфиг файл
        /// </summary>
        /// <param name="document">XML документ</param>
        /// <returns>Результат чтения</returns>
        private XmlConfigReadingResult ReadConfigurationFile(XDocument document)
        {
            var readingResult = new XmlConfigReadingResult();

            IEnumerable <XElement> directoryElements = document.Descendants("directory").ToList();

            if (directoryElements.Any())
            {
                String directoryDimensionStr   = directoryElements.First().AttributeSafe("dimension");
                String directorySourceColorStr = directoryElements.First().AttributeSafe("sourceColor");
                String directoryColorStr       = directoryElements.First().AttributeSafe("color");
                String directoryWidthStr       = directoryElements.First().AttributeSafe("width");
                String directoryHightStr       = directoryElements.First().AttributeSafe("height");
                String directoryUnitTypeStr    = directoryElements.First().AttributeSafe("unitType");

                readingResult.ConfigDirectoryInfo = new XmlConfigDirectoryInfo()
                {
                    Dimension    = directoryDimensionStr,
                    SourceColor  = ParseColorStr(directorySourceColorStr),
                    Color        = ParseColorStr(directoryColorStr),
                    Size         = ParseSizeStr(directoryWidthStr, directoryHightStr),
                    SizeUnitType = ParseSizeUnitTypeStr(directoryUnitTypeStr)
                };

                IEnumerable <XElement> fileConfigElements = directoryElements.Descendants("file").ToList();
                foreach (var fileConfigElement in fileConfigElements)
                {
                    String fileNameStr        = fileConfigElement.AttributeSafe("name");
                    String fileDimensionStr   = fileConfigElement.AttributeSafe("dimension");
                    String fileSourceColorStr = fileConfigElement.AttributeSafe("sourceColor");
                    String fileColorStr       = fileConfigElement.AttributeSafe("color");
                    String fileWidthStr       = fileConfigElement.AttributeSafe("width");
                    String fileHightStr       = fileConfigElement.AttributeSafe("height");
                    String fileUnitTypeStr    = fileConfigElement.AttributeSafe("unitType");

                    if (!String.IsNullOrEmpty(fileNameStr))
                    {
                        readingResult.ConfigFileInfoCollection.Add(new XmlConfigFileInfo()
                        {
                            FileName     = fileNameStr,
                            Dimension    = fileDimensionStr,
                            SourceColor  = ParseColorStr(fileSourceColorStr),
                            Color        = ParseColorStr(fileColorStr),
                            Size         = ParseSizeStr(fileWidthStr, fileHightStr),
                            SizeUnitType = ParseSizeUnitTypeStr(fileUnitTypeStr)
                        });
                    }
                    else
                    {
                        readingResult.ConfigErrorCollection.Add(new XmlConfigError(fileConfigElement.ToString(), "Ошибка разбора полей для файла"));
                    }
                }
            }
            else
            {
                readingResult.ConfigErrorCollection.Add(new XmlConfigError(directoryElements.ToString(), "Ошибка разбора полей для директории"));
            }

            return(readingResult);
        }
        /// <summary>
        /// Прочитать конфиг файл
        /// </summary>
        /// <param name="document">XML документ</param>
        /// <returns>Результат чтения</returns>
        private XmlConfigReadingResult ReadConfigurationFile(XDocument document)
        {
            var readingResult = new XmlConfigReadingResult();

            IEnumerable<XElement> directoryElements = document.Descendants("directory").ToList();
            if (directoryElements.Any())
            {
                String directoryDimensionStr = directoryElements.First().AttributeSafe("dimension");
                String directorySourceColorStr = directoryElements.First().AttributeSafe("sourceColor");
                String directoryColorStr = directoryElements.First().AttributeSafe("color");
                String directoryWidthStr = directoryElements.First().AttributeSafe("width");
                String directoryHightStr = directoryElements.First().AttributeSafe("height");
                String directoryUnitTypeStr = directoryElements.First().AttributeSafe("unitType");

                readingResult.ConfigDirectoryInfo = new XmlConfigDirectoryInfo()
                {
                    Dimension = directoryDimensionStr,
                    SourceColor = ParseColorStr(directorySourceColorStr),
                    Color = ParseColorStr(directoryColorStr),
                    Size = ParseSizeStr(directoryWidthStr, directoryHightStr),
                    SizeUnitType = ParseSizeUnitTypeStr(directoryUnitTypeStr)
                };

                IEnumerable<XElement> fileConfigElements = directoryElements.Descendants("file").ToList();
                foreach (var fileConfigElement in fileConfigElements)
                {
                    String fileNameStr = fileConfigElement.AttributeSafe("name");
                    String fileDimensionStr = fileConfigElement.AttributeSafe("dimension");
                    String fileSourceColorStr = fileConfigElement.AttributeSafe("sourceColor");
                    String fileColorStr = fileConfigElement.AttributeSafe("color");
                    String fileWidthStr = fileConfigElement.AttributeSafe("width");
                    String fileHightStr = fileConfigElement.AttributeSafe("height");
                    String fileUnitTypeStr = fileConfigElement.AttributeSafe("unitType");

                    if (!String.IsNullOrEmpty(fileNameStr))
                    {
                        readingResult.ConfigFileInfoCollection.Add(new XmlConfigFileInfo()
                        {
                            FileName = fileNameStr,
                            Dimension = fileDimensionStr,
                            SourceColor = ParseColorStr(fileSourceColorStr),
                            Color = ParseColorStr(fileColorStr),
                            Size = ParseSizeStr(fileWidthStr, fileHightStr),
                            SizeUnitType = ParseSizeUnitTypeStr(fileUnitTypeStr)
                        });
                    }
                    else
                    {
                        readingResult.ConfigErrorCollection.Add(new XmlConfigError(fileConfigElement.ToString(), "Ошибка разбора полей для файла"));
                    }
                }
            }
            else
            {
                readingResult.ConfigErrorCollection.Add(new XmlConfigError(directoryElements.ToString(), "Ошибка разбора полей для директории"));
            }

            return readingResult;
        }