Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Looks up the OsTagTemplate defined for the tag.
 /// Returns null if tag is not defined.
 /// </summary>
 /// <param name="tag"></param>
 /// <returns></returns>
 internal CustomTagTemplate GetTagTemplate(string tag)
 {
     if (CustomTags.ContainsKey(tag))
     {
         return(CustomTags[tag]);
     }
     return(null);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Tests to see if the given tag is a defined custom tag.
 /// </summary>
 /// <param name="tag"></param>
 /// <returns></returns>
 public bool IsCustomTag(string tag)
 {
     return(CustomTags.ContainsKey(tag));
 }