/// <summary>
        /// Сохранить количество тэгов в SVG.
        /// </summary>
        /// <param name="folderPath">Путь к каталогу</param>
        private static void SaveTagsCount(string folderPath)
        {
            const int maxTagsCount = 5000;

            folderPath += CountOfTagsFileName;
            int    tagsCount      = XMLReporter.GetTagsCount();
            string displayingText = $"{tagsCount} тэг(ов)";
            string result         = MakeStringForWriting(tagsCount, maxTagsCount,
                                                         displayingText);

            WriteFile(result, folderPath);
        }
        /// <summary>
        /// Сохранить количество тэгов в SVG.
        /// </summary>
        /// <param name="folderPath">Путь к каталогу</param>
        private void SaveTagsCount(string folderPath)
        {
            const int maxTagsCount = 5000;

            folderPath += CountOfTagsFileName;
            int    tagsCount = XMLReporter.GetTagsCount();
            string labelName = GenerateNounAfterNumber("тэг", tagsCount,
                                                       string.Empty, "а", "ов");
            string displayingText = $"{tagsCount} {labelName}";
            string result         = MakeStringForWriting(tagsCount, maxTagsCount,
                                                         displayingText);

            WriteFile(result, folderPath);
        }
Esempio n. 3
0
        /// <summary>
        /// Сохранить количество тэгов в SVG.
        /// </summary>
        /// <param name="folderPath">Путь к каталогу</param>
        private static void SaveTagsCount(string folderPath)
        {
            const int maxTagsCount = 5000;

            folderPath += countOfTagsFileName;
            int    tagsCount     = XMLReporter.GetTagsCount();
            string strForWriting = $"{tagsCount.ToString()} тэг(ов)";
            int    currentValue  = ValueAsPercentage(tagsCount, maxTagsCount);
            string result        = string.Format(svgFilePattern, percents,
                                                 currentValue, strForWriting);

            var tagsWriter = new StreamWriter(folderPath, false, Encoding.UTF8);

            tagsWriter.WriteLine(result);
            tagsWriter.Flush();
            tagsWriter.Close();
        }