/// <summary>
 /// Initializes a new instance of the <see cref="TemplateContainer"/> class.
 /// </summary>
 /// <param name="parent">The parent.</param>
 public TemplateContainer(TemplateContainer parent)
 {
     this.Parent = parent;
     this.Attributes = new Dictionary<string, object>();
     this.ArrayValues = new List<TemplateContainer>();
     this.ArrayValuesMap = new Dictionary<string, TemplateContainer>();
 }
 private string GetKeyFromArrayValue(TemplateContainer item)
 {
     foreach (KeyValuePair<string, TemplateContainer> kvp in this.ArrayValuesMap)
     {
         if (kvp.Value == item)
         {
             return kvp.Key;
         }
     }
     return null;
 }
 public TemplateContainer AddChild(string name, TemplateContainer container)
 {
     this.AddAttribute(name, container);
     return container;
 }
 public TemplateContainer AddArrayValue(string key, TemplateContainer item)
 {
     this.ArrayValuesMap.Add(key, item);
     this.ArrayValues.Add(item);
     return item;
 }
 public TemplateContainer AddArrayValue(TemplateContainer item)
 {
     return this.AddArrayValue(this.ArrayValues.Count.ToString(), item);
 }
 public TemplateLink(TemplateContainer parent, string link)
 {
     this.Parent = parent;
     this.Link = link;
     this.ListValues = null;
 }