public CustomTag CreateTagInstance(string tag, string markup, RootElementMaster rootMaster) { if (string.IsNullOrEmpty(tag)) { throw new ArgumentNullException("Must specify tag"); } if (!CustomTags.ContainsKey(tag)) { return(null); } CustomTagTemplate template = CustomTags[tag]; if (template != null) { if (template.MyRootMaster != rootMaster) { template.MyRootMaster = rootMaster; template.Parse(); } else { if (!template.IsParsed || template.Controls.Count == 0) { template.Parse(); } } } return(new CustomTag(tag, CustomTags[tag], markup)); }
/// <summary> /// Registers a new custom tag to be available for use within a gadget. /// </summary> /// <param name="tagTemplate"></param> /// <returns></returns> public CustomTagTemplate RegisterCustomTag(CustomTagTemplate tagTemplate) { if (null == tagTemplate) { throw new ArgumentNullException(); } if (string.IsNullOrEmpty(tagTemplate.Tag)) { throw new ArgumentException("Custom template does not define a tag"); } CustomTags.Add(tagTemplate.Tag, tagTemplate); if (!tagTemplate.IsParsed) { tagTemplate.Parse(); } return(tagTemplate); }
public CustomTag(string tag, CustomTagTemplate template, string markup) : this(tag, template) { LoadTag(markup); }
/// <summary> /// Registers a new custom tag to be available for use within a gadget. /// </summary> /// <param name="tag"></param> /// <param name="tagTemplate"></param> /// <returns></returns> public CustomTagTemplate RegisterCustomTag(string tag, string tagTemplate) { CustomTagTemplate newTagDef = new CustomTagTemplate(tag, tagTemplate, MyRootMaster); return(RegisterCustomTag(newTagDef)); }
public CustomTag(string tag, CustomTagTemplate template) { MyRootMaster = template.MyRootMaster; this.MarkupTag = tag; this.TagTemplate = template; }