protected TagBase GetTagFromType(string type, string value, bool hasContents)
{
foreach (Type myTagType in Tags)
{
string myType = TagBase.GetTagType(myTagType);
if (string.Compare(myType, type, true) == 0)
{
TagBase myTag = Activator.CreateInstance(myTagType) as TagBase;
myTag.InitializeFromData(this, value, hasContents);
return myTag;
}
}
throw new Exception(string.Format("Tag cannot be found: {0}", type));
}