/// Applies any text replacements to the ID of this object and returns the result
        public virtual string GetModifiedID(TemplateSettings settings)
        {
            string result = id;

            if (settings != null)
            {
                result = settings.ApplyReplacementsToText(result);
            }

            //Return the result
            return(result);
        }
Exemple #2
0
        private bool IsNamespaceUsed(string id, TemplateSettings settings)
        {
            bool result = false;

            for (int i = 0; i < children.Count && !result; ++i)
            {
                if (children[i] is XmlNamespace @namespace)
                {
                    result = settings.ApplyReplacementsToText(@namespace.id) == id;
                }
            }

            return(result);
        }
Exemple #3
0
        public static string BuildCodeFromTemplate(XmlTemplate template, TemplateSettings settings)
        {
            //Create the code
            StringBuilder codeBuilder = new StringBuilder(_4KiB);

            template.ToCSharp(codeBuilder, 0, settings);

            //Transform the code
            string code = NormalizeLineEndings(codeBuilder.ToString(), settings.lineEndings);

            code = NormalizeTabs(codeBuilder.ToString(), settings.tabMode);
            code = settings.ApplyReplacementsToText(code);

            //Return the result
            return(code);
        }