public bool GetRules(string ruleName, out RuleCollection ruleCollection)
        {
            bool result = false;
            ruleCollection = null;
            string ruleText;

            ErrorCollectorManager.ClearErrors(_fileManager);

            try
            {
                result = _fileManager.ReadTextFile(String.Format("{0}{1}{2}", Directory.GetCurrentDirectory(), "\\Rules\\", ruleName), out ruleText);

                if (result)
                {
                    ruleCollection = ModelSerializer.Deserialize<RuleCollection>(ruleText);
                    result = true;
                }
                else
                {
                    ErrorCollectorManager.CollectErrors(_fileManager, Errors);
                }
            }
            catch (Exception e)
            {
                Errors.Add(new ErrorModel { Message = e.Message, Exception = e });
            }

            return result;
        }
        private string GetTemplate(string sourceText, RuleCollection rules)
        {
            foreach (Rule rule in rules.Rules)
            {
                var regex = new Regex(String.Format(@"<{0}>[0-9a-zA-Z\.\-:]+</{0}>", rule.TagName));
                sourceText = regex.Replace(sourceText, String.Format("<{0}>{1}</{0}>", rule.TagName, rule.TagContent));
            }

            return sourceText;
        }