/// <summary> /// Adds a new control to the content block /// </summary> /// <param name="control"></param> /// <returns></returns> public override BaseGadgetControl AddControl(BaseGadgetControl control) { base.AddControl(control); if (control is DataScript) { DataScript script = (DataScript)control; //script.ViewNames = this.ViewNames; DataScripts.Add(script); ConfirmDataItemsRegistered(); } else if (control is BaseDataControl) { AutoDataScript.AddControl(control); AutoDataScript.ConfirmDataItemsRegistered(); } else if (control is OsTagTemplate) { MyCustomTagFactory.RegisterCustomTag((OsTagTemplate)control); } else if (control is OsTemplate && !(control is OsTagTemplate)) { //Templates.Add(control.ID, (OsTemplate)control); Templates.Add((OsTemplate)control); } else if (control is OsVar) { //also add to templates for parsing Templates.Add(control); } else if (control is GadgetLiteral) { ((GadgetLiteral)control).SuppressCDATATags = true; Templates.Add(control); } else { //what the heck, add everything else directly for SimpleGadget support Templates.Add(control); } return(control); }