public static void Generate(string directory)
        {
            //Группируем их по название группы триггеров
            var groups = EccTemplateListGenerator.Templates.GroupBy(x => x.TriggerGroupName).ToList();

            var triggerClasses = groups.Select(x => TemplateCodeInitDataClassGenerator.GetTriggersClass(new TemplateCodesInitTriggersOptions
            {
                StaticClassSummary = $"Триггеры группы {x.Key}",
                TemplatesData      = x.ToList(),
                TemplateSchemaName = x.Key
            }));

            var triggersClass = new GenerateClassBaseModel
            {
                ClassName  = TemplateCodeInitDataClassGenerator.TriggersName,
                IsStatic   = true,
                SubClasses = triggerClasses.ToList(),
                Summary    = "Триггеры шаблонов сообщений",
                NameSpace  = "Cmn.Constants.Ecc",
                Usings     = new HashSet <string>
                {
                    "System"
                }
            };

            triggersClass.CreateCSharpFileInFolder(directory, new GenerateClassOptions
            {
                IncludeUsingsAndNameSpace = true
            });
        }
        public static void GenerateEccMasks(string directory)
        {
            var masks = JsonSchemaToFileWriter.GetSchemaFromFile <List <EccMaskModel> >(FilePath(directory));

            GenerateEccDefaultMaskValues(masks, directory);
            GenerateEccMasksInitDataClass(masks, directory);

            var model = new GenerateClassBaseModel
            {
                ClassName = SchemaName,
                Summary   = "Маски используемые для рассылок, которые будут заменены на значения",
                IsStatic  = true,
                NameSpace = "Cmn.Constants.Ecc",
            };

            model.Properties.AddRange(masks.Select(x => new GenerateConstStringProperty
            {
                Value        = x.Mask,
                PropertyName = x.Mask,
                Description  = x.Description
            }).ToList());

            model.CreateCSharpFileInFolder(directory, new GenerateClassOptions
            {
                IncludeUsingsAndNameSpace = true,
            });

            GenerateResources(masks, directory);
        }
        private static void GenerateEccDefaultMaskValues(List <EccMaskModel> data, string resultsFolder)
        {
            var model = new GenerateClassBaseModel
            {
                ClassName = "EccMaskDefaultValues",
                Summary   = "Значения статических масок, которые используются для рассылок",
                IsStatic  = true,
                NameSpace = "Cmn.Constants.Ecc",
                Usings    = new HashSet <string>
                {
                    "System.Collections.Generic"
                }
            };

            data.ForEach(x => x.Description = x.Description.Replace("\n", string.Empty));

            var rows = data.Where(x => !string.IsNullOrWhiteSpace(x.DefaultValue));

            model.Properties.AddRange(rows.Select(x => new GenerateConstStringProperty
            {
                Value        = x.DefaultValue.Replace(System.Environment.NewLine, @"\r\n").Replace("\"", "\\\""),
                PropertyName = x.Mask,
                Description  = x.Description
            }).ToList());

            model.Properties.Add(new FillDictionaryStaticMethodProperty
            {
                PropertyName = "FillDictionary",
                MasksToFill  = new HashSet <string>(rows.Select(x => Unwrap(x.Mask))),
                Description  = "Заполнить словарь дефолтными значениями масок"
            });

            model.CreateCSharpFileInFolder(resultsFolder, new GenerateClassOptions
            {
                IncludeUsingsAndNameSpace = true
            });
        }
        private static void GenerateEccMasksInitDataClass(List <EccMaskModel> data, string resultsFolder)
        {
            var model = new GenerateClassBaseModel
            {
                ClassName = $"{SchemaName}InitData",
                Summary   = "Маски используемые для рассылок, которые будут заменены на значения",
                IsStatic  = true,
                NameSpace = "Ecc.Model.InitData",
                Usings    = new HashSet <string>
                {
                    "Ecc.Model.Models",
                    "System.Collections.Generic",
                    "Ecc.Model.Resources"
                }
            };

            model.Properties.Add(new GenerateStaticGetListOfDataMethod
            {
                Description = "Получить маски для того, чтобы положить в базу",
                EnumeratedElementClassName = "EccTemplateMask",
                PropertyName       = "GetMasks",
                EnumeratedElements = data.Select((x, i) => new Dictionary <string, string>
                {
                    [nameof(EccMaskModel.Mask)] = $"{MaskResourceName}.{ToMaskNameResName(x.Mask)}",
                    [nameof(EccMaskModel.SpanishDescription)] = $"{MaskResourceName}.{ToSpanishResName(x.Mask)}",
                    [nameof(EccMaskModel.EnglishDescription)] = $"{MaskResourceName}.{ToEnglishResName(x.Mask)}",
                    [nameof(EccMaskModel.Description)]        = $"{MaskResourceName}.{ToRussianResName(x.Mask)}",
                    [nameof(EccMaskModel.DefaultValue)]       = string.IsNullOrWhiteSpace(x.DefaultValue)? "null" : ToStringPropertyValue(x.DefaultValue)
                }).ToList()
            });

            model.CreateCSharpFileInFolder(resultsFolder, new GenerateClassOptions
            {
                IncludeUsingsAndNameSpace = true,
            });
        }