private BBTag GetTag(BBCodeItem bbCode)
        {
            var expression = new Regex(@"\{(\s*?.*?)\}");
            var matches = expression.Matches(bbCode.BeginTag);
            var attributes = (from Match match in matches where match.Value != "{content}" select new BBAttribute(match.Value.Replace("{", string.Empty).Replace("}", string.Empty), "")).ToList();

            return new BBTag(bbCode.Tag, bbCode.BeginTag, bbCode.EndTag ?? string.Empty, bbCode.AutoRenderContent,
                             bbCode.RequireClosingTag, attributes.ToArray());

            //if(attributes.Count == 0 && bbCode.BeginTag.Contains("${content}"))
            //    return new BBTag(bbCode.Tag, bbCode.BeginTag, bbCode.EndTag ?? string.Empty, false, false);
            //else if(attributes.Count > 0)
            //    return new BBTag(bbCode.Tag, bbCode.BeginTag, bbCode.EndTag ?? string.Empty, true, false, attributes.ToArray());

            //return new BBTag(bbCode.Tag, bbCode.BeginTag, bbCode.EndTag ?? string.Empty, true, false);
        }
 /// <summary>
 /// Create a new BBCodeItem object.
 /// </summary>
 /// <param name="bBCodeID">Initial value of the BBCodeID property.</param>
 /// <param name="tag">Initial value of the Tag property.</param>
 /// <param name="beginTag">Initial value of the BeginTag property.</param>
 public static BBCodeItem CreateBBCodeItem(global::System.Int32 bBCodeID, global::System.String tag, global::System.String beginTag)
 {
     BBCodeItem bBCodeItem = new BBCodeItem();
     bBCodeItem.BBCodeID = bBCodeID;
     bBCodeItem.Tag = tag;
     bBCodeItem.BeginTag = beginTag;
     return bBCodeItem;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the BBCodeItems EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToBBCodeItems(BBCodeItem bBCodeItem)
 {
     base.AddObject("BBCodeItems", bBCodeItem);
 }