Commits

Anonymous committed 015a884

more work

Comments (0)

Files changed (1)

TemplateStrings/Template.cs

     public abstract class Template
     {
 
-        protected abstract TemplateValueCollection TemplateValues
+        protected abstract IList<TemplateValue> TemplateValues
         { get;}
 
         private string _template;
 
         public string Substitute(IDictionary<string, string> mapping, bool throwNoException)
         {
-            TemplateValueCollection _TemplateValues = TemplateValues;
+            IList<TemplateValue> _TemplateValues = TemplateValues;
 
             Validate();
             Regex regex = new Regex(GetRegex(),RegexOptions.Compiled|RegexOptions.ExplicitCapture|RegexOptions.CultureInvariant);
             : base(template)
         { }
 
-        protected override TemplateValueCollection TemplateValues
+        protected override IList<TemplateValue> TemplateValues
         {
             get
             {
-                TemplateValueCollection templateValues = new TemplateValueCollection();
+                
 
                 TemplateValue value1 = new TemplateValue();
                 value1.StartDelimiter = "$";
                 value2.StartDelimiterEscape = "$${";
                 value2.EndDelimiter = "}";
 
-                templateValues.Add(value1);
-                templateValues.Add(value2);
-
-                return templateValues;
+                return new TemplateValue[]{value1,value2};
             }
         }
     }
             : base(template)
         { }
 
-        protected override TemplateValueCollection TemplateValues
+        protected override IList<TemplateValue> TemplateValues
         {
             get
             {
-                TemplateValueCollection templateValues = new TemplateValueCollection();
-
-
                 TemplateValue value2 = new TemplateValue();
                 value2.StartDelimiter = "{";
                 value2.StartDelimiterEscape = "{{";
                 value2.EndDelimiter = "}";
                 value2.EndDelimiterEscape = "}}";
 
-                templateValues.Add(value2);
 
-                return templateValues;
+                return new TemplateValue[] {value2 };
             }
         }
     }