예제 #1
0
        public void ProcessEntry(ITemplateEntry entry)
        {
            string        source = entry.Get();
            StringBuilder dest   = new StringBuilder();
            int           start  = -1;

            for (int i = 0; i < source.Length; i++)
            {
                if (start < 0)
                {
                    if (source[i] == '{' && (i == 0 || source[i - 1] != '\\'))
                    {
                        start = i + 1;
                    }
                    else
                    {
                        dest.Append(source[i]);
                    }
                }
                else
                {
                    if (source[i] == '}' && source[i - 1] != '\\')
                    {
                        dest.Append(ProcessArgument(source.Substring(start, i - start - 1)));
                        start = -1;
                    }
                }
            }
        }
예제 #2
0
 public void WriteEntry(ITemplateEntry entry)
 {
     if (entry != null)
     {
         writer.WriteLine(entry.Get());
     }
 }