/// <summary> /// Constructor to set default properties. /// </summary> /// <param name="c"></param> /// <param name="CanPublish"></param> /// <param name="Id"></param> /// <remarks> /// This method used to create all of the child controls too which is BAD since /// the page hasn't started initializing yet. Control IDs were not being named /// correctly, etc... I've moved the child control setup/creation to the CreateChildControls /// method where they are suposed to be. /// </remarks> public ContentControl(Content c, publishModes CanPublish, string Id) { ID = Id; this.CanPublish = CanPublish; _content = c; Width = 350; Height = 350; SaveAndPublish += new EventHandler(standardSaveAndPublishHandler); Save += new EventHandler(standardSaveAndPublishHandler); prntpage = (UmbracoEnsuredPage)Page; // zb-00036 #29889 : load it only once if (virtualTabs == null) { virtualTabs = _content.ContentType.getVirtualTabs.ToList(); } foreach (ContentType.TabI t in virtualTabs) { TabPage tp = NewTabPage(t.Caption); addSaveAndPublishButtons(ref tp); } }
/// <summary> /// Constructor to set default properties. /// </summary> /// <param name="c"></param> /// <param name="CanPublish"></param> /// <param name="Id"></param> /// <remarks> /// This method used to create all of the child controls too which is BAD since /// the page hasn't started initializing yet. Control IDs were not being named /// correctly, etc... I've moved the child control setup/creation to the CreateChildControls /// method where they are suposed to be. /// </remarks> public ContentControl(Content c, publishModes CanPublish, string Id) { ID = Id; this.CanPublish = CanPublish; _content = c; Width = 350; Height = 350; SaveAndPublish += new EventHandler(standardSaveAndPublishHandler); Save += new EventHandler(standardSaveAndPublishHandler); prntpage = (UmbracoEnsuredPage)Page; // zb-00036 #29889 : load it only once if (virtualTabs == null) virtualTabs = _content.ContentType.getVirtualTabs.ToList(); foreach (ContentType.TabI t in virtualTabs) { TabPage tp = NewTabPage(t.Caption); addSaveAndPublishButtons(ref tp); } }