/// <summary> /// Creates and resolves an OSML control and adds it to the control tree. /// Override this method to allow for special logic - ex: custom tags /// </summary> /// <param name="offsetItem"></param> /// <param name="markup"></param> /// <returns></returns> protected virtual BaseGadgetControl AddResolveControlTag(OffsetItem offsetItem, string markup) { if (ControlFactory.RESERVEDKEY_CUSTOM_TAG == offsetItem.OffsetKey) { string customTagName = GetBlobTagName(markup); CustomTag tagInstance = MyCustomTagFactory.CreateTagInstance(customTagName, markup, this.MyRootMaster); return(this.AddControl(tagInstance)); } else { return(this.AddControl(MyControlFactory.CreateControl(offsetItem, markup, MyControlFactory.GetChildControlContextGroup(this.GetType(), this.MyParseContext), MyRootMaster))); } }
/// <summary> /// Creates a copy of current custom tag with new instance markup /// </summary> /// <param name="markup"></param> /// <returns></returns> public CustomTag NewInstance(string markup) { CustomTag newTag = new CustomTag(); newTag.MarkupTag = this.MarkupTag; newTag.TagTemplate = this.TagTemplate; if (!string.IsNullOrEmpty(markup)) { newTag.LoadTag(markup); } newTag.MyRootMaster = this.MyRootMaster; return(newTag); }